- Download
package.json
andsingle-preload.js
and put into same folder - Run
npm install
- Run
node single-preload.js
- Visit
http://127.0.0.1:4000/
using Safari Technology Preview 24 with the Link Preload experimental feature activated - Check the
Network
tab of the web development tools. See twostyle.css
that's loaded
This file contains hidden or 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
const fbUserAgentPattern = /\]|(?:[\;\[](?=FB|$]))/; | |
const parseFbUserAgentOptions = (input) => input.split(fbUserAgentPattern) | |
.filter(text => text.startsWith('FB')) | |
.reduce(text => { | |
const [ name, value ] = text.split('/'); | |
return { name, value }; | |
}, result); | |
const prettifyFbUserAgentOptions = (fbUserAgentOptions) => fbUserAgentOptions.map(({name, value}) => name + ': ' + value).join('\n'); |
This file contains hidden or 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
#!/usr/bin/env node | |
'use strict'; | |
// Inspired by https://github.com/acaudwell/Gource/wiki/Gravatar-Example | |
const { execSync } = require('child_process'); | |
const crypto = require('crypto'); | |
const https = require('https'); | |
const fs = require('fs'); |
This file contains hidden or 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
const bunyan = require('bunyan'); | |
const bunyanExpressSerializer = require('bunyan-express-serializer'); | |
const LogstashStream = require('./logstash-stream'); | |
const streams = [ | |
{ | |
level: 'trace', | |
type: 'raw', | |
stream: new LogstashStream(outStream) |
This file contains hidden or 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
const zipObject = function (keys, values) { | |
const result = {}; | |
keys.forEach((key, i) => { | |
result[key] = values[i]; | |
}); | |
return result; | |
}; |
I hereby claim:
- I am voxpelli on github.
- I am voxpelli (https://keybase.io/voxpelli) on keybase.
- I have a public key whose fingerprint is 65D3 06C1 79C7 5F64 0B4F 84C2 A62A 96DF E7A1 4F5A
To claim this, I am signing this object:
This file contains hidden or 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
const stream = { | |
level: 'warn', | |
type: 'raw', | |
stream: { write: (obj) => { | |
console.log( | |
[ | |
bunyan.nameFromLevel[obj.level], | |
obj.msg, | |
obj.err ? bunyan.stdSerializers.err(obj.err).stack : false | |
] |
This file contains hidden or 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
const mochaList = require('mocha').reporters.Base.list; | |
const mochaErrorLog = function (err, title) { | |
mochaList([{ | |
err, | |
fullTitle: () => title || 'Untitled' | |
}]); | |
}; |
This file contains hidden or 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
git config --global alias.pushh '!git push $@ || terminal-notifier -message "Push failed" -title "git"' |
This file contains hidden or 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 validateInstalledDependencies = function () { | |
var readJson = require('read-package-json'); | |
var readInstalled = require('read-installed'); | |
var semver = require('semver'); | |
var packagePromise = new Promise(function (resolve, reject) { | |
readJson('package.json', function (err, data) { | |
if (err) { return reject(err); } | |
resolve(data); | |
}); |