Skip to content

Instantly share code, notes, and snippets.

<html><head></head>
<body>
<table>
<tr>
<th>Language</th>
<th>Type</th>
<th>Color</th>
</tr>
<tr>
class DeadbeatConnectionRelease
def initialize(app)
@app = app
end
#This is a brittle hack for what appears to be a bug in ActiveRecord 4:
#connections aren't being properly released after their owning threads die
def call(env)
response = @app.call(env)
response[2] = ::Rack::BodyProxy.new(response[2]) do
class DeadbeatConnectionRelease
def initialize(app)
@app = app
end
#This is a brittle hack for what appears to be a bug in ActiveRecord 4:
#connections aren't being properly released after their owning threads die
def call(env)
response = @app.call(env)
response[2] = ::Rack::BodyProxy.new(response[2]) do
class DeadbeatConnectionRelease
def initialize(app)
@app = app
end
#This is a brittle hack for what appears to be a bug in ActiveRecord 4:
#connections aren't being properly released after their owning threads die
def call(env)
response = @app.call(env)
response[2] = ::Rack::BodyProxy.new(response[2]) do
module Accounting
module Handling
def revenue_account(name)
Plutus::Revenue.find_or_create_by(:name => name)
end
def asset_account(name)
Plutus::Assets.find_or_create_by(:name => name)
end
module Accounting
module Handling
def revenue_account(name)
Plutus::Revenue.find_or_create_by(:name => name)
end
def asset_account(name)
Plutus::Assets.find_or_create_by(:name => name)
end
@nyarly
nyarly / vimrc
Created February 28, 2014 18:22
"set runtimepath=$HOME/.vim,$VIM/ultisnips,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,$VIM/ultisnips/after,$HOME/.vim/after
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'nyarly/gundo'
#!/bin/bash
branches=$(git branch --merged | egrep -v '(^[*])|(master)|(staging)|(production)')
echo $branches
for branch in $branches; do
echo Cleaning: $branch
#If we can delete the branch remotely, delete it locally
git push origin :$branch && git branch -d $branch
if [ $branch == "merging" ]; then
module RoadForest
module Utility
class ClassRegistry
#Extend a module with this in order to make it the registrar for a
#particular purpose.
#The top of a class heirarchy will make "register" immediately available
#to subclasses. Otherwise, classes can say Module::registry.add(name,
#self)
#
module Registrar
Bundler 1.6.2
Ruby 2.0.0 (2013-11-22 patchlevel 353) [i686-linux]
Rubygems 2.0.14
GEM_HOME /home/judson/.gem/ruby/2.0.0
GEM_PATH /home/judson/.gem/ruby/2.0.0:/home/judson/.gem/ruby/2.0.0
Bundler settings
path
Set for your local app (/home/judson/ruby/LRD/MindSwarms/mindswarms/.bundle/config): "/home/judson/ruby/bundle-paths/rails3/lib"
bin