Skip to content

Instantly share code, notes, and snippets.

View colmarius's full-sized avatar
💭
🎶 🎹

Marius Colacioiu colmarius

💭
🎶 🎹
View GitHub Profile

(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:

var performance = (function () {
var my = {};
// Wrap a function body in this to return a copy that instruments itself
// If you want this to be useful, you should give your profiled function a name,
// otherwise it will be identified as "", which is less than useful.
my.profile = function (func) {
return function () {
var start = new Date().getTime(),
time,
module Decorating
def decorate(meth_id, *modules)
alias_method("__#{meth_id}__", meth_id)
define_method(meth_id) do |*args|
result = send("__#{meth_id}__", *args)
modules.each { |m| result.extend(m) }
return result
end
end
require "thread"
module Synchronization
class Proxy
instance_methods.each { |m| undef_method m unless m =~ /^__|extend/ }
def initialize(target)
@__target__ = target
end
require "thread"
module Synchronizable
def self.included(base)
base.send(:include, InstanceMethods)
base.send(:extend, ClassMethods)
end
module ClassMethods
def synchronized(meth)