This file contains 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 templates = { | |
keyword: /^(?:SELECT|FROM|JOIN|ON|WHERE)\b/i, | |
number: /^-?\d+(?:\.\d+)?/, | |
string: /^(?:'[^']*')+/, | |
name: /^[0-9A-Za-z]+/, | |
cmp: /^(?:<=|>=|<>|<|>|=)/, // сравнение | |
space: /^\s+/ | |
}; |
This file contains 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 getLexeme = (source) => { | |
let tokens = []; | |
const templates = { | |
keyword: /^(?:SELECT|FROM|JOIN|ON|WHERE)\b/i, | |
number: /^-?\d+(?:\.\d+)?/, | |
string: /^(?:'[^']*')+/, | |
name: /^[0-9A-Za-z]+/, | |
cmp: /^(?:<=|>=|<>|<|>|=)/, // сравнение | |
space: /^\s+/ |
This file contains 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
"editor.tokenColorCustomizations": { | |
"textMateRules": [{ | |
"scope": [ | |
//following will be in italic (=FlottFlott) | |
"comment", | |
"entity.name.type.class", //class names | |
"keyword", //import, export, return… | |
"constant", //String, Number, Boolean…, this, super | |
"storage.modifier", //static keyword | |
"storage.type.class.js", //class keyword |
This file contains 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
this.$store.subscribe(function(mutation, state) { | |
// console.log("mutation.type", mutation.type); | |
// console.log("(mutation.payload", mutation.payload); | |
console.log(that.$router); | |
console.log(state); | |
if (mutation.type === "LOGIN" && state.userAuth.status) { | |
that.$router.push("/"); | |
} | |
}); |
This file contains 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
{ | |
"editor.tabSize": 2, | |
"editor.insertSpaces": true, | |
"editor.detectIndentation": false, | |
"editor.formatOnSave": true, | |
"[javascript]": { | |
"editor.formatOnSave": false | |
}, | |
"css.fileExtensions": ["css", "scss", "less"], | |
"editor.quickSuggestions": { |
This file contains 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 map = ([head, ...tail], fn) => | |
tail.length ? [fn(head), ...map(tail, fn)] : [fn(head)]; | |
const reduce = ([head, ...tail], fn, initial) => | |
tail.length ? reduce(tail, fn, fn(initial, head)) : fn(initial, head); | |
const filter = ([head, ...tail], fn, newHead = void []) => ( | |
(newHead = fn(head) ? [head] : []), | |
tail.length ? [...newHead, ...filter(tail, fn)] : newHead | |
); |
This file contains 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 rp = require("request-promise"); | |
const cheerio = require('cheerio'); | |
const Table = require('cli-table'); | |
let users = []; | |
let table = new Table({ | |
head: ["username", "challenges"], | |
colWidths: [15, 10] | |
}) |
This file contains 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
{ | |
"[javascript]": { | |
"editor.formatOnSave": false | |
}, | |
"editor.tabSize": 2, | |
"eslint.autoFixOnSave": true, | |
"eslint.alwaysShowStatus": true, | |
"files.autoSave": "onFocusChange", | |
"editor.formatOnSave": true, | |
"javascript.format.enable": false, |
This file contains 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
Mac OS: $ brew update && brew upgrade && brew cleanup | |
Windows: $ choco upgrade all -y | |
Linux: $ apt update && apt full-upgrade |
This file contains 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
JSON.parse(LZString.decompressFromUTF16(localStorage.getItem("GlobalStor"))); |