Skip to content

Instantly share code, notes, and snippets.

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})
// Implementation of sorting array that comprises two types of entities.
let arr = [
"Name 1",
"Third",
"First",
"Name 5",
"Fourth",
"Second",
"Name 3",
"Name 10",
#!/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;
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('');
}
})
#!/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/;
@TheAthlete
TheAthlete / foo.mt
Last active February 12, 2020 16:01
<!DOCTYPE html>
<html>
<head>
<meta charset="windows-1251">
<title>Тест</title>
</head>
<body>
<p>Привет</p>
<p><%= $str %></p>
</body>
@TheAthlete
TheAthlete / gist:ef914cde72bdf8af4588
Created November 11, 2014 20:05
Интерполяция произвольных выражений в строках
print "Please contact me at: <URL: ${\($d->url)} >\n";