Skip to content

Instantly share code, notes, and snippets.

const templates = {
keyword: /^(?:SELECT|FROM|JOIN|ON|WHERE)\b/i,
number: /^-?\d+(?:\.\d+)?/,
string: /^(?:'[^']*')+/,
name: /^[0-9A-Za-z]+/,
cmp: /^(?:<=|>=|<>|<|>|=)/, // сравнение
space: /^\s+/
};
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+/
"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.$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("/");
}
});
{
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.detectIndentation": false,
"editor.formatOnSave": true,
"[javascript]": {
"editor.formatOnSave": false
},
"css.fileExtensions": ["css", "scss", "less"],
"editor.quickSuggestions": {
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
);
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]
})
{
"[javascript]": {
"editor.formatOnSave": false
},
"editor.tabSize": 2,
"eslint.autoFixOnSave": true,
"eslint.alwaysShowStatus": true,
"files.autoSave": "onFocusChange",
"editor.formatOnSave": true,
"javascript.format.enable": false,
Mac OS: $ brew update && brew upgrade && brew cleanup
Windows: $ choco upgrade all -y
Linux: $ apt update && apt full-upgrade
JSON.parse(LZString.decompressFromUTF16(localStorage.getItem("GlobalStor")));