Skip to content

Instantly share code, notes, and snippets.

View StoneCypher's full-sized avatar

John Haugeland StoneCypher

View GitHub Profile
@StoneCypher
StoneCypher / ex.md
Created December 24, 2013 03:11
what the 💩 is this damnit john

ErlangChopra

... because David needed his very own text generator, and we know he likes RDCQG.

The code

Starts     = ["Experiential truth ", "The physical world ", "Non-judgment ", "Quantum physics "].
<!doctype html>
<html>
<head>
<script type="text/javascript">
var Data = {
starts : ["Experiential truth ", "The physical world ", "Non-judgment ", "Quantum physics "],
-module(wm). % wrap math
-compile(export_all).
%% 2> c("/projects/scratch/wm.erl").
routes() ->
[ { get, <<"/api/user/:id/">>, Args, Handler },
{ post, <<"/api/user/:id/">>, Args, Handler },
{ delete, <<"/api/user/:id/">>, Args, Handler },
...
].
-module(dumb_math).
-export([
square/1
]).
-module(dumb_math_tests).
-compile(export_all).
-include_lib("eunit/include/eunit.hrl").
square_test_() ->
{ "Square tests", [
-module(dumb_math).
-export([
square/1
]).
-module(dumb_math_tests).
-compile(export_all).
-include_lib("proper/include/proper.hrl").
-include_lib("eunit/include/eunit.hrl").
prop_square_never_negative() ->
@StoneCypher
StoneCypher / gist:9015456
Created February 15, 2014 06:45
Explanation of how to count words in PHP (MIT License)
<html><body>
<?php
// normally i'd write this more densely, but you said you wanted some exposure
// so i'm writing it in single concepts per line and annotating it for reference :)
// config
@StoneCypher
StoneCypher / Eng10Trie.js
Created February 15, 2014 09:10
A trie of English words from ten sources. MIT license.
var Eng10Trie = '0:4JH
1:4JM
2:4JO
3:4H5
4:498
5:4IP
6:4J1
7:4J6
8:4HN
9:4HU