Skip to content

Instantly share code, notes, and snippets.

View TildeWill's full-sized avatar

Will Read TildeWill

  • Oakland, CA
View GitHub Profile
@TildeWill
TildeWill / factory.rb
Last active December 11, 2023 00:28
One method that instantiates two classes
class Pants < ApplicationRecord
# has `waist` and `inseam` attributes
end
class Shirt < ApplicationRecord
# has `chest` and `neck_size` attributes
end
class Seamstress # Domain Object
def self.make_outfit(args)
@TildeWill
TildeWill / checkman.rb
Last active April 21, 2016 16:28
Chef Recipe for Installing Checkman
remote_file '/tmp/Checkman.zip' do
source 'https://raw.githubusercontent.com/cppforlife/checkman/master/bin/Checkman.zip'
user node['sprout']['user']
end
execute 'Extract Checkman.zip' do
cwd "#{node['sprout']['home']}/Applications"
user node['sprout']['user']
command 'unzip /tmp/Checkman.zip'
@TildeWill
TildeWill / Google App Auth.rb
Last active March 23, 2017 17:41 — forked from anonymous/Gemfile
SSO for an installed Google App
#Gemfile
source 'https://rubygems.org'
...
gem 'oauth'
gem 'omniauth-google-apps'
...
@TildeWill
TildeWill / My addition to test_client.rb
Created April 1, 2012 22:29
File exist problem with Coderay
require 'coderay'
module RspecApiDocumentation
class TestClient < Struct.new(:session, :options)
#...
private
def document_example(method, action, params)
#...
request_metadata[:response_body] = formatted_response_body(last_response.body, last_response.headers['Content-Type'])
#...
@TildeWill
TildeWill / time_keeping_bookmarklet.js
Created February 11, 2012 04:40
Tracker Time Keeping Bookmarklet
javascript:(function(jQ){
var people_lists = {
'Will Read': ['Roberto Ostinelli', 'Charles Hansen', 'Max Brunsfeld', 'Stephen Hopkins', 'Mark Rushakoff', 'Will Read'],
'Davis Frank': [],
'Jonathan Barnes': [],
'David Goudreau': [],
'Ryan Richard': [],
'Danny Burkes': [],
};
var signed_in_manager = jQ('.welcome_message').text().replace('Welcome, ', '').trim();