Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
from string import whitespace | |
atom_end = set('()"\'') | set(whitespace) | |
def parse(sexp): | |
stack, i, length = [[]], 0, len(sexp) | |
while i < length: | |
c = sexp[i] | |
print c, stack |
Places to Visit and Things To Do for Nerds Visiting Chicago | |
/** | |
* Module for using an external editor. | |
* | |
* Example where the user will be prompted for the path | |
* to their editor of choice. The callback is passed the | |
* entirety of the changed contents, whenever a change is | |
* detected. | |
* | |
* const extEditor = require("ext-editor"); | |
* |
// new node.js tls api | |
var tls = require('tls'); | |
var fs = require('fs'); | |
var options = { | |
key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), | |
cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem') | |
}; | |
var server = tls.createServer(options, function (s) { |
var mvc = { | |
m: {}, | |
v: {}, | |
c: {}, | |
create: function(type, circuit, fuseactions) { | |
switch (type) { | |
case "model": | |
case "controller": | |
case "view": | |
return mvc[type[0]][circuit] = fuseactions; |
// Converts an ArrayBuffer directly to base64, without any intermediate 'convert to string then | |
// use window.btoa' step. According to my tests, this appears to be a faster approach: | |
// http://jsperf.com/encoding-xhr-image-data/5 | |
/* | |
MIT LICENSE | |
Copyright 2011 Jon Leighton | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: |
from collections import namedtuple | |
def convert(dictionary): | |
return namedtuple('GenericDict', dictionary.keys())(**dictionary) | |
""" | |
>>> d = dictionary(a=1, b='b', c=[3]) | |
>>> named = convert(d) | |
>>> named.a == d.a | |
True | |
>>> named.b == d.b |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
//based on blog post that I saw here: http://www.sanraul.com/2010/08/01/implementing-doubletap-on-iphones-and-ipads/ | |
(function($){ | |
$.fn.doubletap = function(fn) { | |
return fn ? this.bind('doubletap', fn) : this.trigger('doubletap'); | |
}; | |
$.attrFn.doubletap = true; | |
$.event.special.doubletap = { | |
setup: function(data, namespaces){ |
;(function($){ | |
var touch = {}, | |
touchTimeout, tapTimeout, swipeTimeout, | |
longTapDelay = 750, longTapTimeout | |
function parentIfText(node) { | |
return 'tagName' in node ? node : node.parentNode | |
} | |
function swipeDirection(x1, x2, y1, y2) { |