Skip to content

Instantly share code, notes, and snippets.

@statonjr
statonjr / plugin.githubGist.js
Created August 4, 2011 13:00 — forked from cheeaun/plugin.githubGist.js
GitHub Gist Embed plugin for Talkerapp (just paste the gist link and voila)
(function(){
plugin.onMessageInsertion = function(event){
var lastRow = Talker.getLastRow();
if (!lastRow.length) return;
var lastDIV = lastRow.find('div:last');
if (!lastDIV.length) return;
if (lastDIV.find('iframe.talkerapp-plugin-gist-embed').length) return;
var gistLink = lastDIV.find('a[href^=https://gist.github.com]:first');
if (!gistLink.length) return;
module God
module Conditions
class RestartFileTouched < PollCondition
attr_accessor :restart_file
def initialize
super
end
def process_start_time
Time.parse(`ps -o lstart -p #{self.watch.pid} --no-heading`)
@statonjr
statonjr / Gemfile
Created March 8, 2012 13:50
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
source :rubygems
# We are not loading Active Record, nor Active Resources etc.
# We can do this in any app by simply replacing the rails gem
# by the parts we want to use.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
gem "tzinfo"
# Let's use thin
@statonjr
statonjr / order.txt
Created June 12, 2012 15:10 — forked from bigfleet/order.txt
Jimmy John's order
http://www.jimmyjohns.com/menu/menu.aspx
Thomas Lattimore:
Scott Dieter: #5, no tomato
Mark Shropshire: JJBLT
Denny Abraham: #9 with hot peppers
Kevin Mussleman:
Glenn Goodrich: #12 without tomato
Duncan Mapes: #14
Nils: #12
@statonjr
statonjr / ubuntu_ruby_install.sh
Created August 4, 2012 02:22
Ubuntu Ruby install - rbenv and ruby-build
#!/bin/bash
# Install rbenv
# https://github.com/sstephenson/rbenv
cd ~
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> .bash_profile
echo 'eval "$(rbenv init -)"' >> .bash_profile
@statonjr
statonjr / Gemfile
Created August 18, 2012 00:45
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
source :rubygems
# We are not loading Active Record, nor Active Resources etc.
# We can do this in any app by simply replacing the rails gem
# by the parts we want to use.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
gem "tzinfo"
# Let's use thin
@statonjr
statonjr / gist:3610238
Created September 3, 2012 15:55 — forked from seancribbs/gist:1359079
Combining Roar with Webmachine.
require 'bundler/setup'
require 'roar/representer/json'
require 'roar/representer/feature/hypermedia'
require 'webmachine'
class Product
include Roar::Representer::JSON
include Roar::Representer::Feature::Hypermedia
property :name
@statonjr
statonjr / gist:3763489
Created September 21, 2012 19:47 — forked from philharvey/gist:3763444
Resources on Implementing REST/Hypermedia APIs
@statonjr
statonjr / ActiveRepository.rb
Created October 15, 2012 12:48 — forked from bokmann/ActiveRepository.rb
ActiveRepository Strawman
# MOTIVATION: As rails apps are growing, people are noticing the drawbacks
# of the ActiveRecord pattern. Several apps I have seen, and several
# developers I have spoken to are looking towards other patterns for object
# persistence. The major drawback with ActiveRecord is that the notion
# of the domain object is conflated with what it means to store/retrieve
# it in any given format (like sql, json, key/value, etc).
#
# This is an attempt to codify the Repository pattern in a way that would
# feel comfortable to beginner and seasoned Ruby developers alike.
#
Check out README.md to get started editing Clojure with Emacs.