Skip to content

Instantly share code, notes, and snippets.

View punit-naik's full-sized avatar
🎯
Look for success, you'll fail. Strive for excellence, you'll prevail. - Punit

Punit Naik punit-naik

🎯
Look for success, you'll fail. Strive for excellence, you'll prevail. - Punit
  • Bicholim, Goa, India
View GitHub Profile
@arnaudbos
arnaudbos / config.edn
Last active January 17, 2023 02:07
Clojure embedded-mongodb
{
:db-version "3.2.13"
:db-port 27017
:db-data-dir "/tmp/mongo-data-files"
}
@apeckham
apeckham / .clj
Last active February 19, 2025 08:17
find free port in clojure
(defn get-free-port []
(with-open [socket (ServerSocket. 0)]
(.getLocalPort socket)))
@scotthaleen
scotthaleen / stream_to_bytes.clj
Created October 20, 2016 21:15
Clojure: read an io/stream to a byte array
(require '[clojure.java.io :as io])
(def fp "/path/to/file")
(defn stream->bytes [is]
(loop [b (.read is) accum []]
(if (< b 0)
accum
(recur (.read is) (conj accum b)))))
@jasongilman
jasongilman / atom_clojure_setup.md
Last active October 28, 2025 22:34
This describes how I setup Atom for Clojure Development.

Atom Clojure Setup

This describes how I setup Atom for an ideal Clojure development workflow. This fixes indentation on newlines, handles parentheses, etc. The keybinding settings for enter (in keymap.cson) are important to get proper newlines with indentation at the right level. There are other helpers in init.coffee and keymap.cson that are useful for cutting, copying, pasting, deleting, and indenting Lisp expressions.

Install Atom

Download Atom

The Atom documentation is excellent. It's highly worth reading the flight manual.

@jeroenvandijk
jeroenvandijk / datomic.schema_dump.clj
Last active January 23, 2020 10:58
(A) method to dump a datomic database schema
(ns datomic.schema-dump
(:require
[datomic.api :as d]
[clojure.pprint]))
(defmethod clojure.pprint/simple-dispatch datomic.db.DbId [v] (pr v))
(defmethod clojure.pprint/simple-dispatch datomic.function.Function [v] (pr v))
(defn database-url [name]
(str "datomic:mem://" name))