Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am johnmn3 on github.
* I am doxos (https://keybase.io/doxos) on keybase.
* I have a public key ASBr630q7JTso41c2LRl_rmzt1TnVDTiOVPK-jjQaoJv-wo
To claim this, I am signing this object:
@johnmn3
johnmn3 / resume.md
Last active August 16, 2019 13:18
My Resume

John M. Newman III

John Newman Head Shot

Summary

2004 US Army Signals; 2010 DHS Cybersecurity; 2015 Entrepreneur; 2017 EdTech

@johnmn3
johnmn3 / README.md
Last active March 14, 2018 16:06
cljws

In a terminal, try:

clojure -Sdeps '{:deps {github-johnmn3/cljws {:git/url "https://gist.github.com/johnmn3/a845f2bf67ad877d957bccd7f9cefe8c" :sha "4559f6d93509da4023c4df25965ddde004566b95"}}}' -m cljws chat-server localhost 8899

Then, in another terminal, try:

clojure -Sdeps '{:deps {github-johnmn3/cljws {:git/url "https://gist.github.com/johnmn3/a845f2bf67ad877d957bccd7f9cefe8c" :sha "4559f6d93509da4023c4df25965ddde004566b95"}}}' -m cljws client ws://localhost:8899

Repeat the last step in as many terminals as you like in order to add clients to the chat server.

@johnmn3
johnmn3 / end-padded-partition
Created April 1, 2011 04:50
Like partition, but adds padding at the end of the last sequence so that last sequence's size is equal to "si
(defn end-padded-partition [size acoll]
(loop [new-coll [], coll acoll)]
(if (empty? coll)
new-coll
(recur
(let [next-stuff (vec (take size coll))
padding-size (- size (count next-stuff))
padding (rand-bytes padding-size)]
(if (zero? padding-size)
(conj new-coll next-stuff)
@johnmn3
johnmn3 / uninterleave
Created March 28, 2011 04:41
the opposite of interleave
;;=> [0 1 0 1 0 1 0 1]
;; [[0 0 0 0] [1 1 1 1]]
(defn uninterleave
([asq] (unzip asq [] []))
([asq acum bcum]
(if (nil? (seq asq))
[acum bcum]
(recur (rest (rest asq)) (conj acum (first asq)) (conj bcum (first (rest asq)))))))