Skip to content

Instantly share code, notes, and snippets.

View jwhitlark's full-sized avatar

Jason Whitlark jwhitlark

View GitHub Profile
@mattmc3
mattmc3 / tasks.json
Created April 6, 2017 00:44
VSCode tasks for running a Makefile
// Makefile
// ${workspaceRoot} the path of the folder opened in VS Code
// ${file} the current opened file
// ${fileBasename} the current opened file's basename
// ${fileDirname} the current opened file's dirname
// ${fileExtname} the current opened file's extension
// ${cwd} the task runner's current working directory on startup
{
"version": "0.1.0",
"command": "bash",
@angusiguess
angusiguess / biblio.md
Last active May 6, 2023 21:52
Emulators, Immutability, and Time Travel
@arohner
arohner / google-api.clj
Created November 5, 2016 21:53
Clojure example of accessing google APIs directly
(ns example.api.google
(:require [cemerick.url :as url]
[cheshire.core :as json]
[clj-jwt.core :as jwt]
[clj-jwt.key :as key]
[clj-time.core :as time]
[clj-http.client :as http]
[clojure.string :as str])
(:import java.io.StringReader))
@allgress
allgress / reagent_datascript.cljs
Last active February 16, 2023 21:16
Test use of DataScript for state management of Reagent views.
(ns reagent-test.core
(:require [reagent.core :as reagent :refer [atom]]
[datascript :as d]
[cljs-uuid-utils :as uuid]))
(enable-console-print!)
(defn bind
([conn q]
(bind conn q (atom nil)))
@danlentz
danlentz / flow-diagram.clj
Created February 26, 2014 06:53
Clojure ASCII flow diagrams from google code
;;;;;;;;;;;;;;;;;;
;; $Rev$
;; textflow is a trivial generator of RFC like call flow (a.k.a sequence diagrams)
;;
;; Example usage:
;; (flow [Alice Bob Tzach]
;; [[mmm Tzach Bob]
;; [xxx Bob Alice]
;; []
;; [zzz Alice Tzach]])
@bbbates
bbbates / core.clj
Created January 3, 2014 03:15
Using LockService to guarantee leader with Clojure and JGroups
(ns leader-guarantee.core
(:import (org.jgroups.blocks.locking LockService)
(org.jgroups.protocols CENTRAL_LOCK)
(org.jgroups JChannel)
(java.util.concurrent.locks Lock)))
(defn- get-lock
[lock-service with-lock-fn]
(fn []
(let [lock (.getLock lock-service "leader")]
@xavi
xavi / gist:3729307
Created September 15, 2012 18:57
Fast, simple, powerful templating in Clojure
;; Call the renderer-fn macro with a template and it returns a function optimized to render it.
;; This happens at compile-time.
;; At run-time, you call this function with the parameters that will be interpolated into the template,
;; typically (but not limited to) a map.
;;
;; Useful in i18n for variable interpolation, for example. I'm using this to add internationalization
;; support to https://github.com/xavi/noir-auth-app
;; See usage at the end.