Skip to content

Instantly share code, notes, and snippets.

View emkay's full-sized avatar

Michael Matuzak emkay

View GitHub Profile
function willNotInline() {
/*
--------------------------------------------------------------------------
--------------------------------------------------------------------------
--------------------------------------------------------------------------
--------------------------------------------------------------------------
--------------------------------------------------------------------------
--------------------------------------------------------------------------
--------------------------------------------------------------------------
--------------------------------------------------------------------------
@emkay
emkay / nesly-split-example.js
Created November 3, 2013 04:14
nesly split example
var neslySplit = require('nesly-split');
var fs = require('fs');
var s = fs.createWriteStream('mario.chr');
neslySplit('smb.nes', function (err, data) {
if (!err) {
s.write(data.chr);
}
});
@emkay
emkay / seaport-proxy-hutch.md
Created January 17, 2013 00:41
DevOps Day Lightening talk proposal

Setting up an HTTP proxy with node and hutch

hutch is a small program that takes a config.json file and spins up a proxy server that takes care of all your sites. It uses seaport to manage your ports automatically, and http-proxy to proxy all your requests to various servers. Because seaport uses semvers, you can place different versions and roles of the same server in your config.json without having to worry about port numbers.

The real magic is seaport and http-proxy. hutch just allows you to use them together.

@emkay
emkay / gist:3855333
Created October 8, 2012 22:18
LA Open Source Hackathon
=====
On November 4th we are organizing an LA Open Source Hackathon. This is an event for coders interested in contributing to open source projects. We are reaching out to ask if members of your groups would like to attend or to host a group table to sprint on the project of your choice.
The event costs $10 dollars, which goes toward food and drinks throughout the day.
The deal:
* We provide tight security to keep the "idea guys", "idea gals", "looking for a technical co-founder" folks and other distractions out.
* We provide food
- Light breakfast (bagels or something along those lines)
@emkay
emkay / handlebars-test.js
Created April 19, 2012 20:53
YUI Handlebars Server Side
var YUI = require('yui').YUI;
YUI().use('handlebars', function (Y) {
var template = Y.Handlebars.compile('<p>{{name}}</p>');
var html = template({ name: 'Mike'});
console.log(html);
});
@emkay
emkay / april-26-2012.md
Created April 14, 2012 23:09 — forked from jxson/april-26-2012.md
js.la | April 26th, 2012 - Santa Monica

Hello Everyone,

We have joined forces with the folks behind the Santa Monica socaljs group on meetup.com, April's event will be in Santa Monica for those of you that don't like battling traffic out to the east side ;)

We are still working out the details but wanted to let you know what we are working on.

April 26th, 2012 - Santa Monica

7pm, with talks starting at 7:20p - 7:30p

@emkay
emkay / for-loop.js
Created November 17, 2011 23:02
For Loops
var a = ['cat', 'dog', 'pig', 'bird'];
// works, but you are accessing the a.length property every time.
for (var i = 0; i < a.length; i += 1) {
console.log(a[i]);
}
// better because it is caching length, especially for DOM collections
for (var i = 0, len = a.length; i < len; i += 1) {
console.log(a[i]);
@emkay
emkay / inheritance.js
Created November 17, 2011 21:43
Inheritance
// use Person as a constructor
function Person(name, age) {
this.name = name;
this.age = age;
}
var student = new Person('mike', 29);
Person.prototype.sayHello = function () {
alert('Hello my name is ' + this.name);
@emkay
emkay / ajax.js
Created November 17, 2011 19:30
Ajax Example
var button, button2, button3;
var i, xhr, activeXids = [
'MSXML2.XMLHTTP.3.0',
'MSXML2.XMLHTTP',
'Microsoft.XMLHTTP'
];
if (typeof XMLHttpRequest === "function") {
xhr = new XMLHttpRequest();
} else {
@emkay
emkay / array_methods.js
Created November 14, 2011 04:33
Array Methods
var a = []; // empty array
a.push('a', 'b', 'c', 'd', 'e'); // ["a", "b", "c", "d", "e"]
a.pop(); // ["a", "b", "c", "d"]
a.reverse(); // ["d", "c", "b", "a"]
var s = a.join('');