This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
user www-data; | |
worker_processes 4; | |
error_log /var/log/nginx/error.log; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} |
I've done the same process every couple years since 2013 (Mountain Lion, Mavericks, High Sierra, Catalina) and I updated the Gist each time I've done it.
I kinda regret for not using something like Boxen (or anything similar) to automate the process, but TBH I only actually needed to these steps once every couple years...
docker run -rm -t -i -v $(dirname $SSH_AUTH_SOCK) -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK ubuntu /bin/bash |
// first paint in chrome from https://github.com/addyosmani/timing.js | |
var hasFirstPaint = 0; | |
if (window.chrome && window.chrome.loadTimes) { | |
var paint = window.chrome.loadTimes().firstPaintTime * 1000; | |
var firstPaint = paint - (window.chrome.loadTimes().startLoadTime*1000); | |
var firstPaintLeft = (firstPaint / loaded)*100; | |
hasFirstPaint = 1; | |
} |
'use strict'; | |
module.exports = function CustomError(message, extra) { | |
Error.captureStackTrace(this, this.constructor); | |
this.name = this.constructor.name; | |
this.message = message; | |
this.extra = extra; | |
}; | |
require('util').inherits(module.exports, Error); |
An IAM user policy document to give minimal rights for deploying an Elastic Beanstalk application.
Where:
REGION
: AWS region.ACCOUNT_ID
: AWS account ID.APPLICATION_NAME
: Desired target Elastic Beanstalk application name(space).IAM_INSTANCE_PROFILE_ROLE
: The instance profile (IAM role) Elastic Beanstalk EC2 instaces will run under.#!/bin/bash -e | |
LINE_BREAK="======================================" | |
REQUEST_HEADERS="Content-Type" | |
REQUEST_METHOD="GET" | |
function exitError { | |
echo "Error: $1" >&2 |
import { expect } from 'chai'; | |
import jsdom from 'jsdom'; | |
describe('JSDOM', () => { | |
it('should communicate with inner iframes', done => { | |
jsdom.env({ | |
url: "http://bar.com/", | |
done (err, window) { | |
var frame = window.document.createElement('iframe'); | |
window.document.body.appendChild(frame); |