View genpaperwallet.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import binascii | |
from bip_utils import Bip38PubKeyModes, Bip38Encrypter | |
from bitcoin import * | |
from qrcode import * | |
from PIL import Image | |
from PIL import ImageFont | |
from PIL import ImageDraw |
View filebin-example.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export SHA=$(git rev-parse HEAD) | |
tar czfv $SHA.tgz resources/public/ | |
curl --request POST --data-binary "@${SHA}.tgz" -H "filename: "$SHA.tgz -H "bin: "$SHA https://filebin.net | |
export T=$(curl -s https://filebin.net/$SHA | grep \?t= | tail -n 1 | sed -e 's/^.*zip.t=//' | cut -c1-8) | |
curl -s https://filebin.net/$SHA/$SHA.tgz?t=$T --output $SHA.tgz | |
tar -xzf $SHA.tgz |
View continuationlike-debugging-style.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro persist-scope | |
"local scope -> atom" | |
[a] | |
`(do ~@(map (fn [v] `(swap! ~a assoc (keyword '~v) ~v)) | |
(keys (cond-> &env (contains? &env :locals) :locals))))) | |
(def scope-atom (atom {})) | |
(let [foo 1] (persist-scope scope-atom)) |
View README.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tweets from my twitter archive but in order |
View bitclout_fees.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "<html><table><tr><th>type</th><th>amount</th><tr>" > /tmp/transactions.html; cat /tmp/transactions | egrep "^(Transaction Type:|Fees:).*" | while read l ; do if [[ "$l" =~ ^Transaction.*$ ]]; then export transaction=$(echo $l | sed -e 's/^.*://'); else echo "<tr><td>"$transaction"</td><td>"$(echo $(echo $l | sed -e 's/^.*://')" * 154.87" | bc )"</td></tr>"; fi ; done >> /tmp/transactions.html ; echo "</table></html>" >> /tmp/transactions.html |
View two-useful-macros.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro with | |
"do things with the first expression passed, | |
and produce the result" | |
[expr & body] | |
`(let [~'% ~expr] ~@body)) | |
(defmacro within | |
"do things with the first expression passed (for side effects), | |
but produce the value of the first expression" | |
[expr & body] |
View ticket-sentiment.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns ticket-sentiment.core | |
(:require [clojure.data.csv :as csv] | |
[clojure.java.io :as io] | |
[clojure.pprint :refer [pprint]] | |
[damionjunk.nlp.cmu-ark :as ark] | |
[damionjunk.nlp.stanford :as nlp])) | |
(defn mean [coll] | |
(let [sum (apply + coll) | |
count (count coll)] |
View clj->org.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn clj->org | |
[data-rows col-fns] | |
(doseq [line (map (apply juxt col-fns) data-rows)] | |
(println (str "|" (clojure.string/join "|" line) "|")))) | |
;; edit: use print-table, and support col headers | |
;; I never realized print-table is an org-table!! | |
(defn clj->org | |
[data-rows col-fns & [headers]] |
View profiles2env.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env plk -Sdeps {:deps,{inflections,{:mvn/version,"0.13.0"}}} | |
;; EXAMPLE USAGE: | |
;; | |
;; profiles2env profiles.clj > ~/cc-vars | |
;; . ~/cc-vars | |
(ns scripts.profiles2env | |
(:require [cljs.reader :as r] | |
[clojure.string :as str] |
NewerOlder