Skip to content

Instantly share code, notes, and snippets.

(ns sitegen.markdown
(:require
[clojure.string :as string]
[planck.core :refer [file-seq slurp]]
[clojure.walk :refer [keywordize-keys]]))
(def ^:dynamic *filename*)
(defn error [msg]
(throw (str "markdown metadata error: " msg " - " *filename*)))
(ns sitegen.markdown
(:require
[clojure.string :as string]
[planck.core :refer [file-seq slurp]]
[clojure.walk :refer [keywordize-keys]]
[cljs.pprint :refer [pprint]]))
(def ^:dynamic *filename*)
(defn error [msg]
(throw (str "markdown metadata error: " msg " - " *filename*)))
if [ ! -f .classpath ]; then
classpath=`boot show -c | tee .classpath`
else
classpath=`cat .classpath`
fi
planck -c $classpath ...
@shaunlebron
shaunlebron / parinfer-benchmarks
Created December 24, 2015 22:43
current parinfer benchmarks
$ node test/perf.js
Testing file with 2865 lines
indent: 62.065ms
paren: 52.131ms
$ /usr/sbin/system_profiler SPHardwareDataType
Hardware Overview:
Model Name: MacBook Pro
(define (make-link x)
  `(a [[href "#top"] [class "internal"]]
      ,(splice x)))
@shaunlebron
shaunlebron / test.clj
Created November 12, 2015 06:21
paren mode shift case
(def foo| (bar
baz))

Google Closure Library API data

The file below is used by the search box on the official Closure API docs, which is generated by js-dossier. If we want more doc data besides name and type, we can modify js-dossier to spit those out as data.

The data is just a single array of objects at TYPES.types.

@shaunlebron
shaunlebron / es7coreasync.md
Last active July 28, 2018 07:58
es7 vs core.async

Comparing ES7 and core.async

ES7 core.async
async function() {...} (fn [] (go ...))
await ... (<! ...)
await* or Promise.all(...) (doseq [c ...] (<! c))
@shaunlebron
shaunlebron / 00-input.cljs
Last active June 18, 2016 16:37
protocol implementation in cljs
;; dummy protocol
(defprotocol IFoo
(foo [this]))
;; dummy cljs type
(deftype Bar [])
;; extending a cljs type
(extend-type Bar
IFoo (foo [this] (println "Hello from IFoo.foo for Bar")))
@shaunlebron
shaunlebron / atlas.js
Created August 27, 2015 14:09
pacman spritesheet modified for gh4st
var atlas = (function(){
var canvas,ctx;
var size = 22;
var cols = 14; // has to be ONE MORE than intended to fix some sort of CHROME BUG (last cell always blank?)
var rows = 22;
var creates = 0;