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 compose = (...fns) => fns.reduce((f, g) => (...args) => f(g(...args))) |
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
// http://michalbe.blogspot.com.br/2013/03/javascript-less-known-parts-bitwise.html | |
// http://jsperf.com/bitwise-vs-math-object | |
// http://united-coders.com/christian-harms/results-for-game-for-forfeits-and-the-winner-is/ | |
// https://mudcu.be/journal/2011/11/bitwise-gems-and-other-optimizations/ | |
// https://dreaminginjavascript.wordpress.com/2009/02/09/bitwise-byte-foolish/ | |
// http://jsperf.com/math-min-max-vs-ternary-vs-if/24 | |
"use strict"; | |
var PI = Math.PI; |
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
// This is to list all events on the page: | |
[].slice.call(document.querySelectorAll('*')) | |
.map(el => ({ el, listeners: Object.entries(getEventListeners(el)) })) | |
.filter(el => el.listeners.length) | |
// Use with a mutationobserver to confirm that events are detaching: | |
const _getEventListeners = getEventListeners | |
const getAll = () => [].slice.call(document.querySelectorAll('*')) | |
.map(el => ({ el, listeners: Object.entries(_getEventListeners(el)) })) | |
.filter(el => el.listeners.length) |
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
/** | |
* Example usage: | |
log.warn`Some message with ${variables} highlighted`; | |
log.blue`Some message everything highlighted`; | |
log.info`Some message with ${variables} highlighted`; | |
log.blueBG`Some message everything highlighted`; | |
*/ | |
const colours = { | |
reset: '\x1b[0m', |
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
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.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
"babel-cli": "latest", | |
"babel-core": "latest", | |
"babel-eslint": "latest", | |
"babel-plugin-external-helpers": "latest", | |
"babel-plugin-styled-components": "latest", | |
"babel-plugin-transform-object-rest-spread": "latest", | |
"babel-preset-env": "latest", | |
"babel-preset-flow": "latest", | |
"babel-preset-react": "latest", | |
"eslint-plugin-flowtype-errors": "latest", |
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
// @flow | |
export const renders: Array<Function> = [] | |
let animId: AnimationFrameID | |
export default ((): void => { | |
if (typeof window === 'undefined') { | |
return | |
} | |
const stop = () => window.cancelAnimationFrame(animId) |
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
root = true | |
[*] | |
end_of_line = lf | |
insert_final_newline = true | |
trim_trailing_whitespace = true | |
charset = utf-8 | |
indent_style = space | |
indent_size = 2 |
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
// Pretend this is in a store somewhere. | |
const pageData = { | |
title: 'My Data', | |
copy: 'Lorem ipsum dolar sit amet', | |
fields: { | |
testimonial: { | |
name: 'Bob Ross', | |
copy: 'Everything is amazing' | |
}, | |
rating: 5 |
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
/** WARNING - USE AT OWN RISK */ | |
/** IT IS AGAINST APPLE'S POLICY TO USE SF PRO FOR ANYTHING OTHER THAN iOS/tvOS/macOS/watchOS DESIGN & DEVELOPMENT */ | |
/** https://sf.abarba.me/LICENSE.pdf */ | |
/** 1. Copy/import this file into your main css/scss file */ | |
/** 2. Change css font-family: to "SF Text", "SF Display" or "SF Mono" */ | |
/** 3. Apply font-weight or italic to html elements */ | |
/** THANK YOU */ | |
/** I host these fonts on Cloudfront with SSL in all AWS regions for the best performance and reliability */ |