Skip to content

Instantly share code, notes, and snippets.

@girvo
girvo / immutable.js
Last active August 29, 2015 14:27 — forked from kastermester/immutable.js
Flowtype definition for immutable.js
declare module "immutable" {
declare class Iterable<K, V> {
static isIterable(maybeIterable: any): boolean;
static isKeyed(maybeKeyed: any): boolean;
static isIndexed(maybeIndexed: any): boolean;
static isAssociative(maybeAssociative: any): boolean;
static isOrdered(maybeOrdered: any): boolean;
toArray(): Array<V>;
toIndexedSeq(): IndexedSeq<V>;
@girvo
girvo / device.css
Last active August 29, 2015 14:21 — forked from jsoverson/device.css
.visible-android {
display:none;
}
.visible-ios {
display:none;
}
.on-device .visible-android, .on-device .visible-android {
display:inherit;
}
.device-ios .visible-android {
@girvo
girvo / errors.js
Last active August 29, 2015 14:21 — forked from gr0uch/errors.js
// TypedError class which other typed errors subclass from.
class TypedError extends Error {
constructor (message) {
super();
if (Error.hasOwnProperty('captureStackTrace'))
Error.captureStackTrace(this, this.constructor);
else
Object.defineProperty(this, 'stack', {
@girvo
girvo / gist:3144864
Created July 19, 2012 15:51
The Withdrawal
The Withdrawal
No junkie ever goes through withdrawal willingly. Oh no, we’ll do anything we can to stave off the sickness, but it’s not something that most will understand. For a Normal person, robbing your parents and cheating your friends and burning all the bridges around you for just a “high” makes no sense... But what they can’t understand is what we’re avoiding.
William S. Burroughs described it as a “thirst”, and I quite honestly can’t find a more apt description. It’s a thirst at the most basic level; your very cells and soul cry out to be quenched. It starts innocently enough: sniffles, like the beginning of a cold. That’s just the beginning. It takes a day or so for a junkie to start to feel the thirst, the hunger. But once it’s a hold of you, the agony and terror and fear that consumes your every waking thought (and most of your unwaking thoughts too) will bring even the strongest person into a place they could never imagine.
The first time I experienced it, I was 18. My best friend had a girlf