This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
import sys | |
import getopt | |
from sys import stderr | |
import boto.ec2 | |
import boto.rds |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl -w | |
# | |
# This program is meant to help me focus, by blocking timewasting sites in /etc/hosts. | |
# | |
# If the program is invoked with 'focus on', a section will be added to the /etc/hosts file | |
# routing requests for the domains in __DATA__ to localhost. | |
# | |
# If the program is invoked with 'focus off', that section is removed. | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// promisey foreach loop | |
'use strict'; | |
var Promise = require('bluebird'), | |
promiseWhile = require('./promiseWhile'); | |
/** | |
* Promisey foreach | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* postgres does not have replace into, so... | |
* | |
* @param {Object} tile specification {tx: ty: zoom:} | |
* @param {Object} quad properties of that tile | |
* @param {Knex.transaction} t database transaction | |
* @return {Promise} | |
*/ | |
function insertOrUpdateTile(tile, quad, t) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* { | |
-webkit-filter: grayscale(100%) !important; | |
background-color: white !important; | |
border-color: black !important; | |
color: black !important; | |
font-family: "redacted script" !important; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var Q = require('q'); | |
// `condition` is a function that returns a boolean | |
// `body` is a function that returns a promise | |
// returns a promise for the completion of the loop | |
function promiseWhile(condition, body) { | |
var done = Q.defer(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var when = require('when'), | |
delay = require('when/delay'), | |
unfold = require('when/unfold'); | |
function getNumber() { | |
var deferred = when.defer(); | |
deferred.resolve(Math.floor(Math.random() * 10)); | |
return deferred.promise; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# SSH into a Vagrant VM, forwarding ports in a way that allows node within Vagrant to be debugged by a debugger | |
# or IDE in the host operating system. Don't know why, but Vagrantfile port forwarding does not work. | |
# (https://groups.google.com/forum/#!topic/vagrant-up/RzPooJ0dp6Q) | |
/usr/bin/vagrant ssh-config > $TMPDIR/vagrant-ssh-config | |
ssh -F $TMPDIR/vagrant-ssh-config -L 5858:127.0.0.1:5858 default | |
rm $TMPDIR/vagrant-ssh-config |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sign up | |
account.signUp('[email protected]', 'secret'); | |
// sign in | |
account.signIn('[email protected]', 'secret'); | |
// sign in via oauth | |
account.signInWith('twitter'); | |
// sign out |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Worker = require('webworker-threads').Worker; | |
var worker = new Worker('bin/testWorker.js'); | |
var workerSend; | |
(function() { | |
var idCounter = 0; | |
var callbacks = {}; | |
worker.onmessage = function(oEvent) { | |
var message = oEvent.data; |