Skip to content

Instantly share code, notes, and snippets.

# kudos to https://github.com/drewlesueur
# stolen from here: https://github.com/blog/266-fast-forward-your-fork#comment-11535
git checkout -b upstream/master
git remote add upstream git://github.com/documentcloud/underscore.git
git pull upstream master
git checkout master // [my master branch]
git merge upstream/master
git push origin master
@josemic
josemic / ahocorasik.erl
Last active December 28, 2015 08:49 — forked from ufm/ahocorasik.erl
%%% File : ahocorasik.erl
%%% Author : Fyodor Ustinov <ufm@ufm.su>
%%% Descrip.: Multiple search based on Aho-Corasick string matching algorithm
%%%
%%% License : GPL
%%%
%%% Usage:
%%% ahocorasik:match(["pat1", "pat2"], "pat1 pat2 pat1")
%%% or
%%% Tree = ahocorasik:tree(["pat1", "pat2"])
@josemic
josemic / halfsync_halfasync.rb
Created May 26, 2013 15:44
Implementation of the halfsync_halfasync pattern in ruby. This gist is part of a ruby bug-report.
require "singleton"
require "socket"
ACCEPT_EVENT = 0x01
RECEIVE_EVENT = 0x02
WRITE_EVENT = 0x04
# Y_EVENT = 0x08
# Z_EVENT = 0x10
# Etc.