Skip to content

Instantly share code, notes, and snippets.

View wavded's full-sized avatar
🐢
Turtles all the way

Marc Harter wavded

🐢
Turtles all the way
View GitHub Profile
awk 'match($0, "layouts:") == 1 { print $0 }' test.yaml | wc -l
sed '/layouts:/ i\ - !dnsMatch\n host: HI THERE\n' test.yaml | head -n 100
@wavded
wavded / gist:3373385
Created August 16, 2012 20:27
/etc/locale.conf
LANG=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
LC_NUMERIC=en_US.UTF-8
LC_TIME=en_US.UTF-8
LC_COLLATE=en_US.UTF-8
LC_MONETARY=en_US.UTF-8
LC_MESSAGES=en_US.UTF-8
LC_PAPER=en_US.UTF-8
LC_NAME=en_US.UTF-8
@wavded
wavded / test.json
Created August 14, 2012 17:06
Test
[ { "name": "Marc"
, "quote": "Intern! My cube needs to be GC'ed!" }
, { "name": "George Carlson"
, "quote": "I don't read documentation, I just try random parameters..." }
, { "name": "Jon Kelly"
, "quote": "Sometimes a man needs a lot of chips" }
, { "name": "Myles Steinhauser"
, "quote": "I start with the toilet first" }
, { "name": "Kathy Nelson"
, "quote": "I googled you, didn't you get my google?" }
Handle<Value> Method(const Arguments &args) {
HandleScope scope;
return scope.Close(Undefined());
}
// are these doing the same thing?
Handle<Value> Method(const Arguments &args) {
HandleScope scope;
}
void Socket::Init(Handle<Object> target) {
HandleScope scope;
Local<FunctionTemplate> t = FunctionTemplate::New(New);
t->SetClassName(String::NewSymbol("Socket"));
t->InstanceTemplate()->SetInternalFieldCount(1);
t->InstanceTemplate()->SetAccessor(String::NewSymbol("state"), GetState, NULL);
SetPrototypeMethod(t, "bind", Bind);
SetPrototypeMethod(t, "bindSync", BindSync);
var cookie = require('cookie')
var connectUtils = require('connect').utils
// ----
io.set('authorization', function (data, ack) {
var cookies = cookie.parse(data.headers.cookie)
var signedCookies = connectUtils.parseSignedCookies(cookies, 'YOUR SECRET')
redisSession.get(signedCookies['connect.sid'], function (err, sess) {
data.session = sess
@wavded
wavded / blamda.js
Created January 25, 2012 18:55
block-lambda would be nice
var OrderManager = {
getRecordById: function (id) {
function gridCheck (TypeOrder) {
if (TypeOrder != null) {
var record = TypeOrder.getGrid().store.getById(id)
if (record) {
return { // would like the parent function to exit here (but ain't gonna happen)
record: record,
grid: TypeOrder.getGrid()
@wavded
wavded / gotchas.coffee
Created January 24, 2012 04:02
CoffeeScript gotchas
# Overall I like CoffeeScript, but these have bitten me.
# 1.
if cat is not "fluffy" # means if cat is false
# 2.
a = i for i in [1,2,3] # 3
b =
c: i for i in [1,2,3] # [1,2,3]
@wavded
wavded / .gitignore
Created January 11, 2012 18:29
.gitignore for checked in modules in npm
node_modules/**/build
node_modules/**/out
node_modules/**/.lock-wscript
npm_debug.log
@wavded
wavded / gist:1515551
Created December 23, 2011 22:29
Installing MongoDB on Ubuntu Server and Desktop

Edit /etc/apt/sources.list and add the following lines to the bottom of the file:

# MongoDB
deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen

Then run the following commands: