Skip to content

Instantly share code, notes, and snippets.

View rainkinz's full-sized avatar
🏠
Working from home

Brendan Grainger rainkinz

🏠
Working from home
View GitHub Profile

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@rainkinz
rainkinz / gist:5645139
Last active December 17, 2015 17:19
Probably a really bad example of counting terms and enumerating their positions in documents.
import org.apache.lucene.analysis.core.WhitespaceAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.TextField;
import org.apache.lucene.index.*;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.RAMDirectory;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.Version;
@rainkinz
rainkinz / gist:2925769
Created June 13, 2012 18:53
Ruby Pipes
#/usr/bin/env ruby
# encoding: utf-8
APP_ROOT=File.expand_path('../../', __FILE__)
class Chain
def initialize(*procs)
@chain = procs
end
@rainkinz
rainkinz / gist:1193197
Created September 4, 2011 17:40
Mongoid failing many to many spec
require 'spec_helper'
describe Mongoid::Relations::Referenced::ManyToMany do
before(:all) do
Mongoid.raise_not_found_error = true
end
before do
[