Skip to content

Instantly share code, notes, and snippets.

@jborden
jborden / gist:57000cc2e351f057eab2642a4d417844
Created January 13, 2021 01:43
James Borden pre-commit git hook
#!/bin/bash
# comment to temporarily turn off testing
git diff --exit-code
RESULT=$?
[ $RESULT -ne 0 ] && exit 1
if [[ -n $(git status --porcelain | grep ??) ]]; then
echo "There are untracked files"
exit 1
fi
lein test
@jborden
jborden / JohnsonVotes.csv
Last active May 3, 2017 04:03 — forked from cornfact/cityChicago.csv
Illinois counties, revised
county percent
ALEXANDER 1.7
PULASKI 2.0
HARDIN 2.2
WAYNE 2.3
UNION 2.6
SCOTT 2.6
GALLATIN 2.7
COOK 2.7
EDWARDS 2.7
module push_array
implicit none
! usage:
! array = push(array,val)
interface push
module procedure push_scalar_int_onto_rank1_int
module procedure push_scalar_int2_onto_rank1_int2
module procedure push_rank1_int_onto_rank2_int
module procedure push_rank1_real8_onto_rank2_real8
end interface push
@jborden
jborden / core.clj
Created November 13, 2012 23:21
Simple web app using wrap-json-body
(ns web-app.core
(:use
[compojure.core :only [defroutes GET POST]]
[ring.middleware.json]
;; ... remaining libs
[web-app.register :as register]))
(defroutes web-app
;; ... various routes
(POST "/register-new-user" {body :body} (register/handle-registration body)))
@jborden
jborden / javac-mode.el
Created June 22, 2012 16:13
A minor mode for compiling and running java from emacs
;; Minor mode for compiling java classes
(defvar javac-mode nil
"Mode variable for java class files.")
(make-variable-buffer-local 'javac-mode)
(defun javac-mode (&optional arg)
"Minor mode for compiling java class files.
Special Commands:
\\{javac-mode-map}"
(interactive "P")