Skip to content

Instantly share code, notes, and snippets.

View isaacsanders's full-sized avatar

Isaac Sanders isaacsanders

View GitHub Profile
@isaacsanders
isaacsanders / hydrogen.rb
Created August 6, 2012 00:12
Defining an element with Chemistry
require 'chemistry/element/dsl'
include Chemistry::Element::DSL
element 'Hydrogen' do
symbol 'H'
atomic_number 1
atomic_weight 1.00794
end
@isaacsanders
isaacsanders / Gemfile
Created August 1, 2012 20:40
Make a cool graph using Githubris and Graphene
source :rubygems
gem 'graphene'
gem 'githubris'
gem 'pry'
gem 'gruff'
gem 'rmagick'
# Also requires imagemagick, but the program will yell at you for that.
@isaacsanders
isaacsanders / fibonacci.hs
Created August 1, 2012 01:21
A list of all fibonacci numbers in 1 line of Haskell.
fibonacciNumbers = 1 : scanl (+) 1 fibs
-- Thanks to @ReinH for the tip!

#Hello!

Welcome to the Site!

  • a
  • b

#Hello!

Welcome to the Site!

@isaacsanders
isaacsanders / curl.sh
Created July 18, 2012 18:59
The differences in HTTPie and cURL
curl http://api.whatever.com -d key=value -H "Authentication:Credentials" -G
@isaacsanders
isaacsanders / presentation.md
Created July 15, 2012 02:41
Integrating Stripe

What is Stripe's logo?

  • Stripe's logo is a payment processor
  • They care about UI, UX, and DX (Developer Experience)

How do they care about DX?

  • Stripe's logo gives you a test account to play with
  • You don't need to ever enter financial info for your test account
@isaacsanders
isaacsanders / Presentation.md
Created July 5, 2012 18:25
Test Presentation

Title

Slide 1

Slide 2

@isaacsanders
isaacsanders / recipe.txt
Created May 12, 2012 22:26
Cuban-style beef for sandwiches or vaca frita
Cuban-style beef for sandwiches or vaca fritz (From Jim Holmes)
Inspired from some vaca frita recipe I had at a tourist-trap Cuban restaurant in Orlando. Pot roast is traditional, brisket is freakin' awesome.
3 - 5 lbs pot roast or brisket
salt, pepper
oil
1 large onion, cut in half
@isaacsanders
isaacsanders / form_hidden_fields_helper.rb
Created May 7, 2012 19:53
Store a hash in form hidden fields
module FormHiddenFieldsHelper
# Originally based on http://marklunds.com/articles/one/314
def spread_param_hash(hash, key_prefix = '')
format_key = key_prefix.blank? ? lambda { |k| k.to_s } :
lambda { |k| "#{key_prefix}[#{k}]" }
flat_hash = {}
hash.each do |k, v|
k = format_key.call(k)
if v.is_a?(Hash)