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 settings = [ | |
{ | |
name: 'gameManager', | |
settings: { | |
id: 1, | |
escape_rooms_id: 1, | |
silent : true | |
}, | |
}, | |
{ |
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 fs = require('fs'); | |
const crypto = require('crypto'); | |
const secret = 'windranger'; | |
let blocks, block, hash, content; | |
if (fs.existsSync('./blocks.txt')) { | |
blocks = JSON.parse(fs.readFileSync('./blocks.txt')); | |
const blocksAmount = blocks.length; | |
for (let i = 0; i < blocksAmount; i++) { |
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 net = require('net'); | |
let port = 3000; | |
let isRoot = false; | |
const connectionList = new Map(); | |
const expireDelta = 5*60*1000; | |
const server = net.createServer(socket => { | |
socket.on('error', err => { | |
console.log(err); |
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
function checkWord( board, word ) { | |
const graph = board.map((row, rowNumber) => { | |
return row.map((letter, position) => { | |
return { | |
name: letter, | |
neighbours: getNeighbours(rowNumber, position, board), | |
index: rowNumber * board.length + position | |
}; | |
}); | |
}); |
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 path = require('path'); | |
const webpack = require('webpack'); | |
module.exports = { | |
entry: "./js/index.js", | |
output: { | |
filename: 'index.js', | |
path: path.resolve(__dirname, 'dist') | |
}, | |
module: { |
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
'use strict'; | |
function embedNodeResolver(jsonLD) { | |
let IDindex = {}; | |
let suspectedNodes = {}; | |
let markedShapes = []; | |
jsonLD.shapes.forEach((shape, index) => { | |
IDindex[shape['@id']] = index; //write down the node to check it in future | |
let suspectedNode = suspectedNodes[shape['@id']] | |
if (suspectedNode !== undefined) { |
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
function embedNodeResolver(jsonLD) { | |
jsonLD.shapes.forEach((shape, index) => { | |
IDindex[shape['@id']] = index; //write down the node to check it in future | |
let suspectedNode = suspectedNodes[shape['@id']] | |
if (suspectedNode !== undefined) { | |
jsonLD.shapes[suspectedNode['shapeIndex']]['property'][suspectedNode['propertyIndex']]['node'] = shape; | |
markedShapes.push(index); | |
} | |
shape.property.forEach((property, i) => { | |
if (property.node !== undefined) { |
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
import webpack from 'webpack'; | |
import config from './webpack.config.js'; | |
import WebpackDevServer from 'webpack-dev-server'; | |
const PROD = process.env.npm_config_argv.includes('--production'); | |
config.entry.app.unshift('webpack-dev-server/client?http://localhost:9001', 'webpack/hot/only-dev-server'); | |
var compiler = webpack(config); | |
const server = new WebpackDevServer(compiler, { |
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
function solution(A) { | |
let start = A[0]; | |
let depth = 0; | |
let result = 0; | |
let min = 100000000; | |
for (let i = 1; i < A.length; i++) { | |
if (A[i] < start) { | |
if ((A[i] - min) > depth) { | |
depth = A[i] - min; | |
} |