This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'sinatra' | |
require 'rack/test' | |
module XModule | |
def some_method | |
"x" | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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! |
NewerOlder