Install electron-gyp
npm install electron-gyp -g
Get your electron version
$ electron -v
| function failingPromise() { | |
| throw new Error('foobar'); | |
| return Promise.resolve(4); | |
| } | |
| // works fine not in chain, error is thrown | |
| failingPromise() | |
| .then(num => { | |
| console.log(num); | |
| }); |
| // in the browser | |
| window.addEventListener('unhandledrejection', function(event) { | |
| console.error('Unhandled rejection (promise: ', event.promise, ', reason: ', event.reason, ').'); | |
| }); | |
| // in Node | |
| process.on('unhandledRejection', (reason, p) => { | |
| console.log("Possibly Unhandled Rejection at: Promise ", p, " reason: ", reason); |
Install electron-gyp
npm install electron-gyp -g
Get your electron version
$ electron -v
| .linter-row.decoration { | |
| border-radius: 3px; | |
| justify-content: center; | |
| color: darken(@red, 30%); | |
| .linter-gutter.linter-highlight.error, .linter-gutter.linter-highlight.warning{ | |
| &:before { | |
| background-color: darken(@red, 30%) !important; | |
| position: absolute; |
| ### Keybase proof | |
| I hereby claim: | |
| * I am dperrymorrow on github. | |
| * I am dperrymorrow (https://keybase.io/dperrymorrow) on keybase. | |
| * I have a public key whose fingerprint is E5B8 AB61 4395 76F9 7FB2 BA4F 4548 8C8A 56A3 9E6D | |
| To claim this, I am signing this object: |
| const animal = () => { | |
| return { | |
| name: 'animal', | |
| eat() { | |
| console.log(`my name is ${this.name} i am a eating`); | |
| } | |
| }; | |
| } |
| const dog = (name) => { | |
| const type = 'dog'; | |
| return { | |
| name: name, | |
| speak() { | |
| console.log(`my name is ${this.name} i am a ${type}`); | |
| } | |
| }; | |
| } |
| /** | |
| * Changes value to past tense. | |
| * Simple filter does not support irregular verbs such as eat-ate, fly-flew, etc. | |
| * http://jsfiddle.net/bryan_k/0xczme2r/ | |
| * | |
| * @param {String} value The value string. | |
| */ | |
| Vue.filter('past-tense', function(value) { | |
| // Slightly follows http://www.oxforddictionaries.com/us/words/verb-tenses-adding-ed-and-ing | |
| var vowels = ['a', 'e', 'i', 'o', 'u']; |
| // see this javascript working at http://jsbin.com/mehemepume/edit?js,console | |
| // the function calls itself recursivly, so there can be any level of nesting and it will still flatten. | |
| var nested = [[1, 2, [3]], 4], | |
| nestedDeep = [1, 2, 3, [4, 5, 6, [[7, [8]], 9, 10]]]; | |
| function flatten(arr) { | |
| var flat = []; |
| /** | |
| * CSS variables test | |
| */ | |
| html { background: red } | |
| @supports (--variables: yes) { /* any variable and any value works */ | |
| /* Code here will only be applied in CSS variable-supporting UAs */ | |
| html { | |
| background: green; |