Skip to content

Instantly share code, notes, and snippets.

View indexzero's full-sized avatar
🌎
Always bet on Open Source

Charlie Robbins indexzero

🌎
Always bet on Open Source
View GitHub Profile
@indexzero
indexzero / nyc-food-tour.md
Last active October 8, 2016 21:38
A random collection of suggestions from random people on the random Internet

Mexican / Tex-mex

Tacos from Guero's off Franklin. (Fried avocado and jalapeño taco)

Taqueria de Los Muertos- Prospect Heights

Baby Bo's Burritos on 2nd Avenue around 36th Street. Massive margaritas and great Tex-Mex.

Cajun

Cajun: catfish on Bedford Ave. They do giant bloody Mary's with shrimp and hurricanes in hurricane glasses. And they do oysters by the dozen and po boys.

@indexzero
indexzero / extends.js
Last active September 27, 2016 18:31
Implicit constructors do call super() in ES6 classes
'use strict';
class AbstractClass {
constructor() {
this.foo = 'foo';
}
}
class DerivedClass extends AbstractClass {
@indexzero
indexzero / hack-console.js
Created December 17, 2015 13:00
Fun with hacking console.log in node@4
'use strict';
//
// Attempt #1: Overwrite the log method on the Console
// prototype exposed by node.
//
// !!FAILED!!
//
// var Console = require('console').Console;
//
@indexzero
indexzero / styleguide.md
Last active June 27, 2016 21:29
A working draft of an "official" Nodejitsu Javascript style guide.

Javascript Styleguide

If you have comments on this or disagree about rules then please reach out to me directly. I want to hear it!

Table of Contents

Basics

@indexzero
indexzero / graphite-proxy.js
Last active April 28, 2016 09:11
Basic proxy to Graphite
var httpProxy = require('http-proxy');
var re = /\/graphite(\/.*)/;
httpProxy.createServer(function (req, res, proxy) {
var match;
if ((match = re.exec(req.url))) {
console.log('Rewriting req.url to ' + match[1]);
req.url = match[1];
@indexzero
indexzero / cocoa-hello-world2.js
Created September 8, 2011 18:33 — forked from TooTallNate/cocoa-hello-world2.js
Creating a Cocoa GUI window with NodObjC, with a proper Menu, dock icon, and NSApplicationDelegate.
// This example adapted from Matt Gallagher's "Minimalist Cocoa Programming"
// blog article:
// http://cocoawithlove.com/2010/09/minimalist-cocoa-programming.html
var $ = require('NodObjC')
$.import('Cocoa')
var pool = $.NSAutoreleasePool('alloc')('init')
, app = $.NSApplication('sharedApplication')
@indexzero
indexzero / http-agent.js
Created June 6, 2011 02:11
Code samples from the "jsdom and jquery" article on the Nodejitsu blog
var httpAgent = require('http-agent'),
util = require('util');
var agent = httpAgent.create('www.google.com', ['finance', 'news', 'images']);
agent.addListener('next', function (err, agent) {
console.log('Body of the current page: ' + agent.body);
console.log('Response we saw for this page: ' + util.inspect(agent.response));
// Go to the next page in the sequence
@indexzero
indexzero / .eslintconfig.json
Last active March 12, 2016 06:55
Demonstration of a subtle ESLint parser conflict with "prefer-const"
{
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
},
"rules": {
"prefer-const": 2
}
}

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@indexzero
indexzero / remote-download.js
Created January 3, 2014 02:59
A simple remote download script for pkgcloud and rackspace
var fs = require('fs'),
zlib = require('zlib'),
tar = require('tar'),
pkgcloud = require('pkgcloud'),
argv = require('optimist').argv;
var client = pkgcloud.storage.createClient({
provider: argv.p,
username: argv.u,
apiKey: argv.k