Skip to content

Instantly share code, notes, and snippets.


Dan danneu

  • Texas
View GitHub Profile
CatherineH /
Created Feb 1, 2018
Convert a text character to an SVG path.
from svgpathtools import wsvg, Line, QuadraticBezier, Path
from freetype import Face
def tuple_to_imag(t):
return t[0] + t[1] * 1j
face = Face('./Vera.ttf')
View gist:81ccc0e6652eccaf43cf
m2.xlarge (4 virtual cores)
Both Jetty and Netty execute the same code--generate 8k of random bits and compute a sha1, returning it over the wire.
INTERNAL (Benchmark tool runs on same machine)
danharper / gulpfile.js
Last active Jul 30, 2020
New ES6 project with Babel, Browserify & Gulp
View gulpfile.js
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel));
stuarthalloway / schema_history.clj
Last active Mar 31, 2017
Complete schema history of a live Datomic database
View schema_history.clj
;; Complete schema history for a live Datomic database.
'[clojure.pprint :as pp]
'[clojure.set :as set]
'[datomic.api :as d])
;; fill this in with your own database connection
(def uri "datomic:dev://localhost:4334/my-db")
(def conn (d/connect uri))
(def db (d/db conn))
PixnBits / md5.js
Last active May 27, 2017 — forked from jhoff/md5.js
invalid reference fix
View md5.js
(function (global) {
var md5cycle = function (x, k) {
var a = x[0],
b = x[1],
c = x[2],
d = x[3];
danielsz / pushState.cljs
Last active Jul 15, 2016
PushState (via Html5History from google closure) with secretary, a client-side routing library for clojurescript. Allows to map absolute urls with routes without the hash-bang hackery.
View pushState.cljs
(def history (Html5History.))
(.setUseFragment history false)
(.setPathPrefix history "")
(.setEnabled history true)
(let [navigation (listen history EventType/NAVIGATE)]
(while true
(let [token (.-token (<! navigation))]
(secretary/dispatch! token)))))
View catch.cljs
(ns blog.errors.core
[cljs.core.async.macros :refer [go]]
[blog.utils.macros :refer [<?]])
[cljs.core.async :refer [>! <! chan close!]]))
;; convert Node.js async function into a something
;; that returns a value or error on a channel
(defn run-task [f & args]
View words.cljs
(defn words-proc [words button interval interval-control scrub]
(go (loop [idx 0]
(show-word! words idx)
(let [[v c] (alts! [button interval scrub])
(condp = c
button (do (>! interval-control v)
(recur idx))
interval (recur (inc idx))
scrub (do (>! interval-control :stop)
(recur v)))))))
View gist:5911181
(ns user
(:require [ :as io]
[datomic.api :as d]))
(defn order-schema []
(read-string (slurp (io/resource "schema.edn"))))
(defn start-datomic! [uri schema]
(d/create-database uri)
(let [conn (d/connect uri)]
willurd /
Last active Oct 21, 2020
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
You can’t perform that action at this time.