Skip to content

Instantly share code, notes, and snippets.

View joyrexus's full-sized avatar

J. Voigt joyrexus

View GitHub Profile
@joyrexus
joyrexus / monad.coffee
Created May 24, 2013 22:05
Crockford's monad.js translated to CoffeeScript.
MONAD = (modifier) ->
prototype = Object.create null
prototype.is_monad = true
unit = (value) ->
monad = Object.create prototype
monad.bind = (func, args...) -> func(value, args...)
modifier(monad, value) if typeof modifier is 'function'
monad
@joyrexus
joyrexus / state-monad.scm
Created May 28, 2013 15:45 — forked from igstan/state-monad.scm
State monad in scheme.
(define (push element)
(lambda (stack)
(list '() (cons element stack))))
(define (pop)
(lambda (stack)
(let ((element (car stack))
(new-stack (cdr stack)))
(list element new-stack))))
@joyrexus
joyrexus / state-monad.coffee
Created May 28, 2013 15:46 — forked from igstan/state-monad.coffee
State monad in CoffeeScript
push = (element) -> (stack) ->
newStack = [element].concat stack
{value: element, stack: newStack}
pop = (stack) ->
element = stack[0]
newStack = stack.slice 1
{value: element, stack: newStack}
bind = (stackOperation, continuation) -> (stack) ->
@joyrexus
joyrexus / leap-demo.html
Created June 3, 2013 17:28
Simple demo of leap.js: move and scale a div.
<!DOCTYPE HTML>
<meta charset="utf8">
<script src="leap.min.js"></script>
<style>
#box {
width: 200px;
height: 200px;
background-color: steelblue;
}
</style>
@joyrexus
joyrexus / template.coffee.html
Created June 5, 2013 16:32
Web page w/ inline coffeescript.
<!DOCTYPE html>
<meta charset="utf-8">
<script src="http://joyrexus.spc.uchicago.edu/resources/coffee-script.js"></script>
<style>
body {
font-family: 'Helvetica Neue';
font-weight: 100;
color: #555;
}
div {
@joyrexus
joyrexus / quote.html
Created June 5, 2013 16:34
Simple template/layout for quotations.
<!DOCTYPE html>
<meta charset="utf-8">
<link href='http://fonts.googleapis.com/css?family=Roboto+Slab:100' rel='stylesheet'
type='text/css'>
<style>
body {
font-family: 'Roboto Slab';
font-weight: 100;
font-size: 100px;
}
@joyrexus
joyrexus / README.md
Last active April 26, 2019 19:28
Animated Bezier Curve

Animated Bezier Curve

iPad-friendly. Drag the control points to modify the curve.

View it here.


This is a modification of Jason Davies work.

@joyrexus
joyrexus / request.md
Created June 14, 2013 18:06
Quick LDP report request.

README

Cassie is requesting the standard speech counts for both parent and child speakers for all home visits (sessions 1 to 12).

The standard speech counts consist of counts for utterances, word tokens and types, as well as the MLU (mean length of utterance) measure

View final report.

@joyrexus
joyrexus / record.sh
Created June 25, 2013 22:07
Shell script that records and saves a quicktime audio file.
#!/bin/sh
#
# usage:
# record.sh SECS FILE
#
# e.g.:
# record.sh 10 ~/Documents/Trials/08/audio
record() {
@joyrexus
joyrexus / record.coffee
Created June 26, 2013 19:02
Coffee script that records and saves a quicktime audio file.
#!/usr/bin/env coffee
#
# usage:
# record.coffee -t SECS FILE
# record.coffee --time SECS FILE
#
# e.g., to record a 10 second audio clip:
#
# record.coffee --time 10 ~/Documents/Trials/08/audio
#