Skip to content

Instantly share code, notes, and snippets.

View pdenno's full-sized avatar

Peter Denno pdenno

View GitHub Profile
@apeckham
apeckham / .clj
Last active July 28, 2021 20:54
find free port in clojure
(defn get-free-port []
(with-open [socket (ServerSocket. 0)]
(.getLocalPort socket)))
@david-mcneil
david-mcneil / custom-clojure-map.clj
Created January 26, 2012 20:43
Creating a custom Clojure map type
(ns people
(:use [clojure.string :only (join)]
[clojure.pprint :only (pprint simple-dispatch)]))
;; we can make maps using the special literal form:
{:a 100
:b 200}
(class {:a 100 :b 200})