autocmd BufWritePre * :%s/\s\+$//e
(add-hook 'before-save-hook 'delete-trailing-whitespace)
| # this script fixed the ordering in carousel of may snapjoy files. | |
| # works on OSX | |
| require 'date' | |
| Dir.glob("./**/*.jpeg").each do |f| | |
| next if f =~ /nknown/ | |
| m = /(?<serial>\d{0,6})-(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})/.match(f) | |
| d = DateTime.new(m['year'].to_i, m['month'].to_i, m['day'].to_i) + Rational(m['serial'].to_i, 86400) |
| function MorseNode(ac, rate) { | |
| // ac is an audio context. | |
| this._oscillator = ac.createOscillator(); | |
| this._gain = ac.createGain(); | |
| this._gain.gain.value = 0; | |
| this._oscillator.frequency.value = 750; | |
| this._oscillator.connect(this._gain); |
| # Run: curl https://gist.github.com/raw/719970/locale_diff.rb | ruby - en fi | |
| require 'rubygems' | |
| require 'yaml' | |
| l1 = ARGV[0] | |
| l2 = ARGV[1] | |
| first = YAML.load_file(l1 + ".yml") | |
| second = YAML.load_file(l2 + ".yml") | |
| def diff(root, compared, structure = []) |
| class DomainSession < Rack::Session::Cookie | |
| def set_cookie(env, headers, cookie) | |
| cookie[:domain] ||= Rack::Request.new(env).host[/(\.[^\.]+){2}$/] | |
| super | |
| end | |
| end | |
| use DomainSession |
| require 'dm-core' | |
| require 'dm-migrations' | |
| class Foo | |
| include DataMapper::Resource | |
| property :id, Serial | |
| has n, :bars | |
| end | |
| class Bar |
| /projects/5304ecaf565147c7e488$ unicorn | |
| I, [2010-03-28T16:40:14.986279 #27939] INFO -- : listening on addr=0.0.0.0:8080 fd=3 | |
| I, [2010-03-28T16:40:15.095040 #27939] INFO -- : worker=0 spawning... | |
| I, [2010-03-28T16:40:15.096947 #27939] INFO -- : master process ready | |
| I, [2010-03-28T16:40:15.098584 #27941] INFO -- : worker=0 spawned pid=27941 | |
| I, [2010-03-28T16:40:15.807127 #27941] INFO -- : worker=0 ready | |
| No view class found for layout in . | |
| NoMethodError - undefined method `empty?' for nil:NilClass: | |
| /usr/local/ruby1.9/lib/ruby/gems/1.9.1/gems/mustache-0.9.1/lib/mustache/sinatra.rb:67:in `mustache' | |
| /home/mmmurf/projects/5304ecaf565147c7e488/app.rb:13:in `block in <class:App>' |
| config.after_initialize do | |
| #CACHE | |
| MEMCACHE_SERVER = case RAILS_ENV | |
| when 'development' then 'localhost:11211' | |
| when 'staging' then '127.0.0.1:11211' | |
| when 'production' then '192.168.2.26:11211' | |
| when 'test' then nil | |
| else raise | |
| end |
| (in /home/mmmurf/projects/penguin_shipping_lab) | |
| /usr/bin/ruby1.8 -Ilib:lib "/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader.rb" "test/gateways/penguin_discounted/pdf_test.rb" "test/gateways/penguin_discounted/images_test.rb" "test/gateways/endicia/pdf_test.rb" "test/gateways/endicia/images_test.rb" "test/gateways/ups/pdf_test.rb" "test/gateways/ups/images_test.rb" "test/gateways/usps/images_test.rb" | |
| /usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:445:in `load_missing_constant': uninitialized constant Dependencies (NameError) | |
| from /usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:77:in `const_missing' | |
| from /usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:89:in `const_missing' | |
| from ./lib/penguin_shipping_lab.rb:23 | |
| from ./init.rb:5:in `require' | |
| from ./init.rb:5 | |
| from ./test/gateways/penguin_discounted/../../test_helper.rb:1:in `require' | |
| from ./test/gateways/penguin_discounted/../ |