Skip to content

Instantly share code, notes, and snippets.

View andybee's full-sized avatar

Andy Buckingham andybee

View GitHub Profile
@andybee
andybee / Pool.js
Last active February 17, 2022 18:35
Simple Pool for executing a maximum number of concurrent Javascript task functions requested ad-hoc with support for Promises
/**
* Limits the number of concurrent pending Promises. When the limit is reached,
* further requests are queued until the number of concurrent requests drops.
*/
export default class Pool {
constructor(maxConcurrentPendingPromises) {
this.queue = [];
this.maxConcurrentPendingPromises = maxConcurrentPendingPromises;
this.numConcurrentPendingPromises = 0;
}
@andybee
andybee / pre-commit-eslint
Created August 10, 2017 11:25
Pre-commit hook for linting JS with ESLint before committing
#!/bin/sh
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -v "^node_modules/" | grep ".jsx\{0,1\}$")
ESLINT="$(git rev-parse --show-toplevel)/node_modules/.bin/eslint"
if [[ "$STAGED_FILES" = "" ]]; then
exit 0
fi
PASS=true
@andybee
andybee / parse.py
Created January 1, 2016 15:23
Script to parse VM Superhub status page HTML in to CSV
#!/usr/bin/env python
from os import listdir
from os.path import isfile, join, splitext
import csv
from BeautifulSoup import BeautifulSoup
PATH = '.'
@andybee
andybee / keybase.md
Last active September 3, 2016 08:28
Proving my identity on GitHub for Keybase

Keybase proof

I hereby claim:

  • I am andybee on github.
  • I am andybee (https://keybase.io/andybee) on keybase.
  • I have a public key whose fingerprint is 2DD3 ED01 8327 711A C1DB 1F1A 30B7 B098 C879 490F

To claim this, I am signing this object: