Skip to content

Instantly share code, notes, and snippets.

View perry-mitchell's full-sized avatar

Perry Mitchell perry-mitchell

View GitHub Profile

Keybase proof

I hereby claim:

  • I am perry-mitchell on github.
  • I am perrymitchell (https://keybase.io/perrymitchell) on keybase.
  • I have a public key ASAT5ktEnnlyXr6Bf22lUsboAkqfS-jZuaMMvmdrh7qpXgo

To claim this, I am signing this object:

function promiseAllTimeout(promises, timeout, resolvePartial=true) {
return new Promise(function(resolve, reject) {
let results = [],
finished = 0,
numPromises = promises.length;
let onFinish = function() {
if (finished < numPromises) {
if (resolvePartial) {
(resolve)(results);
} else {
@perry-mitchell
perry-mitchell / imgcat_remote
Created February 20, 2016 13:32
Remote download (wget) of images for printing
#!/bin/bash
# adapted from: https://raw.githubusercontent.com/gnachman/iTerm2/master/tests/imgcat
# tmux requires unrecognized OSC sequences to be wrapped with DCS tmux;
# <sequence> ST, and for all ESCs in <sequence> to be replaced with ESC ESC. It
# only accepts ESC backslash for ST.
function print_osc() {
if [[ $TERM == screen* ]] ; then
printf "\033Ptmux;\033\033]"