Skip to content

Instantly share code, notes, and snippets.

View 2sin18's full-sized avatar

Yuan, Man 2sin18

  • Alibaba Group
  • Beijing
View GitHub Profile
def tokenize(text)
text.scan /\(|\)|\w+|\d+|\S+|\+/
end
def parse_step(e)
sexp = []
stack = [sexp]
while ")" != (tk = e.next)
tk = parse_step(e) if tk == '('
sexp.push tk
@Boldewyn
Boldewyn / git-get
Last active December 22, 2016 10:37
The `git get` command to replace `git pull` with a sophisticated rebase strategy
#!/bin/bash
#
# git get
#
# Place this script in your path, so that git(1) can find it. Presto!
# You can now type `git get` instead of `git pull` and enjoy the
# advantages of rebasing atop instead of merging remote changes.
#
# If you have local changes, use `git get --stash` to stash and
# pop afterwards your changes automatically.