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
| let winsize; | |
| const calcWinsize = () => winsize = {width: window.innerWidth, height: window.innerHeight}; | |
| calcWinsize(); | |
| window.addEventListener('resize', calcWinsize); | |
| const getMousePos = (ev) => { | |
| let posx = 0; | |
| let posy = 0; | |
| if (!ev) ev = window.event; | |
| if (ev.pageX || ev.pageY) { |
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
| class PasswordRevealer extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { | |
| shown: false | |
| }; | |
| this.toggleShown = this.toggleShown.bind(this); | |
| } | |
| toggleShown() { |
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
| class Collapse extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { | |
| collapsed: !!props.collapsed | |
| }; | |
| this.style = { | |
| collapsed: { | |
| display: 'none' | |
| }, |
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 scrollToTop = () => { | |
| const c = document.documentElement.scrollTop || document.body.scrollTop; | |
| if (c > 0) { | |
| window.requestAnimationFrame(scrollToTop); | |
| window.scrollTo(0, c - c / 8); | |
| } | |
| }; |
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
| @media (prefers-reduced-motion: reduce) { | |
| * { | |
| animation-duration: 0.1s !important; | |
| transition-duration: 0.1s !important; | |
| } | |
| } |
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 fs = require('fs'); | |
| const path = require('path'); | |
| /** | |
| * Arguments | |
| */ | |
| const name = process.argv[2]; | |
| const location = process.argv[3]; | |
| const needRuntime = process.argv[4] === 'runtime'; |
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
| { | |
| "name": "tsquickstart", | |
| "version": "1.0.0", | |
| "description": "Boilerplate for quick one-off TypeScript projects. Just run `npm start`", | |
| "scripts": { | |
| "init": "test -f tsconfig.json || (tsc --init -t ESNext -m ESNext && npm install)", | |
| "start": "npm run init && concurrently \"npm run watch\" \"npm run serve\"", | |
| "serve": "http-server", | |
| "watch": "tsc -p . --watch", | |
| "build": "tsc -p ." |
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
| $camphor300:'d09GMgABAAAAAQ5UABIAAAAEn0QAAQ3tAAEZmQAAAAAAAAAAAAAAAAAAAAAAAAAAG4SkahzOKgZgFotgAIosCCIJgnMRCAqLlgCKvTwBNgIkA5lwE4GnDguZdAAEIAW7bwcgDHJb0WS0WUXZkokWaBHx4wKbY7TigANIU/t980QCGzI/IkCsdbqJZwY1ZOgWDngIamw3I43435Dd+zJ1kNmKVp/DvXNAwaNm//////////////////+/NZkMZ5cAl0CpbZ3oiwloFA5GyIWNzOYVLt1bpXPX+pABI2fo5rMZpgVYIzYqgxt92ajECqUKh2G9gaOCVRC23VSRVypHfbvb7wYcwEM25WArF0esm1yKzDixrJRdcBGtcpBZTFbFbIl8LIU4gWOnEdSITqkoGrHWJ8ywn9eVFWWk3lC6m07qp1TXntHaWp6ekYHLrFoyzOXYiQnn2kWX2zqMaFBTca25vHKndPhJV66HRhQzL9lB3OT20KGTXuFHu62wm1qzoV/iTnaiLdc8o/D7B+1O94BrjSE3cia6U1A5XNp0kHmUj8IMBaeiGaiNJV7b1csb0bq8EWYo2h1TuipR+7hmYjxeZsonGLNcmgsKp5EUDCEj9SvRyxX2uMUNfINmfNqglBYNNtjtNmdwWV2ly4uQKheyDyka2RTRoQ3IEfs+0BNcGJ4Z5AnmHNpFbCKW5PsXkAzJ6VVzzVMo0fwIUpQQT67itTNRE946/NxDashl9KuAFUbZ6yW91vObh+WAMZ1mQ1J4wotF6KXHuo65X6wSz406hW/T6XZMf/6W+HGYUxCDfhyjPaoMGcWccmbYM/H35NdHTOd79Jg0ho/BDBvRy2vcg8pHsv07UYiKrDFeqzL0Qk7qCkXLuukl2EKuR3xS6VtsLEaT0BfWoDYoQ1YvEjjT729XNMYoCX3j+2ApedBG/UHLOJ7AAnfPSqdmmePsY+522MpfPaf7kf6fIJMn0/4SE6PmuI3yjyeGjWn+1qj/ukf09DE |
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
| ffmpeg -i video-3.mp4 -ss 00:00:05 -vframes 1 video-3.jpg |
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
| function actThenThrottleEvents(listener, delay) { | |
| var timeout; | |
| return function(e) { | |
| if (!timeout) { // no timer running | |
| listener(e); // run the function | |
| timeout = setTimeout( function() { timeout = null }, | |
| delay); // start a timer that turns itself off when it's done | |
| } | |
| //else, do nothing (we're in a throttling stage) | |
| } |