Skip to content

Instantly share code, notes, and snippets.

View olalonde's full-sized avatar

Oli olalonde

View GitHub Profile
@olalonde
olalonde / generic-pool.js
Created August 10, 2016 21:43
Generic resource pool
const debug = initDebug('generic-pool')
const removeResource = (arr, resource) => {
const index = arr.findIndex((ele) => ele.resource === resource)
return arr.splice(index, 1)[0]
}
/**
* getResource: promise return function, called on acquire
* max (optional): total maximum resources in pool
@olalonde
olalonde / deis-v1-to-v2-cheatsheet.md
Last active May 10, 2017 02:53
Deis v1 to v2 cheatsheet

Deis v1 to v2 cheatsheet

Warning: those are personal not, can't guarantee they are correct!

alias kd="kubectl --namespace=deis"

Table of Contents

/**
* This module is used to implement server side rendering
* with async http requests
*/
import ReactDOM from 'react-dom/server'
// TODO
// export default waitKey = '@@wait'
@olalonde
olalonde / docker-machine-use-nfs.sh
Created August 13, 2015 14:48
Use NFS instead of vboxsf in Docker Machine
#!/bin/bash
#
# This script will mount /Users in the boot2docker VM using NFS (instead of the
# default vboxsf). It's probably not a good idea to run it while there are
# Docker containers running in boot2docker.
#
# Usage: sudo ./boot2docker-use-nfs.sh
#
@olalonde
olalonde / boot2docker-use-nfs.sh
Last active December 4, 2023 12:07
Script to mount /Users with nfs instead of vboxsf in boot2docker
#!/bin/bash
#
# This script will mount /Users in the boot2docker VM using NFS (instead of the
# default vboxsf). It's probably not a good idea to run it while there are
# Docker containers running in boot2docker.
#
# Usage: sudo ./boot2docker-use-nfs.sh
#
""
"" Gist
""
let g:gist_clip_command = 'pbcopy'
@olalonde
olalonde / test
Last active August 29, 2015 14:13
# Testing
Testing vim gist!
some more
text
here
data Tree = Node Int [Tree] | Leaf Int deriving Show
add :: Tree -> Int
add (Node i []) = i
add (Leaf i) = i
add (Node i trees) = i + sum (map add trees)
var _ = require('underscore'),
inflection = require('inflection'),
path = require('path');
function join (arr) {
return path.join.apply(null, arr);
}
function map (app, context) {
context = _.extend({