Skip to content

Instantly share code, notes, and snippets.

View edwardhotchkiss's full-sized avatar

Edward Hotchkiss edwardhotchkiss

View GitHub Profile
@effection
effection / class-macro.js
Last active January 8, 2016 13:37 — forked from disnet/gist:5267782
Better class macro in Sweet.js
/**
* class which allows 'private' (just non-enumerable prototype object) methods and variables
*/
macro class {
case $className { constructor $constParam { $constBodyStatement... } public var {$public_vars ...} private var $private_vars $rest ... } => {
var $className = (function() {
function $className $constParam {
$public_vars ... Object.defineProperty(this, '_private_vars', { configurable: true, enumerable: false, value: $private_vars, writable: false})
@alessioalex
alessioalex / gist:3306787
Created August 9, 2012 18:24 — forked from fxsjy/gist:3291755
Memcached in JavaScript based on Node.JS
//author: Sun, Junyi (weibo.com/treapdb)
//usage: node --nouse-idle-notification --expose-gc --max-old-space-size=8192 memcached.js
var config ={
port: 11211,
max_memory: 100 // default 100M bytes
}
var net = require('net');
var LRU = function (max) { // this LRU implementaion is based on https://github.com/chriso/lru
@logicalparadox
logicalparadox / iptables.rules
Created March 20, 2012 23:44
Getting Node.js process to run on port 80 without sudo
# NAT interface routing
*nat
# Setup
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [2:128]
:OUTPUT ACCEPT [2:120]
:POSTROUTING ACCEPT [2:120]
# Redirect port 80 to port 8080
@cloudhead
cloudhead / gist:1677036
Created January 25, 2012 16:17
Go in < 140 characters

Go in < 140 characters

if err != nil {
    return
}
@mmalecki
mmalecki / analyze.js
Created January 7, 2012 23:57
A little script to analyze how many packages in `npm` have GitHub repositories
var registry = require('./registry');
console.log('Analyzing ' + registry.total_rows + ' rows');
var haveGithub = 0;
registry.rows.forEach(function (row) {
var doc = row.doc;
if (!doc['dist-tags'] || !doc['dist-tags'].latest) {
return console.error(doc.name + ' has no dist-tags');
@heapwolf
heapwolf / subjectmaterexpert.md
Created January 4, 2012 15:55
Are you a subject mater expert (wrt an open source project)

Synopsis

A metric for determining the depth of understanding required to be a subject mater expert within a particular field software engineering.

Motivation

When a person speaks about a subject with authority, how can we determine the legitimacy of that authority? Perhaps a metric can be applied that will be both fair and flexible. Consider the following tangible accomplishments and the requirements for the depth of understanding behind each one.

Tangible items

  • 100 Did you conceive/invent the subject
  • 60 Core contributor to the subject
@cloudhead
cloudhead / gist:1522576
Created December 27, 2011 02:41
Why I Don't Write Web Apps

Why I Don't Write Web Apps (if I can help it)

This is what happens when I try to pick a language.

Note: If I didn't think it was possible to create a development environment without any of these issues (which I consider "major" for the most part), I would not have written this list.

C/C++

  • NOTHNX.

Node.js

@scotu
scotu / solarized.css
Created October 8, 2011 18:27 — forked from tdreyno/solarized.css
Solarized Light Pygments CSS
.highlight { background-color: #ffffcc }
.highlight .c { color: #586E75 } /* Comment */
.highlight .err { color: #93A1A1 } /* Error */
.highlight .g { color: #93A1A1 } /* Generic */
.highlight .k { color: #859900 } /* Keyword */
.highlight .l { color: #93A1A1 } /* Literal */
.highlight .n { color: #93A1A1 } /* Name */
.highlight .o { color: #859900 } /* Operator */
.highlight .x { color: #CB4B16 } /* Other */
.highlight .p { color: #93A1A1 } /* Punctuation */
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt