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 wait = ( | |
| time, | |
| cancel = Promise.reject() | |
| ) => new Promise((resolve, reject) => { | |
| const timer = setTimeout(resolve, time); | |
| const noop = () => {}; | |
| cancel.then(() => { | |
| clearTimeout(timer); | |
| reject(new Error('Cancelled')); |
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 wait = time => new Promise((resolve) => setTimeout(resolve, time)); | |
| wait(3000).then(() => console.log('Hello!')); // 'Hello!' |
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 Inheritance Example | |
| // NOT RECOMMENDED. Use object composition, instead. | |
| // https://gist.github.com/ericelliott/b668ce0ad1ab540df915 | |
| // http://codepen.io/ericelliott/pen/pgdPOb?editors=001 | |
| class GuitarAmp { | |
| constructor ({ cabinet = 'spruce', distortion = '1', volume = '0' } = {}) { | |
| Object.assign(this, { | |
| cabinet, distortion, volume |
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
| # svn-commands.sh | |
| # *** HOUSEKEEPING! We all live in a yellow svn repository, a yellow svn repository... *** | |
| # Master File: Maintained by Primitive Digital's Housekeeping Department | |
| # https://primitivedigital.uk/housekeeping-department/ | |
| # STATUS ::: DRAFT: Requires Review | |
| # version of svn | |
| $ svn --version |
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
| # node-commands.sh | |
| # *** HOUSEKEEPING! One for the Node *** | |
| # Master File: Maintained by Primitive Digital's Housekeeping Department | |
| # https://primitivedigital.uk/housekeeping-department/ | |
| # STATUS ::: DRAFT: Requires Review | |
| # version of npm | |
| $ npm --version | |
| $ npm -v |
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
| # git-commands.sh | |
| # *** HOUSEKEEPING! Cheeky Git! *** | |
| # Master File: Maintained by Primitive Digital's Housekeeping Department | |
| # https://primitivedigital.uk/housekeeping-department/ | |
| # STATUS ::: DRAFT: Requires Review | |
| # version of git | |
| $ git --version |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.