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'); | |
const querystring = require('querystring'); | |
function isObject(obj) { | |
return obj !== null && typeof obj === 'object'; | |
} | |
function http_get(host, port, path, query, timeout, cb) { | |
const query_str = querystring.stringify(query); | |
console.log({query_str, query, path}) |
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
// Implementation of sorting array that comprises two types of entities. | |
let arr = [ | |
"Name 1", | |
"Third", | |
"First", | |
"Name 5", | |
"Fourth", | |
"Second", | |
"Name 3", | |
"Name 10", |
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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use feature 'say'; | |
use DDP; | |
my @strings = qw/RLRRLLRLRL RLLLLRRRLR LLLLRRRR RLRRRLLRLL LRLLLRRLRR/; | |
for my $s (@strings) { | |
pos $s = 0; |
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
var Benchmark = require('benchmark'); | |
var suite = new Benchmark.Suite; | |
let dominoes = [[1,1],[2,2],[1,1],[1,2],[1,2],[1,1]]; | |
// add tests | |
suite.add('sort-join', function() { | |
for (let d of dominoes) { | |
[...d].sort((a, b) => a - b).join(''); | |
} | |
}) |
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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use feature 'say'; | |
use utf8; | |
use open qw/:std :utf8/; | |
use FindBin qw/$Bin/; | |
use File::Slurper qw/read_lines/; | |
use DDP; | |
use List::Util qw/any/; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="windows-1251"> | |
<title>Тест</title> | |
</head> | |
<body> | |
<p>Привет</p> | |
<p><%= $str %></p> | |
</body> |
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
print "Please contact me at: <URL: ${\($d->url)} >\n"; |