Skip to content

Instantly share code, notes, and snippets.

View colinrotherham's full-sized avatar

Colin Rotherham colinrotherham

View GitHub Profile
@colinrotherham
colinrotherham / Preferences.sublime-settings
Created September 18, 2019 08:05
Sublime preferences
{
"auto_find_in_selection": true,
"binary_file_patterns":
[
"*.min.js",
"*.min.css",
"*.sql",
"*.map",
"node_modules/",
"bower_components/"
@colinrotherham
colinrotherham / save-to-pdf.mjs
Last active August 15, 2019 15:35
Save to PDF from Puppeteer
import puppeteer from 'puppeteer';
(async () => {
const browser = await puppeteer.launch();
// Open new page
const page = await browser.newPage();
// Go to website
await page.goto('http://www.red-phoenix-consulting.co.uk/', {
@colinrotherham
colinrotherham / console.log
Created December 14, 2018 14:56
NPM: npm ERR! ENFILE: file table overflow, scandir
This file has been truncated, but you can view the full file.
npx: installed 401 in 13.492s
npm info it worked if it ends with ok
npm verb cli [ '/usr/local/Cellar/node@8/8.14.0/bin/node',
npm verb cli '/Users/colin/.npm/_npx/29779/bin/npmc',
npm verb cli 'install',
npm verb cli '--force',
npm verb cli '-ddd' ]
npm info using npm@6.5.0-canary.0
npm info using node@v8.14.0
npm notice CANARY npmc is experimental software. If you find an issue, please file it in the main npm repository, and call out that you were using npmc.
@colinrotherham
colinrotherham / console.log
Last active December 14, 2018 14:44
NPM: error cb() never called
npm info it worked if it ends with ok
npm verb cli [ '/usr/local/Cellar/node@8/8.14.0/bin/node',
npm verb cli '/Users/colin/.npm-global/bin/npm',
npm verb cli 'install',
npm verb cli '--force',
npm verb cli '-ddd' ]
npm info using npm@6.6.0-next.0
npm info using node@v8.14.0
npm WARN using --force I sure hope you know what you are doing.
npm verb npm-session de4e7900b4b10bca
@colinrotherham
colinrotherham / _autocomplete.scss
Last active November 21, 2018 10:15
GOV.UK Accessible Autocomplete Sass
.autocomplete__wrapper {
position: relative;
}
.autocomplete__hint,
.autocomplete__input {
-webkit-appearance: none;
border: 2px solid;
border-radius: 0; /* Safari 10 on iOS adds implicit border rounding. */
box-sizing: border-box;
@colinrotherham
colinrotherham / greeter.js
Last active August 31, 2017 13:32
Example ES6 class
import Etiquette from './lib/etiquette';
import message from './lib/message';
class Greeter extends Etiquette {
constructor (config) {
super();
this.intro = config.intro;
this.name = config.name;
// Output raw video frames (ppm file)
gource -f -1280x720 --stop-at-end --disable-progress -e 0.006 --bloom-multiplier 0.70 --multi-sampling --auto-skip-seconds 1 --seconds-per-day 0.5 --output-ppm-stream - > ~/Desktop/filename.ppm &
// Generate video from frames
ffmpeg -f image2pipe -vcodec ppm -i ~/Desktop/filename.ppm -an -pass 1 -vcodec libx264 -b 1000000 -pix_fmt yuv420p -threads 0 ~/Desktop/filename.mp4
@colinrotherham
colinrotherham / npm-debug.log
Created June 1, 2017 13:06
Running npm@5.0.1 behind proxy with self-signed root CA certificate
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/8.0.0/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'install' ]
2 info using npm@5.0.1
3 info using node@v8.0.0
4 silly install runPreinstallTopLevelLifecycles
5 silly preinstall @scope/project-name@0.1.11
6 info lifecycle @scope/project-name@0.1.11~preinstall: @scope/project-name@0.1.11
7 silly lifecycle @scope/project-name@0.1.11~preinstall: no script for preinstall, continuing
@colinrotherham
colinrotherham / iterm-profile
Created January 6, 2017 11:28
iTerm custom profile
{
"Badge Text" : "",
"Working Directory" : "\/Users\/Colin\/Sites\/",
"Prompt Before Closing 2" : false,
"Selected Text Color" : {
"Red Component" : 0.2274509817361832,
"Color Space" : "Calibrated",
"Blue Component" : 0.294117659330368,
"Alpha Component" : 1,
"Green Component" : 0.2470588237047195