https://www.smashingmagazine.com/2019/03/robust-layouts-container-units-css/
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
'use strict'; | |
import Singleton from 'Singleton'; | |
class ClassA extends Singleton { | |
constructor() { | |
super(); | |
} | |
singletonMethod1() { | |
// ... |
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
cd ~/personal/watch-faces | |
ws -z --key ~/personal/ssl-certs/local.dev+1-key.pem --cert ~/personal/ssl-certs/local.dev+1.pem | |
https://api.facer.io/parse/functions/isAdmin | |
true | |
https://api.facer.io/parse/functions/getWatchface | |
"allowInspection": 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
Drop in replace functions for setTimeout() & setInterval() that | |
make use of requestAnimationFrame() for performance where available | |
http://www.joelambert.co.uk | |
Copyright 2011, Joe Lambert. | |
Free to use under the MIT license. | |
http://www.opensource.org/licenses/mit-license.php |
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
/* | |
You need node 6.9 or later. | |
Run with: | |
node redux-mini.js --harmony | |
Want a more in depth explanation of how things works? Read the blog post I have written about it here: | |
http://blog.jakoblind.no/2017/03/13/learn-redux-by-coding-a-mini-redux/ | |
*/ | |
/* |
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
/** | |
* isOverlapping() returns the overlapping status between two elements | |
* based on the passed in Element objects | |
* | |
* @param {Element, Element} Element object of DOM | |
* @return {Boolean|null} overlap status or null if native objet not received | |
*/ | |
function isOverlapping(e1, e2){ | |
if( e1.length && e1.length > 1 ){ | |
e1 = e1[0]; |
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
// From my boilerplate here: https://github.com/radum/webapp-boilerplate/blob/develop/src/styles/tools/_tools.z-index.scss | |
/** | |
* Check if map has nested keys | |
* @param {string} $map Key to find | |
* @param {object} $keys... Object of keys to look into | |
* @return {boolean} Return true or false if map has nested keys | |
*/ | |
@function map-has-nested-keys($map, $keys...) { | |
@each $key in $keys { |
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
Object.defineProperty(window, 'localStorage', { | |
configurable: true, | |
enumerable: true, | |
value: new Proxy(localStorage, { | |
set: function (ls, prop, value) { | |
console.log(`direct assignment: ${prop} = ${value}`); | |
debugger; | |
ls[prop] = value; | |
return true; | |
}, |
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 http2 = require('http2'); | |
const fs = require('fs'); | |
const path = require('path'); | |
const zlib = require('zlib'); | |
const brotli = require('brotli'); // npm package | |
const PORT = 3032; | |
const BROTLI_QUALITY = 11; // slow, but we're caching so who cares | |
const STATIC_DIRECTORY = path.resolve(__dirname, '../dist/'); | |
const cache = {}; |
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
// Require our core node modules. | |
var util = require( "util" ); | |
// Export the constructor function. | |
exports.AppError = AppError; | |
// Export the factory function for the custom error object. The factory function lets | |
// the calling context create new AppError instances without calling the [new] keyword. | |
exports.createAppError = createAppError; |