While watching today's Apple Keynote I got the idea to statistically analyze
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
// [2, 4, 3, 8] => [2, 6, 9, 17] | |
const convertToCumulative = points => | |
points.reduce((acc, p, i) => acc.concat([ | |
p + (acc.length > 0 ? acc[i - 1] : 0) | |
]), []); | |
// [2, 6, 9, 17] => [2, 4, 3, 8] | |
const convertToNormal = points => | |
points.reduce((acc, p, i, ps) => acc.concat([ | |
p - (i > 0 ? ps[i - 1] : 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
[{ | |
"start": 368.36733333333336, | |
"end": 375.7413333333334, | |
"duration": 7.374000000000024, | |
"text_before": "(Cheers and Applause).", | |
"text_after": "We love that so many customers" | |
}, { | |
"start": 415.1143333333334, | |
"end": 417.24933333333337, | |
"duration": 2.134999999999991, |
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
{ | |
"basics": { | |
"name": "Leo Bernard", | |
"label": "Software Engineer", | |
"picture": "https://secure.gravatar.com/avatar/483ab9eaf44f0c80139a4bd8cd24bc13?size=800", | |
"email": "[email protected]", | |
"phone": "+49 176 80705009", | |
"website": "https://leolabs.org", | |
"summary": "I am passionate about developing websites and web services that leverage the newest technologies to provide the best possible user experience.", | |
"location": { |
This component provides a simple way to improve render performance of long lists in React. It's a simple alternative to solutions like react-window that still works well with animation libraries like react-spring or framer-motion.
Example usage:
const List = ({ items }) => (
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
type Falsy = false | 0 | '' | null | undefined; | |
type NonFalsy<T> = T extends Falsy ? never : T; | |
/** | |
* Filter out falsy entries in an array | |
*/ | |
export function isTruthy<T>(value: T): value is NonFalsy<T> { | |
return Boolean(value); | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP --> | |
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'"> | |
<meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self'"> | |
<title>Hello World!</title> | |
<style> |
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
/** Put the root folder ID here */ | |
const ROOT_FOLDER_ID = ""; | |
/** Set this to false to only see reports of fixed files and errors */ | |
const VERBOSE = true; | |
/** Keeps track of how many files have been fixed */ | |
let fixedFiles = 0; | |
/** |
OlderNewer