Skip to content

Instantly share code, notes, and snippets.

View debug_system_stack_error.md

This is how I debug SystemStackError when there is no stack trace.

My first attempt was:

begin
  a_method_that_causes_infinite_recursion_in_a_not_obvious_way
rescue SystemStackError
  puts caller
end
View lean-startup-notes.md

The Lean Startup - Notes, Quotes, and Choice Snippets

The Lean Startup

Characteristics of a lean startup:

  1. Uses "platforms enabled by open source and free software."

  2. Agile development

View test_multi_select.rb
=begin
Notes
=====
Labels: On the label you should put a "for" attribute if you're not using something like simple_form
This helps capybara to find your field
e.g. <label for="my_field_id">Some label</label>
=end
field = "Label on my field"
value = "existing option in list"
@deepj
deepj / recipe.rb
Created Oct 29, 2012 — forked from systembell/recipe.rb
S3 File Resource for Chef
View recipe.rb
# Source accepts the protocol region:// with the host as the bucket
# access_key_id and secret_access_key are just that
# for the eu-west-1 region:
s3_file "/var/bulk/the_file.tar.gz" do
source "s3-eu-west-1://your.bucket/the_file.tar.gz"
access_key_id your_key
secret_access_key your_secret
owner "root"
group "root"
@deepj
deepj / upgrade_to_refinery_two.rb
Created Jul 30, 2012 — forked from craigambrose/upgrade_to_refinery_two.rb
Migration to convert from refinery 1.0.8 to refinery 2.0
View upgrade_to_refinery_two.rb
class UpgradeToRefineryTwo < ActiveRecord::Migration
def self.up
# For refinerycms-authentication
rename_table :roles_users, :refinery_roles_users
rename_table :roles, :refinery_roles
rename_table :user_plugins, :refinery_user_plugins
rename_table :users, :refinery_users
remove_column :refinery_users, :persistence_token
remove_column :refinery_users, :perishable_token
remove_column :refinery_users, :remember_token
@deepj
deepj / apns.rb
Created Apr 17, 2012 — forked from scotttam/apns.rb
Sends an Apple Push Notification with Ruby
View apns.rb
require "rubygems"
require "yajl"
require "openssl"
require "socket"
device_token = '39cac56f 986a0e66 3c4fd4f4 68df5598 024d2ca3 8b9f307c 741c180e 9fc30c62'
device_token = device_token.gsub(" ", "")
the_byte_token = [device_token].pack("H*")
file = File.open("ruby_the_byte_token", "wb")