Skip to content

Instantly share code, notes, and snippets.

Avatar

Avery Quinn avescodes

View GitHub Profile
@avescodes
avescodes / .projections.json
Created Feb 12, 2018
Projectionist Projections for Phoenix 1.3
View .projections.json
{
"lib/*.ex": {
"type": "module",
"alternate": "test/{}_test.exs"
},
"test/*_test.exs": {
"type": "test",
"alternate": "lib/{}.ex"
},
@avescodes
avescodes / sexp-cheat-sheet
Created Sep 13, 2017 — forked from dylanmcdiarmid/sexp-cheat-sheet
vim sexp mappings for normal people cheat sheet
View sexp-cheat-sheet
.vimrc
" Map leader to comma
let maplocalleader=","
" Toggle this for vim-sexp to not go into insert mode after wrapping something
let g:sexp_insert_after_wrap = 0
" Toggle this to disable automatically creating closing brackets and quotes
let g:sexp_enable_insert_mode_mappings = 1
Vocab
View gist:7b22e66137da6ff5b46c
Verifying that +rkneufeld is my blockchain ID. https://onename.com/rkneufeld
@avescodes
avescodes / acquirer.clj
Last active Aug 29, 2015
Conveying Information with Simulant’s Process State Service
View acquirer.clj
(ns my-suite.actions.acquirer
(:require ;; …
[io.homegrown.sim-ephemeral :as eph])
(defn create-payment
Create a payment, returning a vector of [<response> <payment id> <nsecs taken>]”
[action]
…)
(defn approve-paymenet
@avescodes
avescodes / gist:e5d1acbb007f47655508
Created Aug 18, 2014
Great little snippet for using Postgres enum types inside clojure.java.jdbc
View gist:e5d1acbb007f47655508
(defn keyword->pg-enum
"Convert a keyword value into an enum-compatible object."
[enum-type kw]
(doto (org.postgresql.util.PGobject.)
(.setType enum-type)
(.setValue (name kw))))
(def ->status
"Convert a keyword status into a something_status enum object"
(partial keyword->pg-enum "something_status"))
View ports.sh
#!/usr/bin/env bash
pattern=$1
PORTS=""
if [ -z "$pattern" ]; then
PORTS=$(lsof -iTCP -sTCP:LISTEN)
else
PORTS=$(lsof -iTCP -sTCP:LISTEN | grep "$pattern")
fi
View keybase.md

Keybase proof

I hereby claim:

  • I am rkneufeld on github.
  • I am rkneufeld (https://keybase.io/rkneufeld) on keybase.
  • I have a public key whose fingerprint is 7714 DC1D EF61 4C70 1DF8 5387 B75F AF61 E0C0 89C6

To claim this, I am signing this object:

@avescodes
avescodes / core.clj
Last active May 9, 2016
Minimal Pedestal service without default interceptors or dev tooling machinery. Automatically reloads changes.
View core.clj
(ns my-todo.core
(:require [io.pedestal.http :as http]
[io.pedestal.http.route :refer [router]]
[io.pedestal.http.route.definition :refer [defroutes]]))
(defn hello-world [context]
{:status 200
:body "Hello, world!"
:headers {}})
View lil-driver.clj
(require '[datomic.api :as d]
'[clojure.stacktrace :as st])
;; Knobs
(def datoms-per-tx 1000)
;; Monitoring
(def start-time (atom 0))
(def transaction-count (atom 0))
View keybase.md

Keybase proof

I hereby claim:

  • I am rkneufeld on github.
  • I am rkneufeld (https://keybase.io/rkneufeld) on keybase.
  • I have a public key whose fingerprint is 1A4A 094D D64C FFC8 A8E7 F71F C510 F110 AB0B 89B5

To claim this, I am signing this object: