Skip to content

Instantly share code, notes, and snippets.

View avescodes's full-sized avatar

Avery Quinn avescodes

View GitHub Profile
@avescodes
avescodes / .projections.json
Created February 12, 2018 18:27
Projectionist Projections for Phoenix 1.3
{
"lib/*.ex": {
"type": "module",
"alternate": "test/{}_test.exs"
},
"test/*_test.exs": {
"type": "test",
"alternate": "lib/{}.ex"
},
@avescodes
avescodes / sexp-cheat-sheet
Created September 13, 2017 19:21 — forked from dylanmcdiarmid/sexp-cheat-sheet
vim sexp mappings for normal people 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
Verifying that +rkneufeld is my blockchain ID. https://onename.com/rkneufeld
@avescodes
avescodes / acquirer.clj
Last active August 29, 2015 14:22
Conveying Information with Simulant’s Process State Service
(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 August 18, 2014 18:42
Great little snippet for using Postgres enum types inside clojure.java.jdbc
(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"))
#!/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

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 07:58
Minimal Pedestal service without default interceptors or dev tooling machinery. Automatically reloads changes.
(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 {}})
(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))

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: