Skip to content

Instantly share code, notes, and snippets.

View sprsquish's full-sized avatar

Jeff Smick sprsquish

View GitHub Profile

Books

Algorithms and Data Structures

The Art of Computer Programming (Knuth)

Programming Pearls (Bentley)

Data Structures and Algorithms (Aho, Hopcroft, Ullman)

module Mustache
class << self
import com.github.mustachejava.DefaultMustacheFactory
import com.github.mustachejava.jruby.JRubyObjectHandler
def template_dir
Rails.root.join('app', 'templates')
end
def factory
@codahale
codahale / Regular.java
Created September 21, 2011 22:47
An example of the utility of private[this]
//decompiled with JD-GUI
import scala.ScalaObject;
import scala.reflect.ScalaSignature;
@ScalaSignature(bytes="\006\00192A!\001\002\001\013\t9!+Z4vY\006\024(\"A\002\002\017q*W\016\035;z}\r\0011c\001\001\007\035A\021q\001D\007\002\021)\021\021BC\001\005Y\006twMC\001\f\003\021Q\027M^1\n\0055A!AB(cU\026\034G\017\005\002\020%5\t\001CC\001\022\003\025\0318-\0317b\023\t\031\002CA\006TG\006d\027m\0242kK\016$\b\"B\013\001\t\0031\022A\002\037j]&$h\bF\001\030!\tA\002!D\001\003\021\035Q\002\0011A\005\nm\t\021![\013\0029A\021q\"H\005\003=A\0211!\0238u\021\035\001\003\0011A\005\n\005\nQ![0%KF$\"AI\023\021\005=\031\023B\001\023\021\005\021)f.\033;\t\017\031z\022\021!a\0019\005\031\001\020J\031\t\r!\002\001\025)\003\035\003\tI\007\005C\003+\001\021\0051&A\002j]\016$\022A\t\005\006[\001!\taG\001\004O\026$\b")
public class Regular
implements ScalaObject
{
private int i = 0;
ls .rvm/gems/ree-1.8.7-2010.02/gems/ | perl -ne 's/(.*)-[.\d]+/$1/; print' | sort | uniq >~/gems
...change to a different ruby...
cat ~/gems | xargs gem install
@tenderlove
tenderlove / campfire.rb
Created February 16, 2011 23:43
This only works on 1.9.2
require 'uri'
require 'psych'
require 'net/http'
require 'meme' # Install meme_generator
module Campfire
class API
attr_reader :uri, :token, :pass
@bryanl
bryanl / campfire-emoji.txt
Created January 27, 2011 16:34
campfire emoji
Surround these with : e.g. :calling:
+1
-1
bulb
calling
clap
cop
email
feet
class Proc
def <<(other)
case other
when Proc
Proc.new do |*args|
call(other.call(*args))
end
else
call(other)
end