Skip to content

Instantly share code, notes, and snippets.

Andreas Madsen AndreasMadsen

Block or report user

Report or block AndreasMadsen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
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 /
Last active Nov 2, 2019
Playing with smartos
TooTallNate /
Last active Oct 8, 2015
Forward port 80 traffic from to port 3000 at bootup on OS X

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

$ sudo -s
$ curl -L > /Library/LaunchDaemons/fwd-80-to-3000.plist
$ reboot
AndreasMadsen / gist:2693051
Created May 14, 2012
base64 shim [atob, btoa]
View gist:2693051
// Source:
/* Copyright (C) 1999 Masanao Izumo <>
* Version: 1.0
* LastModified: Dec 25 1999
* This library is free. You can redistribute it and/or modify it.
* Interfaces:
  • [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 result.txt
{ SIGUSR2: { died: true, message: 'exit emitted' },
SIGUSR1: { died: false, message: 'not emitted' },
{ 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 / mouse.js
Created Jan 30, 2012
Enable "mouse reporting" with Node.js
View mouse.js
// Based on:
process.stdin.on('data', function (b) {
var s = b.toString('utf8');
if (s === '\u0003') {
You can’t perform that action at this time.