Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@levicook
levicook / gist:1236822
Created September 23, 2011 05:42
learning fog storage on Rackspace
>> Storage[:rackspace].directories.new
<Fog::Storage::Rackspace::Directory
key=nil,
bytes=nil,
count=nil,
cdn_cname=nil
>
>> d = _
<Fog::Storage::Rackspace::Directory
key=nil,
@levicook
levicook / gist:1325199
Created October 29, 2011 22:52
Could not find module `Snap.Loader.Devel'
levi@platypus:~/hello-snap (master)
$ cabal install -fdevelopment -v
Reading available packages...
Resolving dependencies...
In order, the following would be installed:
hello-snap-0.1 (new package)
Configuring hello-snap-0.1...
Flags chosen: development=True
Dependency MonadCatchIO-transformers ==0.2.2.3: using
MonadCatchIO-transformers-0.2.2.3
@levicook
levicook / setup.commands.bash
Created April 10, 2012 16:03
torquebox install ~ fedora 15
##- totally new box
# useradd -b /opt torquebox
# vim /etc/profile.d/torquebox.sh
export TORQUEBOX_HOME=/opt/torquebox/current
export JBOSS_HOME=$TORQUEBOX_HOME/jbossexport JRUBY_HOME=$TORQUEBOX_HOME/jruby
export JRUBY_OPTS=--1.9
PATH=$JBOSS_HOME/bin:$JRUBY_HOME/bin:$PATH
@levicook
levicook / gist:3701036
Created September 11, 2012 19:08
tmux.conf
# Reload the file with Prefix r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
bind | split-window -h # C-a | to create horizontal pane
bind - split-window -v # C-a - to create vertical pane
# moving between panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
@levicook
levicook / gist:3718363
Created September 13, 2012 22:55
brew fail
==> Build Environment
HOMEBREW_VERSION: 0.9.3
HEAD: e5916e8923f1a0bd2ba8750c813d85b674bd9dfc
CPU: 8-core 64-bit nehalem
OS X: 10.6.8-x86_64
Xcode: 3.2.4
Error: Homebrew doesn't know what compiler versions ship with your version of
Xcode. Please file an issue with the output of `brew --config`:
https://github.com/mxcl/homebrew/issues
@levicook
levicook / schedule.js
Created October 17, 2012 17:37
Denver Startup Week -- Schedule Extractor
// open http://denverstartupweek.org/schedule/
// go to your javascript console, and run this:
$('.event-day').each(function() {
var dy = $(this).clone();
dy.find('a').remove();
dy.find('.event-listing > h3').each(function() {
var h3 = $(this).clone();
var tm = h3.find('time').remove()
@levicook
levicook / gist:4132037
Created November 22, 2012 16:37
modeling friends and calculating mutual friends w/ mongodb
// ------------------------------------------------------------------
// Friend collection, where _id is a user.Id and Friends is a list, of user.Id.
// Note: friending and unfriending is a two step operation in this scheme:
> db.friends.find()
{ "_id" : 1, "friends" : [ 2, 3, 4 ] }
{ "_id" : 2, "friends" : [ 1, 3, 5 ] }
{ "_id" : 3, "friends" : [ 1, 2, 4, 5 ] }
{ "_id" : 4, "friends" : [ 1, 3, 5 ] }
{ "_id" : 5, "friends" : [ 2, 3, 4 ] }
levi@tums:~/go/src/supportlocal/caramon (master)
$ time ./caramon sphinx-places > places.xml
2012/11/30 19:13:12 Loading config from: "config/development.yaml"
real 38m56.816s
user 32m41.470s
sys 5m23.280s
levi@tums:~/go/src/supportlocal/caramon (master *+)
@levicook
levicook / gist:5630135
Created May 22, 2013 19:17
My vim universe
$ cat ~/.vimrc
execute pathogen#infect()
syntax on
filetype plugin indent on
map <leader>f :Ack<space>
map pt :tabp<CR>
" Quick fix navigation (next error, prev error, etc)
map ne :cnext<CR>
@levicook
levicook / .tmux.conf
Last active September 13, 2022 13:10
Minimal sane tmux conf for OSX.
# play nice with OSX copy/paste tools
set -g default-command "reattach-to-user-namespace /bin/bash --login"
bind y run-shell "tmux save-buffer - | reattach-to-user-namespace pbcopy"
# Reload the file with Prefix r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
bind | split-window -h # C-a | to create horizontal pane
bind - split-window -v # C-a - to create vertical pane