Skip to content

Instantly share code, notes, and snippets.

View technomancy's full-sized avatar

Phil Hagelberg technomancy

View GitHub Profile
local lg = love.graphics
local lm = love.math
local pmethods={}
local function earth(u)
local cr,cb,cg
if u < 0.5 then
cb = u + 0.5
cr=0

Leiningen Plugins

Leiningen tasks are simply functions named $TASK in a leiningen.$TASK namespace. So writing a Leiningen plugin is just a matter of creating a project that contains such a function, but much of this documentation applies equally to the tasks that ship with Leiningen itself.

Using the plugin is a matter of declaring it in the :plugins entry of the project map. If a plugin is a matter of user convenience rather

~/src/slamhound $ head -n 1 project.clj
(defproject slamhound (or (System/getenv "CIRCLE_BUILD_NUM") "0.0.0-SNAPSHOT")
~/src/slamhound $ CIRCLE_BUILD_NUM=751 lein pprint :version
"751"
~/src/slamhound $ lein pprint :version
"0.0.0-SNAPSHOT"
(defvar clj-last-test "user")
(defun clj-run-tests (run-last)
(interactive "P")
(monroe-send-eval-string
(format "%s" `(circleci.test/run-tests
(quote ,(if run-last
clj-last-test
(setq clj-last-test (clojure-find-ns))))))
(monroe-make-response-handler)))
@technomancy
technomancy / conj-2017.md
Last active July 4, 2017 15:54
Clojure Conj talk proposal

Clojure Conj 2017 Talk: Dev Tools as Data

Abstract (5 sentences max)

In the Clojure community we love to say "it's just data", and this enables us to compose things in unique and often-unexpected ways.

One place where that maxim hasn't been thoroughly applied is developer tooling. Representing things like tracers, test runners, and refactoring tools with a unified declarative model allows us to construct powerful meta-tools for various development environments and avoid reinventing the wheel for building interfaces for each editor one at a time.

Let's do some cross-runtime metaprogramming for greater Clojure/editor symbiosis!

phil@localhost ~ $ openssl speed blowfish
Doing blowfish cbc for 3s on 16 size blocks: 15260699 blowfish cbc's in 2.97s
Doing blowfish cbc for 3s on 64 size blocks: 4019394 blowfish cbc's in 2.99s
Doing blowfish cbc for 3s on 256 size blocks: 1027156 blowfish cbc's in 3.00s
Doing blowfish cbc for 3s on 1024 size blocks: 258836 blowfish cbc's in 3.00s
Doing blowfish cbc for 3s on 8192 size blocks: 32246 blowfish cbc's in 3.00s
OpenSSL 1.0.1t 3 May 2016
built on: Thu Jan 26 23:29:15 2017
options:bn(64,64) rc4(16x,int) des(idx,cisc,16,int) aes(partial) blowfish(idx)
compiler: gcc -I. -I.. -I../include -fPIC -DOPENSSL_PIC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -m64 -DL_ENDIAN -DTERMIO -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -Wl,-z,relro -Wa,--noexecstack -Wall -DMD32_REG_T=int -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHI
#!/usr/bin/python
import re, os
def get_authinfo_password(machine, login):
s = "machine %s login %s password ([^ ]*)\n" % (machine, login)
p = re.compile(s)
authinfo = os.popen("gpg -q --no-tty -d ~/.authinfo.gpg").read()
return p.search(authinfo).group(1)
;; module rotate_half() {
;; rotation_y_offset = 1.75 * column_spacing;
;; rz(angle, [hand_separation, rotation_y_offset]) {
;; children();
;; }
;; }
(defn rotate-half
"Rotate the right half of the keys around the top left corner of
the thumb key. Assumes that the thumb key is a 1x1.5 key and that
(defn right-screw-holes [radius split-bottom?]
(let [back-right [(* (+ col-count thumb-key-count) row-spacing)
(* (staggering-offsets (dec col-count)) column-spacing)]
tmp (rz-fun back-right angle [0 (* 2.25 column-spacing)])
nudge 0.75]
(rotate-half
(add-hand-separation
;; When adding washers, split the bottom middle hole, but when doing
;; screws there should just be one bottom middle hole.
(if split-bottom?
(ns hack-night.core
(:import (clojure.lang Namespace))
(:require [clojure.java.io :as io]
[clojure.set :refer [join]]))
(def class-blacklist #"^(class|interface) java\.(math|lang|util\.concurrent)")
(defn map-for-ns [n]
(let [mappings (vals (.getMappings n))
[classes vars] ((juxt remove filter) var? mappings)