Skip to content

Instantly share code, notes, and snippets.

Adam Wiggins adamwiggins

Block or report user

Report or block adamwiggins

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:36
diff --git a/bin/bundle b/bin/bundle
index 6efdf51..7b57fac 100755
--- a/bin/bundle
+++ b/bin/bundle
@@ -9,8 +9,23 @@ $:.each do |path|
end
require 'bundler/cli'
+
begin
View gist:4990
NoMethodError: undefined method `to_result' for #<IO:0xb74805dc>
/usr/local/collar/app/../sinatra/lib/sinatra.rb:1493:in `to_result'
/usr/local/collar/app/../sinatra/lib/sinatra.rb:1480:in `to_result'
/usr/local/collar/app/../sinatra/lib/sinatra.rb:1224:in `dispatch'
/usr/local/collar/sinatra/vendor/rack/lib/rack/commonlogger.rb:20:in `call'
/usr/local/collar/sinatra/vendor/rack/lib/rack/commonlogger.rb:20:in `_call'
/usr/local/collar/sinatra/vendor/rack/lib/rack/commonlogger.rb:13:in `call'
/usr/local/collar/app/collar.rb:35:in `call'
/usr/local/collar/app/../sinatra/lib/sinatra.rb:1197:in `call'
/usr/local/collar/sinatra/vendor/rack/lib/rack/handler/mongrel.rb:59:in `process'
View gist:4993
get '/' do
headers('Content-Disposition' => "attachment; filename=heroku_#{$app.name}.tar.gz")
headers('Content-Type' => 'application/x-gtar')
$app.importexport.export
end
View console
# run this in the console
Notifier.deliver_hello('your_email@example.com')
View thin.rb
# Framework name => file unique to this framework.
# +nil+ for value to never guess.
ADAPTERS = {
:rails => "config/environment.rb",
:ramaze => "start.rb",
:merb => "config/init.rb",
:halcyon => 'runner.ru',
:mack => 'config/app_config/default.yml',
:file => nil
}
View gist:6250
=CRASH REPORT==== 19-Aug-2008::16:27:57 ===
crasher:
pid: <0.92.0>
registered_name: []
exception error: no match of right hand side value {error,econnrefused}
in function charon_proxy:loop/1
initial call: mochiweb_socket_server:acceptor_loop({<0.54.0>,#Port<0.111>,
{charon_proxy,loop}})
ancestors: [charon_proxy,<0.53.0>]
messages: []
View thin.rb
# Framework name => file unique to this framework.
# +nil+ for value to never guess.
ADAPTERS = {
:rails => "config/environment.rb",
:ramaze => "start.rb",
:merb => "config/init.rb",
:halcyon => 'runner.ru',
:mack => 'config/app_config/default.yml',
:file => nil
}
View create_semaphores.rb
class CreateSemaphores < ActiveRecord::Migration
def self.up
create_table :semaphores do |t|
t.column :name, :text
t.column :value, :integer
end
add_index :semaphores, :name, :unique => true
end
end
View gist:9195
fenris:~$ git clone git://github.com:adamwiggins/bitswiki.git
Initialized empty Git repository in /Users/adam/bitswiki/.git/
remote: Counting objects: 132, done.
Compressing objectsIndexing 132 objects...
100% (132/132) done 91% 99% (131/132) done132) done
Resolving 20 deltas...
100% (20/20) done
Compressing objects: 100% (96/96), done.)
Total 132 (delta 20), reused 132 (deremote: lta 20)
fenris:~$ cd bitswiki/
View fair_balance_test.rb
require 'rubygems'
require 'sinatra'
get '/slow' do
sleep 10
"slow done"
end
get '/fast' do
"fast done"
You can’t perform that action at this time.