Skip to content

Instantly share code, notes, and snippets.

View dsci's full-sized avatar

Daniel Schmidt dsci

  • Leipzig, Germany
View GitHub Profile
@dsci
dsci / gist:1433824
Created December 5, 2011 14:49 — forked from jnunemaker/gist:217362
example of warden with sinatra
Warden::Manager.serialize_into_session{|user| user.id }
Warden::Manager.serialize_from_session{|id| User.get(id) }
Warden::Manager.before_failure do |env,opts|
# Sinatra is very sensitive to the request method
# since authentication could fail on any type of method, we need
# to set it for the failure app so it is routed to the correct block
env['REQUEST_METHOD'] = "POST"
end
@dsci
dsci / rspec-syntax-cheat-sheet.rb
Created November 29, 2011 16:09 — forked from dnagir/rspec-syntax-cheat-sheet.rb
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
@dsci
dsci / plugin_loader.rb
Created August 30, 2011 13:42 — forked from robhurring/plugin_loader.rb
Simple way to load Rails plugins in Sinatra
# Simple bootloader for Rails plugins in Sinatra
# This checkes the +plugin_folder+ for plugin-like bundles. For each folder it finds it will do:
# If the +lib+ folder exists: add it to our load path
# If a +init.rb+ file exists: require it
# Not very robust but it is lightweight for loading simple rails plugins
class PluginLoader
attr_reader :plugin_folder
def initialize(plugin_folder)
@plugin_folder = plugin_folder

(a gist based on the old toolmantim article on setting up remote repos)

To collaborate in a distributed development process you’ll need to push code to remotely accessible repositories.

This is somewhat of a follow-up to the previous article setting up a new rails app with git.

For the impatient

Set up the new bare repo on the server: