Skip to content

Instantly share code, notes, and snippets.

View mnemnion's full-sized avatar

Sam Atman mnemnion

  • Eastern Standard Tribe
View GitHub Profile
@mnemnion
mnemnion / hexdump.rx
Created April 16, 2014 17:45
A simple hex dump for Retro (11)
( Simple Hex Dump )
needs bad'
needs console'
8 constant (dump-width)
: putxt xt->d d->name puts ;
: hexabyte ( "hexes a byte" )
dup 10 <
( brute force ngaro assembler )
chain: ming'
: nop, 0 , ; immediate
: drop, 3 , ; immediate
: pop, 6 , ; immediate
: ;, 9 , ; immediate
: !jump, 12 , ; immediate
@mnemnion
mnemnion / seq-string.clj
Created October 16, 2013 17:28
seq-string turns a string into a seq on the characters.
(defn seq-string
"make a string seqable by character"
[split-me]
(seq (drop 1 (clojure.string/split split-me #""))))
@mnemnion
mnemnion / init-stuff.el
Created September 27, 2013 21:00
some useful init.el
;;The User Button
(setq ns-function-modifier 'hyper) ; Jedi Superpowers activate
(setq max-specpdl-size 100000
max-lisp-eval-depth 100000) ;give your lisp a brain
(add-to-list 'load-path "~/.emacs.d/el-get/el-get")
pat pan par pag
pit pin pir pig
pot pon por pog
put pun pur pug
mat man mar mag mit min mir mig
@mnemnion
mnemnion / jumpy.sh
Created August 18, 2013 00:18
A fancy little jumper script for bash. Easy keystroke access to frequent directories. jump/jp: go to a directory mark: make an alias unmark: delete an alias
# Fancy jump script
export MARKPATH=$HOME/.marks
function jump {
cd -P $MARKPATH/$1 2> /dev/null || echo "No such mark: $1"
}
function jp {
cd -P $MARKPATH/$1 2> /dev/null || echo "No such mark: $1"
}
function mark {
@mnemnion
mnemnion / e-tree-seq.clj
Last active November 3, 2020 18:32
a tree-seq function for enlive style trees or graphs in clojure. Made for instaparse, may not fit all cases.
(defn e-tree-seq
"tree-seqs enlive trees/graphs, at least instaparse ones"
[e-tree]
(if (map? (first e-tree))
(tree-seq (comp seq :content) :content (first e-tree))
(tree-seq (comp seq :content) :content e-tree)))
(defn caseify [string]
(💬 (apply str (🌍 (fn [foo] (str "(" "'" (upper-case foo) "'" "|" "'" foo "'" ")"))
(rest (split string #""))))))
@mnemnion
mnemnion / caseify
Last active December 16, 2015 06:39
A bit of Clojure to make case-insensitive token match rules in ANTLR
(defn caseify [string]
(apply str (map (fn [foo] (apply str ["(" "'" (upper-case foo) "'" "|" "'" foo "'" ")"]))
(rest (split string #"")))))
S = AB*
AB = A B
A = 'a'+
B = 'b'+