// require
sightglass = require('sightglass')
// global usage
sightglass.root = '.'
sightglass(obj, 'user.address:city', function() {})
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
rivets.configure({ | |
adapter: { | |
subscribe: function(obj, keypath, callback) { | |
obj.on("change:" + keypath, callback); | |
}, | |
unsubscribe: function(obj, keypath, callback) { | |
obj.off("change:" + keypath, callback); | |
}, |
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
" GENERAL | |
:set ruler | |
:set number | |
:set noswapfile | |
syntax on | |
colorscheme mr | |
" INDENTATION |
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
class Riak | |
include HTTParty | |
format :json | |
def self.config(host, port, prefix='riak') | |
base_uri "#{host}:#{port}/#{prefix}" | |
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
# MongoMapper::Document::InstanceMethods | |
def to_model | |
errors.instance_eval do | |
def [](attribute) | |
return [] if errors[attribute.to_sym].nil? | |
errors[attribute.to_sym] | |
end | |
end | |
self |
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
" VUNDLE | |
set nocompatible | |
filetype off | |
set rtp+=~/.vim/bundle/vundle.vim | |
call vundle#begin() | |
Plugin 'gmarik/vundle.vim' | |
Plugin 'kien/ctrlp.vim' | |
Plugin 'scrooloose/nerdtree' |
NewerOlder