You should pip install pyobjc first.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns instaparsexample.core | |
| (:require [instaparse.core :as i])) | |
| (let [p (i/parser (slurp "example.bnf"))] | |
| (for [ex ["1234" | |
| "a" | |
| "aab" | |
| "nil" | |
| "()" | |
| "(())" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns timings.core | |
| (:gen-class) | |
| (:require [com.hypirion.clj-xchart :as c])) | |
| (defn bin-value | |
| " | |
| Convert value from xmin to xmax to a bin number (0..nbins-1) | |
| " | |
| [xmin xmax nbins x] | |
| (int (Math/floor (* nbins |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns ephem.core | |
| (:require [clj-http.client :as http] | |
| [clojure.java.io :as io] | |
| [clojure.string :as s] | |
| [logplots.histo :as h])) | |
| (def local-planet-file-name "planets.dat") | |
| (defn cache-planets! [] | |
| (let [planets-url "https://minorplanetcenter.net/iau/MPCORB/MPCORB.DAT" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns buildings.core | |
| (:require [clojure.java.io :as io] | |
| [cheshire.core :as json]) | |
| (:gen-class)) | |
| (defn read-buildings-from-geojson [statefile] | |
| (->> statefile | |
| io/file | |
| io/reader | |
| line-seq |
I hereby claim:
- I am eigenhombre on github.
- I am eigenhombre (https://keybase.io/eigenhombre) on keybase.
- I have a public key ASDwbU1xCvJguJP-Rlw_qEzhcN_1l3Sh4TaOX9T4AouEzwo
To claim this, I am signing this object:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defmacro with-properties [property-map & body] | |
| `(let [pm# ~property-map | |
| props# (into {} (for [[k# v#] pm#] | |
| [k# (System/getProperty k#)]))] | |
| (doseq [k# (keys pm#)] | |
| (System/setProperty k# (get pm# k#))) | |
| (try | |
| ~@body | |
| (finally | |
| (doseq [k# (keys pm#)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (def xs (vector 1 2 3)) | |
| (type xs) | |
| (type (map str xs)) | |
| (type (map odd? xs)) | |
| (type (filter odd? (list 1 2 3))) | |
| (first (map str (range))) | |
| (take 10 (range)) | |
| (take 10 (map str (range))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (require '[clj-time.core :as t] | |
| '[clj-time.coerce :as tc]) | |
| (defn perd2 | |
| " | |
| Another in-progress timer, showing remaining time. Gradually reports | |
| less and less often, with a maximum time between reports of one | |
| minute. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns example.kinesis | |
| (:require [amazonica.aws.kinesis :as k] | |
| [cheshire.core :as json] | |
| [clj-time.coerce :as tc] | |
| [clj-time.core :as t]) | |
| (:import [java.nio ByteBuffer] | |
| [java.nio.charset Charset])) | |
| (def my-stream-name "my-neato-stream") |