Skip to content

Instantly share code, notes, and snippets.

View atmos's full-sized avatar
🌴
On vacation

Corey Donohoe atmos

🌴
On vacation
View GitHub Profile
// original gist from http://gist.github.com/392869
// got a request from a friend to help make this code work
// the previous bug was closing the db handle incorrectly in the callbacks
// run it like this
// // node foo.js
// // curl -vv "http://localhost:3000/37signals%20-%20Mark%20Imbriaco.mov"
// // curl -vv "http://localhost:3000/37signals%20-%20Mark%20Imbriaco.mov"
var kiwi = require('kiwi'),
sys = require('sys')
@atmos
atmos / sinatra_app.rb
Created December 13, 2009 23:35 — forked from bhb/sinatra_app.rb
require 'rubygems'
require 'sinatra'
require 'rack/test'
module XModule
def some_method
"x"
end
end
@atmos
atmos / merb.rb
Created June 9, 2009 16:46 — forked from lenary/merb.rb
module Hancock
module Helpers
module Merb
begin
::Merb::Authentication.user_class = User
class ::Merb::Authentication
def fetch_user(session_user_id)
Merb::Authentication.user_class.get(session[:user_id])
@atmos
atmos / gist:30502
Created November 30, 2008 19:02 — forked from Oshuma/gist:30473
def create_article(options = {})
create_and_authenticate_user
Article.all.destroy!
request(resource(:articles), :method => "POST",
:params => { :article => { :title => 'Title',
:content => 'Blog post.' }})
end
def create_and_authenticate_user
User.all.destroy!