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
| <template> | |
| <canvas class="gridCanvas" | |
| :width="width" | |
| :height="height" | |
| ></canvas> | |
| </template> | |
| <script> | |
| export default { | |
| name: 'xon-GridCanvas', |
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 obj = { | |
| key1: "value1", | |
| key2: "value2", | |
| key3: "value3" | |
| } | |
| for (const key in obj) { | |
| let value = obj[key]; | |
| //optional check for properties from prototype chain |
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 user = { | |
| name: 'John', | |
| ...isAdmin && {adminGroup: 'super-admin'}, | |
| }; | |
| const options = [ | |
| 'fruits', | |
| ...hasFlowers ? ['flowers'] : [], | |
| ]; |
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 waitFor = (ms) => new Promise(r => setTimeout(r, ms)) | |
| const asyncForEach = async (array, callback) => { | |
| for (let index = 0; index < array.length; index++) { | |
| await callback(array[index], index, array) | |
| } | |
| } | |
| const start = async () => { | |
| await asyncForEach([1, 2, 3], async (num) => { | |
| await waitFor(50) |
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 branch | grep -v "master\|develop" | xargs git branch -D |
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
| /** | |
| * Get Csrf token from document.cookie | |
| */ | |
| getCsrfToken () { | |
| if (!process.client) { | |
| return null | |
| } | |
| const regex = /csrftoken=(.[^;]*)/ig | |
| const match = regex.exec(document.cookie) | |
| return match[1] |
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
| { | |
| "devDependencies": { | |
| "babel-cli": "^6.10.1", | |
| "babel-preset-es2015": "^6.9.0", | |
| "babel-preset-stage-0": "^6.5.0", | |
| "node-sass": "^3.8.0", | |
| "npm-run-all": "^2.2.2" | |
| }, | |
| "babel": { | |
| "presets": [ |
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
| { | |
| "parser": "babel-eslint", | |
| "env": { | |
| "browser": true, | |
| "node": true | |
| }, | |
| "extends": "airbnb", | |
| "rules": { | |
| "no-console":0, | |
| "nomen": 0 |
NewerOlder