Skip to content

Instantly share code, notes, and snippets.

View sjl's full-sized avatar

Steve Losh sjl

View GitHub Profile
@sjl
sjl / gist:1020132
Created June 11, 2011 01:07
threesome.vim documention

Threesome is a Vim plugin for resolving conflicts during three-way merges. It's designed to be used as a merge tool for version control systems like Mercurial and Git.

  • Basic Usage
  • Key Bindings
  • Modes
  • Configuration
  • Contributing
  • Changelog
(defn palindrome? [coll]
(= coll
(reverse coll)))
(defn n-digit-ints [n]
(range (expt 10 (- n 1))
(expt 10 n)))
(defn p4 [n]
@sjl
sjl / markdown.vim
Created June 21, 2011 19:47 — forked from vim-voom/markdown.vim
Markdown folding for Vim
" folding for Markdown headers, both styles (atx- and setex-)
" http://daringfireball.net/projects/markdown/syntax#header
"
" this code can be placed in file
" $HOME/.vim/after/ftplugin/markdown.vim
func! Foldexpr_markdown(lnum)
let l1 = getline(a:lnum)
if l1 =~ '^\s*$'
(defn- read-packet-playerpositionlook [bot conn]
(let [payload (assoc {}
:x (-read-double conn)
:stance (-read-double conn)
:y (-read-double conn)
:z (-read-double conn)
:yaw (-read-float conn)
:pitch (-read-float conn)
:onground (-read-bool conn))]
(dosync (alter (:player bot) merge {:location payload}))
Allow me to add a link to a "sub data file" into any other data file, along with its password.
That way I can access all the passwords inside with only my own password.
Steve's password +-------> Dumbwaiter's Password
| | |
V | V
Stevelosh.data +-------> Dumbwaiter Design.data
| | |
+- Stored passwords | +- Stored Passwords
| |
[merge-tools]
keepthat.executable = sh
keepthat.args = -c 'cp $local $output.original && cp $other $output'
keepthat.premerge = True
[alias]
merge-preferring-theirs = merge --tool keepthat
@sjl
sjl / jquerytest.cljs
Created July 21, 2011 14:05 — forked from ryancrum/jquerytest.cljs
How to use jQuery from ClojureScript
(ns jquerytest.core)
(def jquery (js* "$"))
; Can you not use the short form?
(jquery
(fn []
(-> (jquery "div.meat")
(.html "This is a test.")
(.append "<div>Look here!</div>"))))
@sjl
sjl / gist:1118817
Created August 1, 2011 19:26
OS X Text Editor Waves

Pre- OS X

  • BBEdit
  • Vim
  • Emacs

2003/2004

  • TextMate
  • SubEthaEdit
class Vi < Plugin
@mode = 'normal'
class << self; attr_accessor :mode; end
def self.normal?
lambda { return Vi.mode == 'normal'}
end
def self.insert?
lambda { return Vi.mode == 'insert'}
@sjl
sjl / vim.rb
Created August 3, 2011 15:05
Very rough Keymando plugin for Vim bindings everywhere.
class Vim < Plugin
@oldmode = 'n'
@mode = 'n'
@maps = {}
class << self; attr_accessor :mode, :maps, :oldmode; end
def before
end