Skip to content

Instantly share code, notes, and snippets.

View jasonm's full-sized avatar

Jason Morrison jasonm

View GitHub Profile
@jasonm
jasonm / 0_reuse_code.js
Created January 20, 2016 02:08
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
@jasonm
jasonm / after_restart.rb
Created May 24, 2010 14:46 — forked from jfernandez/after_restart.rb
Notify Hoptoad of deploys to Engine Yard Cloud
hoptoad_deploy_environments = %w(staging production)
if hoptoad_deploy_environments.include?(@configuration[:environment])
# Notify Hoptoad of deploy
run "cd #{release_path} && rake hoptoad:deploy TO=#{@configuration[:environment]} REVISION=#{@configuration[:revision]} REPO=#{@configuration[:repository]}"
end
# via http://robots.thoughtbot.com/post/168368158/lets-get-ready-to-rummmmmmmble
require 'rubygems'
require 'hpricot'
require 'open-uri'
def get_stock_name
doc = Hpricot(open('http://stocknames.info'))
names = doc / '.list ul li'
names[rand(names.size)].innerText