Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
#_(
#_DEPS is same format as deps.edn. Multiline is okay.
DEPS='{:deps {nrepl {:mvn/version "0.7.0"}}}'
exec clojure -Sdeps "$DEPS" "$0" "$@"
)
(ns shadow-test
(:require [clojure.java.io :refer [file]]
@dhleong
dhleong / unicode_pairs.vim
Created January 7, 2016 13:50
Vim: Parse the unicode pair under the cursor and output the surrogate pairs (formatted for Java)
function! GetUnicodePairs()
" copy the output of the ascii command
redir => raw
ascii
redir END
" strip out the hex part and parse to int
let match = matchlist(raw, 'Hex \(.*\),')
let hex = match[1]
let s = str2nr(hex, 16)

Keybase proof

I hereby claim:

  • I am dhleong on github.
  • I am dhleong (https://keybase.io/dhleong) on keybase.
  • I have a public key whose fingerprint is 1B0D 3E7C C455 210E 2D4E CBED AB55 7BEA BC94 0DE8

To claim this, I am signing this object:

@dhleong
dhleong / args-extract.py
Created November 8, 2013 05:45
Super quick script to analyze raw hex packets from Artemis SBS server and dump out the names of the "arguments"/"actions" associated with that packet
#!/usr/bin/python
API_BASE = '/PATH/TO/ArtemisClientLib/'
SRC_PATH = 'src/net/dhleong/acl/net/'
def loadActionsAndArgs(fileName, argType):
fname = API_BASE + SRC_PATH + fileName
ACTIONS = []
ARGS = []