Install Python
$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7
Symlinks...
| // Lack of tail call optimization in JS | |
| var sum = function(x, y) { | |
| return y > 0 ? sum(x + 1, y - 1) : | |
| y < 0 ? sum(x - 1, y + 1) : | |
| x | |
| } | |
| sum(20, 100000) // => RangeError: Maximum call stack size exceeded | |
| // Using workaround |
| (function() { | |
| var buildMap = {}; | |
| /* RequireJS Use Plugin v0.2.0 | |
| * Copyright 2012, Tim Branyen (@tbranyen) | |
| * use.js may be freely distributed under the MIT license. | |
| */ | |
| define({ | |
| version: "0.2.0", |
| (function(A) { | |
| var registered_ids = {}, | |
| id_to_module_map = {}, | |
| interim_actions = {}, | |
| cleanup_actions = {}, | |
| clicked_ids = {}, | |
| queueing = {}; | |
| function register_id(id, callbacks, required_module) { | |
| id = id.replace('*', '.*'); |
| (function(F) { | |
| var registered_ids = {}, | |
| id_to_module_map = {}, | |
| interim_actions = {}, | |
| cleanup_actions = {}, | |
| clicked_ids = {}, | |
| queueing = true; | |
| function register_id(id, callbacks, required_module) { | |
| id = id.replace('*', '.*'); |
| // http://en.wikipedia.org/wiki/Approximate_string_matching | |
| function fuzzySearch(t, p) { // returns minimum edit distance between substring of t and p | |
| var a = [], // current row | |
| b = [], // previous row | |
| pa = [], // from | |
| pb = [], | |
| s, i, j; | |
| for (i = 0; i <= p.length; i++) { | |
| s = b; | |
| b = a; |
| // could be used to inspect objects runtime | |
| // e.g. with IDE for suggestion | |
| // requires a modern JS engine in the IDE | |
| var properties = function ( | |
| getNames, // alias Object.getOwnPropertyNames | |
| getDescriptor,// alias Object.getOwnPropertyDescriptor | |
| has, // alias {}.hasOwnProperty | |
| toString // alias Function.prototype.toString | |
| ) { | |
| // (C) WebReflection - Mit Style License |
| var module = (function create( | |
| namespace, handler, module, Proxy | |
| ) { | |
| // ------------------------------------ | |
| // (C) WebReflection - MitStyle License | |
| // ------------------------------------ | |
| // @dependency npm install node-proxy | |
| // ------------------------------------ | |
| // var sys = module.sys; | |
| // sys.print("it works!"); |
Install Python
$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7
Symlinks...
experimenting with a more general way of hashing a namespace, for future javascript golf. the idea is that existing browser objects can be hashed so that wasteful strings like createDocumentFragment can be avoided entirely, and keys from several objects (such as document, window, String, etc.) can be hashed into one namespace.
for example:
d = document
d.body.appendChild(d.createElement("script")).src="URL"could be shortened to
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| Version 2, December 2004 | |
| Copyright (C) 2011 subzey <subzey@immelman.ru> | |
| Everyone is permitted to copy and distribute verbatim or modified | |
| copies of this license document, and changing it is allowed as long | |
| as the name is changed. | |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |