Skip to content

Instantly share code, notes, and snippets.

// My example
rows.forEach(element => {
let json = JSON.parse(element.template_source);
for (let key in json) {
if(key === 'details') {
json[key].forEach(element => {
if(element.level !== undefined) {
console.log(element.level);
}
})
fs.readFileSync("DB.txt");
let lk = res.rows.filter((result) => {
return result.app_version === "lk";
});
it.only("create cache file", () => {
let cacheResult = {};
const query3 = "SELECT * FROM profile_systems";
const newCursor = client.query(new Cursor(query3));
newCursor.read(20, (err, rowsTop) => {
if (err) {
throw err;
}
test(err => {
try {
function inherit(child, parent) {
var Temp = function () {};
Temp.prototype = parent.prototype;
child.prototype = new Temp();
}
inherit(F2, F);
function inherit(child, parent) {
child.prototype = Object.create(parent.prototype);
function pushUniqueObject(...arrays) {
let result = [];
let uniqueId = [];
for(let array of arrays) {
if(array.length !== 0) {
for (let object of array) {
if(object.child_id !== undefined && !uniqueId[object.child_id]) {
uniqueId[object.child_id] = true;
result.push(object);
}
const isIterable = object =>
object != null && typeof object[Symbol.iterator] === 'function';
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("/");
}
});