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
console.log(` ‾‾‾‾ | |
Paint time for ${location}:${ | |
performance.getEntriesByType("paint").map(({ name, startTime }) => ` | |
• ${name}: ${startTime}ms`)} | |
____`); |
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() { | |
const BASE_64_CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/'.split(''); | |
Number.prototype._toString = Number.prototype.toString; | |
window._parseInt = window.parseInt; | |
Number.prototype.toString = function(base) { | |
if (base < 37 && base >= 2) { | |
return Number.prototype._toString.call(this, ...arguments); |
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
let cursorWidth = 14; | |
let cursorHeight = 20; | |
let pointerOffsetX = 2; | |
let pointerOffsetY = 3; | |
let c = document.createElement('div'); | |
c.style.cssText = ` | |
width: ${cursorWidth}px; | |
height: ${cursorHeight}px; | |
position: fixed; |
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 mode = process.env.MODE || 'STRICT'; | |
const isCaseInsensitive = mode.includes('i'); | |
const isSubstring = mode.includes('s'); | |
const isVerbose = mode.includes('v'); | |
console.log(`Searching for string '${process.env.FIND}'${ | |
mode === 'STRICT' | |
? '' | |
: isSubstring | |
? ' in substring mode' |
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
/** | |
* Used like: | |
* dealWithPromisesAsTheyResolve([ | |
* new Promise((res, rej) => setTimeout(res, 2000, 2000)), | |
* new Promise((res, rej) => setTimeout(res, 1000, 1000)), | |
* new Promise((res, rej) => setTimeout(res, 4000, 4000)), | |
* new Promise((res, rej) => setTimeout(res, 0, 0)), | |
* new Promise((res, rej) => setTimeout(rej, 3000, 3000)), | |
* ], num => console.log(num), err => console.log(`error: ${err}`)); | |
* |
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
class Accounting { | |
static largestNumber = 10e9; // America's annual budget is ~4tn | |
static accuracy = (function() { | |
let accuracy = 1; | |
while (Accounting.largestNumber * accuracy < Number.MAX_SAFE_INTEGER) { | |
accuracy *= 10; | |
} | |
return accuracy; | |
}()); // to change to #accuracy when support rises |
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
$aspect-y: 16; | |
$aspect-x: 9; | |
$min-height: 80px; | |
$min-width: 160px; | |
$max-height: 900px; | |
$max-width: 1700px; | |
@mixin contain($aspect-y, $aspect-x) { |
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
:root { | |
--r: 200; | |
--g: 100; | |
--b: 50; | |
--r1: calc(var(--r) / 255); | |
--r2: calc(var(--r1) * 100%); | |
--g1: calc(var(--g) / 255); | |
--g2: calc(var(--g1) * 100%); | |
--b1: calc(var(--b) / 255); |
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
/* | |
* let a = 1; | |
* let an = 1; | |
* let some = 2; | |
* | |
* Currently supports: | |
* - a.day.ago | |
* - some.days.ago | |
* - a.week.ago | |
* - some.weeks.ago |
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
import Component from '@ember/component'; | |
export default Component.extend({ | |
classNames: [ | |
'notification-center-item', | |
], | |
}); |