Skip to content

Instantly share code, notes, and snippets.

View jneen's full-sized avatar

Jeanine Adkisson jneen

View GitHub Profile
@jneen
jneen / order.md
Created June 16, 2015 03:40
Tulip evaluation order (DRAFT)

In tulip, a function call is expressed as a sequence of expressions, with parentheses appearing freely:

f arg1 (arg2) (g arg3)

If a function receives fewer arguments than its arity, the result is a curried function expecting the remaining arguments. If it receives more, it consumes its arity and calls the return value with the rest. The order of evaluation for a function call is:

  • The function expression is evaluated
  • Each argument is evaluated
(defn frybo [fname]
(def raf (java.io.RandomAccessFile. fname "r"))
(def out-chan (chan 10))
(go-loop [] (>!! out-chan (.readByte raf)))
out-chan)
npm ! WARNING !
npm ! WARNING ! Symlinking the lib directory is deprecated
npm ! WARNING ! Please don't rely on this feature, as it will be removed.
npm ! WARNING ! Use the 'main' module instead.
npm ! WARNING !
npm install failed Error: Libs dir not found /usr/local/lib/node/.npm/sequelize/0.2.4/package/sequelize
at /usr/local/lib/node/.npm/npm/0.1.25/package/lib/build.js:267:23
at node.js:762:9
{
"name": "sequelize",
"description": "MySQL ORM for Node.JS",
"version": "0.2.4",
"author": "Sascha Depold <sascha-github@depold.com>",
"contributors": [
{ "name": "Sascha Depold", "email": "sascha-github@depold.com" }
],
"dependencies": {},
"keywords": ["mysql", "orm", "nodejs", "object relational mapper"],
@jneen
jneen / gist:739145
Created December 13, 2010 16:03
what the hell
>> h = Hash.new { |h, k| h[k] = Hash.new(&h.default_proc) }
=> {}
>> h[1][2] = 3
=> 3
>> h[1][2][4]
=> 0
>> # wtf?
// an IO-like clone system for javascript. thoughts?
Object.prototype.clone = function() {
return Object.create(this);
}
Object.prototype.merge = function(obj) {
var
keys = Object.keys(obj),
self = this
# ~/.bashrc
trap on_exit EXIT
on_exit() {
mail -s "Bash: logging out at $(date)" monitor@example.com < (
echo "Commands run:"
history
)
}
@jneen
jneen / example.io
Created January 29, 2011 16:34
a module system for Io
# Assuming this directory structure:
#
# MyModule/
# init.io # => Object clone do( foo := "bar" )
# slot1.io # => "LOL"
# slot2.io # => method("running slot2" println; self)
# slot3/
# subslot1.io # => "this is subslot1"
import("/path/to/MyModule")
@jneen
jneen / spec.io
Created February 3, 2011 17:45
The specfile (proposal)
Ion spec(
# this stanza is for administrative metadata
metadata(
author("A Cool Developer")
email("my_email@domain.com")
homepage("http://www.example.com/")
summary("This is a really cool library!")
description("""
Really, I swear it is.
""")
@jneen
jneen / example.coffee
Created April 27, 2011 19:08
the Maybe monad
Maybe = require './Maybe'
Maybe(1) # => Maybe(1)
Maybe({a: 1})('a') # => Maybe(1)
Maybe({a: 1})('a').value # => 1
Maybe({a: 1})('b') # => Nothing
Maybe({a: 1})('b')('c')('d')('e') # => Nothing