Skip to content

Instantly share code, notes, and snippets.

Avatar

Andreas Madsen AndreasMadsen

View GitHub Profile
View result.txt
{ SIGUSR2: { died: true, message: 'exit emitted' },
SIGUSR1: { died: false, message: 'not emitted' },
SIGINFO:
{ died: false,
message: 'signal not supported' },
SIGWINCH: { died: false, message: 'not emitted' },
SIGPROF: { died: true, message: 'exit emitted' },
SIGVTALRM: { died: true, message: 'exit emitted' },
SIGXFSZ: { died: true, message: 'exit emitted' },
SIGXCPU: { died: true, message: 'exit emitted' },
@TooTallNate
TooTallNate / README.md
Last active Oct 8, 2015
Forward port 80 traffic from 127.0.0.1 to port 3000 at bootup on OS X
View README.md

Copy this file to: /Library/LaunchDaemons/fwd-80-to-3000.plist and then reboot:

$ sudo -s
$ curl -L https://gist.github.com/TooTallNate/3372589/raw/ace6451e9e47f59550f12d09cb924a64531cfd1f/fwd-80-to-3000.plist > /Library/LaunchDaemons/fwd-80-to-3000.plist
$ reboot
View starred-gists.md
  • [Why you don't need Meteor][20]
  • [Shim status of ES6][1]
  • [unshimmable subset of ES5][2]
  • [Host objects][3]
  • [Why you don't need jQuery][4]
  • [All the DOM recursion you'll ever need][5]
  • [The heart of pd][6]
  • [jQuery library critique][7]
  • [klass][8]
  • [tiny select][9]
View gist:4294d5c212a6d2254703

From Fabrice Bellard, with minor name change (umulh):

// return the high 32 bit part of the 64 bit addition of (hi0, lo0) and (hi1, lo1)
Math.iaddh(lo0, hi0, lo1, hi1)

// return the high 32 bit part of the 64 bit subtraction of (hi0, lo0) and (hi1, lo1)
Math.isubh(lo0, hi0, lo1, hi1)

// return the high 32 bit part of the signed 64 bit product of the 32 bit numbers a and b
@AndreasMadsen
AndreasMadsen / WhatIHaveDone.md
Last active Nov 2, 2019
Playing with smartos
View WhatIHaveDone.md
@TooTallNate
TooTallNate / mouse.js
Created Jan 30, 2012
Enable "mouse reporting" with Node.js
View mouse.js
// Based on:
// http://groups.google.com/group/nodejs-dev/browse_thread/thread/a0c23008029e5fa7
process.stdin.resume();
process.stdin.on('data', function (b) {
var s = b.toString('utf8');
if (s === '\u0003') {
console.error('Ctrl+C');
process.stdin.pause();
@AndreasMadsen
AndreasMadsen / gist:2693051
Created May 14, 2012
base64 shim [atob, btoa]
View gist:2693051
// Source: http://code.google.com/p/gflot/source/browse/trunk/flot/base64.js?r=153
/* Copyright (C) 1999 Masanao Izumo <iz@onicos.co.jp>
* Version: 1.0
* LastModified: Dec 25 1999
* This library is free. You can redistribute it and/or modify it.
*/
/*
* Interfaces:
You can’t perform that action at this time.