Skip to content

Instantly share code, notes, and snippets.

View jneen's full-sized avatar

Jeanine Adkisson jneen

View GitHub Profile
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 <[email protected]>",
"contributors": [
{ "name": "Sascha Depold", "email": "[email protected]" }
],
"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)" [email protected] < (
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("[email protected]")
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
@jneen
jneen / send.js
Created May 3, 2011 19:05
Instantly awesome javascript
Object.prototype.send = function(fn) { return fn.call(this, this); };
Object.prototype.tap = function(fn) { this.send(fn); return this; };
@jneen
jneen / methods_as_blocks.rb
Created May 10, 2011 18:49
methods as blocks
def negative(a)
-a
end
# whee!
[1,2,3].sort_by &method(:negative) # => [3,2,1]