Skip to content

Instantly share code, notes, and snippets.

Jon Distad jondistad

Block or report user

Report or block jondistad

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View package.json
"name": "streamy",
"version": "0.0.1",
"dependencies": {
"most": "1.5.0"
"devDependencies": {
"@types/node": "^8.0.18"
jondistad / rlock.go
Last active May 26, 2017
A re-entrant lock with sync wrapper
View rlock.go
package main
import (
type Owner unsafe.Pointer
jondistad / evenodd.scala
Created Sep 22, 2016
Even/odd addition proof in scala
View evenodd.scala
// See
sealed trait Nat
trait Z extends Nat
case object Z extends Z
case class S[N <: Nat](n: N) extends Nat
sealed trait Even[N <: Nat]
trait EvenZ extends Even[Z]
case object EvenZ extends EvenZ
jondistad /
Last active Apr 4, 2016
Trouble with squash merges
# Create a fresh repo
$ git init testsquash
Initialized empty Git repository in /Users/jon/Code/Sterf/testsquash/.git/
$ cd testsquash
# Commit a file to master
$ echo foo >> file
$ git add .
View Interpreter.idr
module Interpreter
import Data.Fin
import Data.Vect
data Ty = TyInt
| TyBool
| TyStr
| TyFun Ty Ty
jondistad /
Created Aug 15, 2015
Clojure lazy concat without stack overflow
* Copyright (c) Rich Hickey. All rights reserved.
* The use and distribution terms for this software are covered by the
* Eclipse Public License 1.0 (
* which can be found in the file epl-v10.html at the root of this distribution.
* By using this software in any fashion, you are agreeing to be bound by
* the terms of this license.
* You must not remove this notice, or any other, from this software.

Getting Clojure set up


Leiningen is the de facto clojure project and package manager. It can be installed via homebrew on OS X

brew install leiningen

or just download the shell script and put it on your path. If ~/bin is on your path, then you would do:

jondistad / coffee
Last active Aug 29, 2015
Coffeescript Nave shim
View coffee
#!/usr/bin/env zsh
set -e
function nave_version_file {
if [ -f "$file" ]; then
echo "$file"
elif `git rev-parse &>/dev/null`; then
file="$(git rev-parse --show-toplevel)/.nave-version"
fs = require 'fs'
#request = require 'request'
request = ({uri}, done) ->
done null, uri
reqreq = (uris) ->
for uri in uris
yield ( (done) -> done null, uri )
jondistad /
Last active Aug 29, 2015
isGen = (f) ->
f? and is 'GeneratorFunction'
isIter = (f) ->
f? and is 'GeneratorFunctionPrototype'
class Seq
constructor: (it) ->
if isGen it
@_it = it()
You can’t perform that action at this time.