This file contains 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
root :to => 'application#index' | |
resources :attractions, :shopping, :accomodations, :restaurants, :events do | |
collection do | |
get 'type' => "#{parent_resource.collection_scope}#index" | |
end | |
member do | |
get 'type' => "#{parent_resource.member_scope}#show" | |
end | |
end |
This file contains 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
gem 'mongo' | |
gem 'em-mongo' | |
gem 'bson_ext' | |
gem 'goliath' | |
gem 'grape' |
This file contains 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
body = MultipartBody.new(:field1 => 'test', :field2 => 'test2') | |
http = EventMachine::HttpRequest.new('http://example.com').post( | |
:head => {'content-type' => "multipart/form-data; boundary=#{body.boundary}"}, | |
:body => body.to_s | |
) | |
# Or with a file part included | |
part1 = Part.new('name', 'content', 'file.txt') |
This file contains 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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'goliath' | |
require 'warden' | |
require 'digest/sha1' | |
require 'pp' | |
Warden::Strategies.add(:password) do | |
def valid? |
This file contains 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
gem "actionpack", "~> 4.0.0" |
This file contains 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
package main | |
import ( | |
"fmt" | |
"github.com/codegangsta/negroni" | |
"github.com/julienschmidt/httprouter" | |
"net/http" | |
) | |
func main() { |
This file contains 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
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
"html/template" | |
"github.com/gorilla/sessions" |
This file contains 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
sudo aptitude install libx11-dev libesd0-dev libgtk2.0-dev libgtk1.2-dev |