Skip to content

Instantly share code, notes, and snippets.

@weilu
weilu / Cheffile
Last active December 18, 2015 09:39 — forked from neo-common/Cheffile
site 'http://community.opscode.com/api/v1'
cookbook 'sprout-osx-base',
:git => 'git://github.com/pivotal-sprout/sprout.git',
:path => 'sprout-osx-base'
cookbook 'pivotal_workstation',
:git => 'git://github.com/pivotal-sprout/sprout.git',
:path => 'pivotal_workstation'

The Problem

Standard practices say no non-root process gets to talk to the Internet on a port less than 1024. How, then, could I get Node talking on port 80 on EC2? (I wanted it to go as fast as possible and use the smallest possible share of my teeny tiny little micro-instance's resources, so proxying through nginx or Apache seemed suboptimal.)

The temptingly easy but ultimately wrong solution:

Alter the port the script talks to from 8000 to 80:

}).listen(80);
@weilu
weilu / README.md
Created November 28, 2013 03:47 — forked from melekes/README.md

Yet another Google Calendar Dashing widget

Yet another Google Calendar Dashing widget

Description

Dashing widget to display first two coming-up Google Calendar events.

Basically, you do not need more than two events on your dashboard, but it can be easily extended to the neighboring cells and show, say, 4 events instead of 2.

@weilu
weilu / 0_reuse_code.js
Created March 18, 2014 05:42
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console