Skip to content

Instantly share code, notes, and snippets.

@johntrandall
johntrandall / sensible_rails_new.sh
Last active November 3, 2022 04:29
Sensible Rails New
##!/bin/bash
# This is a script to quickly spin-up a Rails Project and push it to Heroku.
# Great for Hackathons and Rails-centric code challenges!
# author: John Randall
# https://gist.github.com/johntrandall/a33c7d4c880fcef2a6dc0258abec92fe
echo Hello World!
@johntrandall
johntrandall / osx-for-hackers.sh
Last active August 28, 2015 14:38 — forked from matthewmueller/osx-for-hackers.sh
OSX for Hackers (Mavericks/Yosemite)
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
@johntrandall
johntrandall / A- NodeBug?
Last active August 29, 2015 14:17
error messages not getting through to intern console reporter
Update 15-03-23: This might be a bug in node.
See
* https://github.com/joyent/node/blob/4b69dcb9610c3fa6cb0bc96f379b749bba83a817/src/smalloc.cc#L280
* https://github.com/joyent/node/issues/9180
Hello.
When a leadfoot .findByCssSelector fails, I'm usually getting a weird output on the console:
FAIL: main - spashPage module - find_login_btn (10483ms)
Assertion failed: (start <= end), function SliceOnto, file ../src/smalloc.cc, line 281.
@johntrandall
johntrandall / gist:9de03cfe2b868e44445a
Last active August 29, 2015 14:16
intern .execute issue
pageObjUserSettings{
// This works, it returns an array of strings, parallel to the array of elements returned by the .findAllByCSSSelector()
getAllTopicNames: function(){
return function () {
return this.parent
.findAllByCssSelector(".topicName")
.getVisibleText()
;
};
},
@johntrandall
johntrandall / 0_reuse_code.js
Created July 16, 2014 03:34
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@johntrandall
johntrandall / medieval weapons
Last active August 29, 2015 14:02
medieval weapons
weapons_list = [
"Baselard",
"Cinquedea",
"Ear dagger",
"GroBes Messer",
"Katar",
"Mercygiver",
"Poniard",
"Rondel",
"Scramasax",
@johntrandall
johntrandall / rails meta-data exposer
Created May 28, 2014 21:18
drop this into the footer of a view to see all the request, params, session, etc.
<div id='meta_data_printer'>
<h1>Action Dispatch</h1>
<h2>Action Dispatch::Request:</h2>
<p><%= "request = #{request} " %></p>
<p><%= "request.GET() = #{request.GET()} " %></p>
<p><%= "request.POST() = #{request.POST()} " %></p>
<p><%= "request.authorization() = #{request.authorization()} " %></p>
<p>HOW DO I VIEW THIS STRING?<%= "request.body() = #{request.body()} " %></p>