http://trevmex.com/post/5639010531/building-rails-apps-for-the-rich-client
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 'memprof/tracer' | |
class CustomTracer | |
def initialize(app, opts = {}) | |
@app = app | |
@options = opts | |
@options[:except] = %r{^/(?:memprof|admin)\b} | |
end | |
def call(env) |
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
" Toggle ruby blocks | |
" requires the matchit plugin | |
function! s:ToggleRubyBlocks() | |
let c = getline(".")[col(".")-1] | |
if c =~ '[{}]' | |
" don't use matchit for {,} | |
exe 'normal! %s'.(c=='}' ? 'do' : 'end')."\<esc>``s".(c=='}' ? 'end' : 'do')."\<esc>" | |
else | |
let w = expand('<cword>') | |
if w == 'do' |
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
vows.describe("Presentation") | |
.addBatch | |
"László Bácsi from Secret Sauce Partners, Inc.": | |
topic: "vows + should.js + sinon.js" | |
"should vow to do BDD": (tools) -> | |
tools.should.include "vows" | |
tools.should.include "should" | |
tools.should.include "sinon" | |
.export(budapest.js) |
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' | |
# This makes pry itself and all pry gems available | |
$LOAD_PATH.push(*Dir["#{ENV['HOME']}/.prygems/gems/*/lib"]).uniq! | |
begin | |
# Use Pry everywhere | |
require 'pry' | |
rescue LoadError => e | |
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
{Model} = module.exports = mongoose = require 'mongoose' | |
# Make populated references available as separate properties | |
# e.g. | |
# if `ProductSchema` has `brand_id: { type: String, ref: 'Brand' }`, | |
# `Product.findById(some_id).populate('brand').run(cb)` will populate | |
# using `brand_id` but the populated brand object will be available as | |
# `product.brand`. | |
originalInit = Model::init | |
Model::init = (doc, query, fn) -> |
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
# basics | |
set -g default-terminal "screen-256color" | |
set -g prefix C-a | |
set -sg escape-time 0 | |
# let's free the original prefix | |
unbind C-b | |
# make sure we can send prefix to other apps | |
bind C-a send-prefix |
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
derby = require 'derby' | |
everyauth = require 'everyauth' | |
config = require './config' | |
users = require('mongoskin').db(config('mongo_url')).collection('users') | |
# let's make sure there is a userId set, this way there will always be a user | |
exports.ensureUser = -> | |
(req, res, next) -> | |
req.session.auth ||= {} |
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
global | |
maxconn 4096 # Total Max Connections. This is dependent on ulimit | |
nbproc 2 | |
log 127.0.0.1 local1 notice | |
defaults | |
mode http | |
log global | |
frontend all 0.0.0.0:80 |
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
# Generated by Chef | |
description "Bibliaolvaso" | |
author "Laszlo Bacsi" | |
start on startup | |
stop on shutdown | |
respawn | |
respawn limit 15 5 |