Skip to content

Instantly share code, notes, and snippets.

@panthomakos
panthomakos / user_presenter_spec.rb
Created January 26, 2012 21:29
Simplified Version of user_presenter_spec.rb from DestroyAllSoftware
class Module
alias :let :define_method
end
UserPresenter = Struct.new(:user) do
let(:full_name){ [user.first_name, user.last_name].join(' ') }
end
describe UserPresenter do
let(:user){ stub(:user, :first_name => 'Bob', :last_name => 'Smith') }
@panthomakos
panthomakos / example1.js
Created June 30, 2011 07:23
Avoiding Nested Callbacks in Javascript
var fs = require('fs');
fs.mkdir('./hello',0777,makeDirectory);
function makeDirectory(err){
if (err) throw err;
fs.writeFile('./hello/world.txt', 'Hello!', writeFile);
}
function writeFile(err){
@panthomakos
panthomakos / Gemfile
Created May 18, 2011 18:41
Spork, RSpec, Sham and Caching Classes
source 'http://rubygems.org'
gem 'rails', '3.0.4'
group :test do
gem 'database_cleaner'
gem 'rspec-rails'
gem 'rspec-rails-matchers'
gem 'sham'
gem 'spork', '=0.9.0.rc7'
@panthomakos
panthomakos / keybase.md
Created March 19, 2014 23:41
keybase.io

Keybase proof

I hereby claim:

  • I am panthomakos on github.
  • I am pan (https://keybase.io/pan) on keybase.
  • I have a public key whose fingerprint is A2C6 17A6 4D65 2854 1240 7843 39F8 C7AA 10D9 15ED

To claim this, I am signing this object: