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
const fs = require('fs'); | |
const glob = require('glob'); | |
/** | |
* Find files | |
* @param {String} globPattern | |
* @returns {Promise<String[]>} | |
*/ | |
function findFiles(globPattern) { | |
return new Promise((resolve, reject) => { |
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
// Based on <https://blog.bearer.sh/http-api-instrumentation-nodejs/> | |
const http = require('http') | |
const https = require('https') | |
const { URL } = require('url') | |
const Metrics = require('metrics') | |
const { performance } = require('perf_hooks') | |
const metrics = {} | |
const metricTypes = { |
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 | |
SOURCE_FILES=($(find public/*.{js,css,gz,br,map} 2>/dev/null)) | |
DESTINATION_BUCKET="hashed-assets-eu" | |
DESTINATION_FOLDER="page-kit" | |
for FILE in ${SOURCE_FILES[@]}; do | |
if [[ $FILE == *".gz" ]]; then |
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
const nodeFetch = require('node-fetch'); | |
const httpsAgent = require('./httpsAgent'); | |
const handleResponse = require('./handleResponse'); | |
module.exports = async (url, options = {}) => { | |
const response = await nodeFetch(url, { | |
...options, | |
agent: httpsAgent | |
}); | |
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
(function (global, factory) { | |
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | |
typeof define === 'function' && define.amd ? define(['exports'], factory) : | |
(global = global || self, factory(global.hyperons = {})); | |
}(this, function (exports) { | |
'use strict'; | |
/** | |
* Base Component class | |
* @param {object} props The initial component props |
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
.highlight { background: #282A3A; color: #EAF2F1 } | |
.ge { font-style: italic } // Generic.Emph | |
.gs { font-weight: bold } // Generic.Strong | |
.gi { color: #BAD761 } // Generic.Inserted | |
.gd { color: #FF657A } // Generic.Deleted | |
.err { color: #FF657A } // Error | |
.nc, // Name.Class |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Preact Compat onChange normalization</title> | |
</head> | |
<body> | |
<div id="app"></div> | |
<script src="dist/main.js"></script> | |
</body> |
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
'use strict' | |
const CLASSNAME_WAITING = 'is-waiting' | |
const CLASSNAME_LOADING = 'is-loading' | |
const CLASSNAME_PREROLL = 'is-preroll' | |
const CLASSNAME_PLAYING = 'is-playing' | |
const CLASSNAME_PROBLEM = 'is-problem' | |
// <https://developers.google.com/interactive-media-ads/docs/sdks/html5/sdk-player> | |
function ads (target) { |
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
module.exports = function (buttons, target, callback) { | |
buttons = buttons.length === undefined ? [ buttons ] : Array.from(buttons); | |
const toggle = function (e) { | |
const state = target.classList.toggle('is-active'); | |
buttons.forEach(button => { | |
button.setAttribute('aria-expanded', state); | |
}); |
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
'use strict' | |
const ExtractTextPlugin = require('extract-text-webpack-plugin') | |
module.exports = { | |
entry: { | |
'./public/main.css': './src/styles.scss' | |
}, | |
output: { | |
filename: '[name]' |
NewerOlder