Skip to content

Instantly share code, notes, and snippets.

View mdarby's full-sized avatar
💭
pending validation

Matt Darby mdarby

💭
pending validation
View GitHub Profile
@mdarby
mdarby / object-watch.js
Created September 2, 2012 03:53 — forked from eligrey/object-watch.js
object.watch polyfill
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
@mdarby
mdarby / heroku_db_migrate.rb
Created August 4, 2012 15:31 — forked from urfolomeus/heroku_db_migrate.rb
Quick script to migrate heroku apps to the new free individual postgres DBs
## README
# This is a quick script I hacked out to migrate all my heroku apps
# to the new free individual postgres DBs. To use it:
# - install the heroku gem if you don't already have it
# - set the value of IGNORE_OTHERS_APPS to true if you only want to
# run the script against apps you've created yourself
# - add any apps you want to ignore because they don't use PostgreSQL
# (or for any other reason) to the IGNORE_LIST
## CAVEAT!!
Sidekiq.rb
Sidekiq.configure_server do |config|
config.redis = { :size => 5 }
end
Procfile
web: bundle exec unicorn -p $PORT
2 tsp Freshly ground pepper
1 1⁄2 tsp Cayenne pepper
1 1⁄2 tsp Paprika
1 tsp Dry Mustard
1 tsp Garlic Powder
1 tsp Salt
1 Chicken (3 lbs cut up)
1 cup Vegetable oil
1⁄2 Cup Flour
3⁄4 cup chopped onion
class Person
attr_accessor :first_name, :last_name
def full_name
"#{first_name} #{last_name}"
end
end
matt = Person.new
matt.first_name = "Matt"
/Users/mdarby/.rvm/gems/ruby-1.9.3-p125-perf/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:503:in `load_missing_constant': Expected /Users/mdarby/Documents/Code/ccw_32/app/controllers/reports/accountant/approved_time_off_requests_controller.rb to define Reports::Accountant::ApprovedTimeOffRequestsController (LoadError)
from /Users/mdarby/.rvm/gems/ruby-1.9.3-p125-perf/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:192:in `block in const_missing'
@mdarby
mdarby / hack.sh
Created March 31, 2012 23:32 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/mongodb/1.8.2-x86_64/org.mongodb.mongod.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/org.mongodb.mongod.plist
class CcwFormBuilder < ActionView::Helpers::FormBuilder
helpers = field_helpers +
%w(date_select datetime_select time_select) +
%w(collection_select select country_select time_zone_select) -
%w(hidden_field label fields_for)
helpers.each do |name|
define_method(name) do |field, *args|
options = args.extract_options!
" Use arrow keys to move buffers
map <up> <C-w>k<cr>
map <down> <C-w>j<cr>
map <left> <C-w>h<cr>
map <right> <C-w>l<cr>