Skip to content

Instantly share code, notes, and snippets.

@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))

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 / test.clj
Created November 12, 2015 06:21
paren mode shift case
(def foo| (bar
baz))
(define (make-link x)
  `(a [[href "#top"] [class "internal"]]
      ,(splice x)))
@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
if [ ! -f .classpath ]; then
classpath=`boot show -c | tee .classpath`
else
classpath=`cat .classpath`
fi
planck -c $classpath ...
(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*)))
(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*)))
@shaunlebron
shaunlebron / turoMiles.js
Created March 7, 2017 04:23
Optimizing cost on Turo
function turoMiles(desiredMiles) {
var costPerDay = 35;
var costPerMileOver = 0.75;
var milesPerDay = 150;
var milesPerWeek = 1000;
function milesAllowed(days) {
var weeks = Math.floor(days / 7);
days = days % 7;
@shaunlebron
shaunlebron / readme.md
Created June 2, 2017 01:36
cljs developer experience work

cljs dev experience

  1. Writing API docs (colored by progress)
  2. Integrating API docs into official ClojureScript website
  3. Integrating news into official ClojureScript website
  4. Pushing npm cljs tool to first public release 1.0.0.