This file contains 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 swig = require('swig'); | |
var assert = require('assert'); | |
swig.invalidateCache(); | |
var failingTemplate = '{% for child in model.getRoot().getChildren() %}{{ child.getName() }}{% endfor %}'; | |
var workingTemplate = '{% for child in model.getChildren() %}{{ child.getName() }}{% endfor %}'; | |
var expected = 'child'; | |
function Model(name, children) { |
This file contains 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 | |
trap "kill $GULPPID && trap - SIGINT" SIGINT && gulp & GULPPID=$! & bundle exec jekyll serve |
This file contains 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
# install homebrew | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
# install cscreen | |
brew cask install cscreen | |
# list displays | |
cscreen -l | |
# find your external screen in the list and write the number (not the ID) down somewhere | |
# in the following instructions, use that number instead of <SCREEN> |
This file contains 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
/** | |
* Execute `work`, retrying up to `retries` times with exponential backoff starting at `delay` ms | |
* @param {() => Promise} work work to perform. | |
* @param {number} [retries=5] number of retries before failing. | |
* @param {number} [delay=250] initial retry delay in milliseconds, increased exponentially for every try. | |
*/ | |
export async function retry(work, retries = 5, delay = 250) { | |
for (let tries = 0; tries < retries; tries++, delay *= 2) { | |
try { | |
return await work() |