Skip to content

Instantly share code, notes, and snippets.

View junosuarez's full-sized avatar
💭
hi hello

juno suárez junosuarez

💭
hi hello
View GitHub Profile
macro module {
case $body => {
define(function (require, exports, module) {
$body
});
}
}
module {
var x = require('x');
@junosuarez
junosuarez / gist:3954211
Created October 25, 2012 17:34
beeshmo
$$c,
$$$$hc
$$$$$$$,
$$$$$$$$c
$$$$$$$$$$,
$$$$$$$$$$$c
$$$$$$$$$$$$L -,,_
$$$$$$$$$$$$$c .,z$$$$?$?? , . .
$$$$$$C""""""" ,,$$$$$$$$??)4 - <"d$$ccc,. . -KPc, , ", `c
$$$$$$$$?= -4c$$$$$$$$$$?CcL?' cc$$$$$$$$$c`c `. "$$$c,$cc Jc J$
@junosuarez
junosuarez / gist:4003398
Created November 2, 2012 18:32
Micro-UMD format
/* The problem: writing boiler plate sucks.
* Writing modules that aren't portable between Node.js and AMD also sucks.
* Writing monolithic code (and not using modules) is perhaps worst of all, and
* should be punishable by death.
*
* UMD stands for Universal Module Definition (https://github.com/umdjs/umd)
* and provides boiler plate to create modules that work anywhere - but it's
* bulky.
*
* Here's a minimal implementation which makes certain assumptions about
@junosuarez
junosuarez / data.js
Created November 2, 2012 19:26
dummy data jsonp
This file has been truncated, but you can view the full file.
makeData(function () { return {
"foo" : [
{
"id" : 0,
"bar" : true,
"baz" : "P. White",
"bday" : "10/05/2005"
},
{
"id" : 1,
/usr/local/lib/node_modules/cardinal/bin/cdl.js:11
opts.theme = theme;
^
TypeError: Cannot set property 'theme' of undefined
at Object.<anonymous> (/usr/local/lib/node_modules/cardinal/bin/cdl.js:11:12)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.runMain (module.js:492:10)
@junosuarez
junosuarez / top 1000
Created November 17, 2012 11:27
common english words which aren't npm modules yet
in
was
the
of
her
and
his
he
you
for
@junosuarez
junosuarez / .bash_profile
Created November 30, 2012 22:21
.bash_profile
export PATH=$PATH:/usr/local/sbin:~/bin:/Users/jaso/nvm/v0.8.8/bin
#alias todo=`s ~/Dropbox/todo.txt`
. ~/nvm/nvm.sh
# {{{
# Node Completion - Auto-generated, do not touch.
shopt -s progcomp
for f in $(command ls ~/.node-completion); do
f="$HOME/.node-completion/$f"
test -f "$f" && . "$f"
done
@junosuarez
junosuarez / gist:4254766
Created December 11, 2012 00:51
bike hax parts list
* raspberry pi
* easyacc 12000 mAh usb battery pack - http://www.amazon.com/gp/product/B008YRG5JQ/ref=oh_details_o00_s01_i01
* globalsat BU-353 USB GPS receiver - http://www.amazon.com/gp/product/B000PKX2KA/ref=oh_details_o03_s00_i01
* edimax ew-7811Un wifi usb module - http://www.amazon.com/gp/product/B005CLMJLU/ref=oh_details_o03_s00_i02
@junosuarez
junosuarez / gist:4256134
Created December 11, 2012 05:33
box size
function boxSize($el) {
var box = {};
box.width = $el.width();
box.height = $el.height();
_.forEach(['margin', 'padding'], function (prop) {
box[prop] = {};
_.forEach(['top','left','bottom','right'], function (dir) {
///<reference path="../d.ts/node-0.8.d.ts" />
import http = module('http')
http.createServer((req, res) => {
res.write('hello!')
res.end()
})