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
// Typically "debouncing" means limiting execution frequency by a specific | |
// interval while still guaranteeing that, after a call, the behavior will still | |
// execute (just not synchronously; the relationship is many->one for "calls" to | |
// "executions"). However it is sometimes desireable to not limit by a specific | |
// time — you may just want to prevent something from recurring concurrently, | |
// without concern for overall frequency. In these cases, you may instead want | |
// to debounce "against" promises. This function accepts a method that returns a | |
// promise and returns a new function that will execute that method immediately | |
// only when the last execution’s promise remains unresolved, and otherwise will | |
// queue for re-execution (once) when the current execution is complete. In all |
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
// Deliberately permissive (but fast) conversion from utf8 buffer to codepoint | |
// array. Invalid multibyte codepoint sequences become replacement character and | |
// orphaned surrogates are expressly permitted. | |
// | |
// The speed is almost identical to the built-in TextDecoder; however, it yields | |
// an array of codepoints, rather than a string. When compared as ways to get | |
// codepoints (e.g. by following TextDecoder.end with map), this runs fourteen | |
// times faster (not because TextDecoder is slow, but because x.from(str, map) | |
// is — not sure what accounts for such a big difference, though it only reaches | |
// those extremes on large files). |
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
// This module installs a custom global DOM event, 'urlchange', which is | |
// dispatched when the URL _semantically_ changes for any reason. | |
// | |
// It also alters URL behavior more generally. The URL is kept consistently in a | |
// canonical form, such that differences in the order of query parameters (other | |
// than same-key parameters, whose order is potentially meaningful) are | |
// eliminated. While the event is not fired on load, URL canonicalization may be | |
// performed. | |
// | |
// Like HashChangeEvent, URLChangeEvent has two properties, 'newURL' and |
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
document.querySelectorAll('canvas')[1].getContext('2d').drawImage = function(canvas) { | |
const downloadButton = document.getElementById('download'); | |
const anchor = document.createElement('a'); | |
anchor.download = 'poop.png'; | |
anchor.innerText = 'POOP'; | |
anchor.setAttribute('class', downloadButton.getAttribute('class')); | |
downloadButton.parentElement.replaceChild(anchor, downloadButton); |
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
%YAML 1.2 | |
--- | |
# This is the client config, but it is also used as the basis of the server | |
# config, which just switches env and appends node-specific rules. | |
# Current as of eslint 3.19.0 | |
parserOptions: | |
ecmaVersion: 2017 | |
sourceType: module |
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 binary = require('node-pre-gyp'); | |
const binding = require(binary.find(require.resolve('node-hid/package.json'))); | |
const { Duplex } = require('stream'); | |
const SHARED_METHOD_KEYS = [ | |
'getDeviceInfo', | |
'getFeatureReport', | |
'sendFeatureReport', | |
'setNonBlocking' |
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 assert = require('assert'); | |
const binary = require('node-pre-gyp'); | |
const { Duplex } = require('stream'); | |
const SHARED_METHOD_KEYS = [ | |
'getDeviceInfo', | |
'getFeatureReport', | |
'sendFeatureReport', | |
'setNonBlocking' | |
]; |
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
/* Slash and burn / shock and awe / total war CSS reset for Chrome specifically */ | |
:-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) h1, | |
:-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) h1, | |
:-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) h1, | |
:-webkit-any(article,aside,nav,section) :-webkit-any(article,aside,nav,section) h1, | |
:-webkit-any(article,aside,nav,section) h1, | |
::-webkit-input-placeholder, | |
:focus, | |
a:-webkit-any-link, |
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
/*! | |
* State-based routing for AngularJS | |
* @version v1.0.0-beta.3 | |
* @link https://ui-router.github.io | |
* @license MIT License, http://www.opensource.org/licenses/MIT | |
*/ | |
(function webpackUniversalModuleDefinition(root, factory) { | |
if(typeof exports === 'object' && typeof module === 'object') | |
module.exports = factory(require("angular")); | |
else if(typeof define === 'function' && define.amd) |
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
// STATE /////////////////////////////////////////////////////////////////////// | |
const state = { | |
down: false, | |
index: 0 | |
}; | |
// DATA //////////////////////////////////////////////////////////////////////// | |
const scouts = [ |