Skip to content

Instantly share code, notes, and snippets.

View evgenius's full-sized avatar

Evgenii Abduzhapparov evgenius

  • Berlin
  • 09:58 (UTC +02:00)
View GitHub Profile
const http = require('http');
const requestHandler = (req, res) => {
const { remoteAddress, remotePort } = req.socket;
console.log(`Got a request from ${remoteAddress}:${remotePort}`);
res.end('Hello');
};
const server = http.createServer(requestHandler);
/***************
* pointers.js *
***************
*
* You! How are you still alive?
*
* Well, no matter. Good luck getting through this
* maze of rooms - you'll never see me or the Algorithm again!
*/
/*
* robotMaze.js
*
* The blue key is inside a labyrinth, and extracting
* it will not be easy.
*
* It's a good thing that you're a AI expert, or
* we would have to leave empty-handed.
*/
@evgenius
evgenius / test.js
Created March 2, 2014 18:29
A test for optimization of the "for" tag (Twig.js)
Twig = require('./twig');
var context = {};
// Context is big
for (var i=0; i<500; i++) {
context[''+i] = i;
}
// List of countries
var countries = context.countries = {};
@evgenius
evgenius / onchange.sh
Last active December 15, 2018 22:17 — forked from senko/onchange.sh
#!/bin/bash
#
# Watch current directory (recursively) for file changes, and execute
# a command when a file or directory is created, modified or deleted.
#
# Written by: Senko Rasic <senko.rasic@dobarkod.hr>
#
# Requires Linux, bash and inotifywait (from inotify-tools package).
#
# To avoid executing the command multiple times when a sequence of