Skip to content

Instantly share code, notes, and snippets.

$ go install code.google.com/p/go.tools/cmd/vet
go install code.google.com/p/go.tools/cmd/vet: open /usr/local/go/pkg/tool/linux_amd64/vet: permission denied
$ sudo su - root
# GOPATH=/tmp/go /usr/local/go/bin/go get code.google.com/p/go.tools/cmd/cover
# GOPATH=/tmp/go /usr/local/go/bin/go get code.google.com/p/go.tools/cmd/vet
# rm -r /tmp/go
# exit
@levicook
levicook / repos::campus_repo.go
Created August 10, 2014 21:54
Excerpt of a testing strategy for Go http handlers.
package repos
import (
"fabric-server/models"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
)
type CampusRepo interface {
execute pathogen#infect()
syntax on
filetype plugin indent on
set nowrap
set background=dark
colorscheme solarized
## Output
Node: Keys
6379: ["120"]
6380: ["119", "110", "111", "114", "105", "115", "106", "107", "118"]
6381: ["102", "112", "103", "113", "104", "100", "101"]
6382: ["116", "117", "108", "109"]
First key from each node
["119", "102", "116", "120"]
#!/usr/bin/env ruby
require "pathname"
LOADER = '''
require "pathname"
vendor_path = Pathname.new(__FILE__).parent.parent + "vendor"
Pathname.glob("#{vendor_path}/**/**/lib") do |lib|
next if $LOAD_PATH.include?(lib.realpath.to_s)
levi@sosuke:~
$ rvm install 1.9.2
/Users/levi/.rvm/rubies/ruby-1.9.2-p136, this may take a while depending on your cpu(s)...
ruby-1.9.2-p136 - #fetching
ruby-1.9.2-p136 - #downloading ruby-1.9.2-p136, this may take a while depending on your connection...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 8612k 100 8612k 0 0 59705 0 0:02:27 0:02:27 --:--:-- 30199
ruby-1.9.2-p136 - #extracting ruby-1.9.2-p136 to /Users/levi/.rvm/src/ruby-1.9.2-p136
@levicook
levicook / gist:995169
Created May 27, 2011 12:50
brew upgrade bs
brew upgrade
==> Downloading https://github.com/defunkt/gist/tarball/v2.0.3
File already downloaded and cached to /Users/levi/Library/Caches/Homebrew
==> rake install prefix=/usr/local/Cellar/gist/2.0.3
/usr/local/Cellar/gist/2.0.3: 3 files, 28K, built in 2 seconds
==> Downloading http://kernel.org/pub/software/scm/git/git-1.7.5.2.tar.bz2
######################################################################## 100.0%
==> make prefix=/usr/local/Cellar/git/1.7.5.2 install
==> Downloading http://kernel.org/pub/software/scm/git/git-manpages-1.7.5.2.tar.bz2
######################################################################## 100.0%
@levicook
levicook / gist:1091293
Created July 19, 2011 04:10
Cloudera Hadoop Apt Packages...
deploy@poker:~$ apt-cache search hadoop
libzookeeper-dev - Information management inside a cluster. Part of the hadoop family.
libzookeeper-java - Information management inside a cluster. Part of the hadoop family.
libzookeeper2 - Information management inside a cluster. Part of the hadoop family.
python-zookeeper - Information management inside a cluster. Part of the hadoop family.
zookeeper - Information management inside a cluster. Part of the hadoop family.
zookeeper-bin - Information management inside a cluster. Part of the hadoop family.
zookeeperd - Information management inside a cluster. Part of the hadoop family.
flume - reliable, scalable, and manageable distributed data collection application
hadoop-0.20 - A software platform for processing vast amounts of data
[alias]
ci = commit
co = checkout
df = diff -w
br = branch
me = merge
st = status
[color]
ui = auto
[user]
Reseller.demo.as_current do # So that factories are happy.
reseller = Reseller.current
# == Posture People
aaron = reseller.users.find_by_email('aaron@posturepeople.com') || reseller.users.new
aaron.display_name = 'Aaron Smith'
aaron.email = 'aaron@posturepeople.com'
aaron.password = aaron.password_confirmation = 'joinhere'
aaron.save! if aaron.changed?