Skip to content

Instantly share code, notes, and snippets.

View mikeric's full-sized avatar

Michael Richards mikeric

View GitHub Profile
@mikeric
mikeric / stapes-adapter.js
Created July 31, 2012 20:51
Stapes.js adapter for Rivets.js
rivets.configure({
adapter: {
subscribe: function(obj, keypath, callback) {
obj.on("change:" + keypath, callback);
},
unsubscribe: function(obj, keypath, callback) {
obj.off("change:" + keypath, callback);
},
@mikeric
mikeric / .vimrc
Created July 28, 2012 23:26
VIM configuration
" GENERAL
:set ruler
:set number
:set noswapfile
syntax on
colorscheme mr
" INDENTATION
@mikeric
mikeric / riak.rb
Created March 25, 2010 17:50
A simple Riak REST client
class Riak
include HTTParty
format :json
def self.config(host, port, prefix='riak')
base_uri "#{host}:#{port}/#{prefix}"
end
end
@mikeric
mikeric / temporary-patch-fix.rb
Created February 2, 2010 04:29
MongoMapper on Edge Rails (3.0.pre)
# 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
@mikeric
mikeric / .vimrc
Created September 17, 2014 23:21
Vim configuration
" 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'
@mikeric
mikeric / gist:654d3512e9010689fc03
Last active August 29, 2015 14:05
Module interface styles

A

// require
sightglass = require('sightglass')

// global usage
sightglass.root = '.'
sightglass(obj, 'user.address:city', function() {})