View notifier.js
var Hoptoad = {
VERSION : '0.1.0',
NOTICE_XML : '<?xml version="1.0" encoding="UTF-8"?><notice version="2.0"><api-key></api-key><notifier><name>hoptoad_notifier_js</name><version>0.1.0</version><url></url></notifier><error><class>EXCEPTION_CLASS</class><message>EXCEPTION_MESSAGE</message><backtrace>BACKTRACE_LINES</backtrace></error><request><url>REQUEST_URL</url><component>REQUEST_COMPONENT</component><action>REQUEST_ACTION</action></request><server-environment><project-root>PROJECT_ROOT</project-root><environment-name>production</environment-name></server-environment></notice>',
ROOT : window.location.protocol + '//' +,
BACKTRACE_MATCHER : /^(.*)\@(.*)\:(\d+)$/,
backtrace_filters : [/notifier\.js/],
notify: function(error) {
var xml = escape(Hoptoad.generateXML(error));
var host = || '';
View fizz-buzz.rb
# Usage: ruby fizz-buzz.rb max_num
# create a constant for the default
# if no command-line argument is specified
# max number is either our default,
# or the command-line argument.
# ARGV is an array that holds your cmd-line args.
# so if you typed ruby fizz-buzz.rb 13 monkey dawg
# puts ARGV[0] <---- prints 13
View gist:1206664
class ImportLegacyDevices < ActiveRecord::Migration
def self.up
return unless Rails.env.production?
legacy_devices.each do |device_id, issue|
if device = Device.find_by_hardware_id(device_id)
unless InclusiveIssue.exists?(:issue_id =>, :device_id =>
:issue => issue,
:device => device,
View jquery-innershiv-extend.js
var _oldHtml = $.fn.html;
$.fn.html = function(value) {
if ($.browser.msie && typeof value === 'string') {
return, innerShiv(value, false));
} else {
return _oldHtml.apply(this, arguments);
View gist:1162318
# env.rb
Capybara.register_driver :selenium do |app|, :browser => :chrome)
Download chromedriver from
mv chromedriver to /usr/local/bin so it's in your path.
View gist:488352
require 'RMagick'
class WatermarkMe
def initialize(app, args)
@app = app
@watermark_text, @mime_types = *args
@mime_types ||= %w[image/jpeg image/png image/gif]
def call(env)
View only-for-me.rb
This application is only for me. Or can you tell the secret?
<form method="post" action="<%= current_action %>">
<input id="<%= param_name%>" name="<%= param_name%>" type="password" />
<button class="submitButton" type="submit" name="commit">Here I am!</button>
View iPhone games worth playing
Bejewled 2
Rock Band
Police Radio
Cartoon Wars
Need For Speed
Pocket God
Flight Control
Zombieville USA
View iPhone apps
Insomnia - keep your Wireless connection running when the phone is locked (that way the screen doesn't have to be on 24/7)
SBSettings - access iphone settings from anywhere by swiping the top of the screen
5 icon dock
5 column springboard
Pirni - native network sniffer
pirni-derv - view packets sniffed with Pirni in real-time on the iPhone
View gist:262595
# you'd obviously have more settings somewhere
set :scm, :git
set :repository, ""
set :branch, "origin/master"
set :migrate_target, :current
set(:latest_release) { fetch(:current_path) }
set(:release_path) { fetch(:current_path) }
set(:current_release) { fetch(:current_path) }