Skip to content

Instantly share code, notes, and snippets.

View nha's full-sized avatar
🐢
https://turtlequeue.com

nha

🐢
https://turtlequeue.com
View GitHub Profile
@nha
nha / Nil Finder
Created January 27, 2016 08:42 — forked from stuarthalloway/Nil Finder
Finding those nested nils
(ns user)
(def app
"Intenal Helper"
(fnil conj []))
(defprotocol PathSeq
(path-seq* [form path] "Helper for path-seq"))
(extend-protocol PathSeq
@nha
nha / main.clj
Created January 25, 2016 20:28 — forked from fogus/main.clj
Cassowary constraint solver in ClojureScript
;;Using the Cassowary constraint solver from ClojureScript
;;This demo shows using multimethods for readable constraint syntax using +, -, and =.
;;Output is a row of circles with random radii spaced so that the space between their boundaries is uniform.
(ns c2.main
;;refer-clojure :exclude is currently broken in ClojureScript master
;;Ticket open: http://dev.clojure.org/jira/browse/CLJS-114
;;Fix applied here: https://github.com/lynaghk/clojurescript/tree/114-refer-clojure-exclude
(:refer-clojure :exclude [+ - =])
@nha
nha / Datomic News Updates
Created November 10, 2015 14:34 — forked from stuarthalloway/Datomic News Updates
Datomic update examples against a social news database
;; Datomic example code
;; demonstrates various update scenarios, using a news database
;; that contains stories, users, and upvotes
;; grab an in memory database
(use '[datomic.api :only (q db) :as d])
(def uri "datomic:mem://foo")
(d/create-database uri)
(def conn (d/connect uri))
@nha
nha / Keybase proof
Created February 27, 2014 22:55
Keybase proof
### Keybase proof
I hereby claim:
* I am nha on github.
* I am nha (https://keybase.io/nha) on keybase.
* I have a public key whose fingerprint is 7C65 1064 0EAC 25F8 1586 9E0E 59C5 150B 84CD 9FA4
To claim this, I am signing this object:
@nha
nha / config-gist.java
Last active August 29, 2015 13:55
lock-free config file
package com.github.nha;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
public class Configuration<K, V> {
private Map<K, V> map;
public Configuration() {