Skip to content

Instantly share code, notes, and snippets.

@17e
17e / ae_loop.pl
Created June 1, 2016 14:03 — forked from Mons/ae_loop.pl
#!/usr/bin/env perl
use strict;
use AE;use EV;
use Guard;
use Time::HiRes;
use POSIX 'strftime';
sub ae_loop(&&$$);
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Sort</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@17e
17e / hexdump.lua
Created June 26, 2015 13:58
LUA hexdump
function hexdump(s)
if type(s) ~= 'string' then
error('string required')
end
local ln = 0
local line = ''
local rest = ''
local byte
for i = 1, #s do
if i % 16 == 1 and i > 1 then
@17e
17e / smail.sh
Created June 5, 2015 17:53
bash function
function smail() {
function help() {
cat <<EOF
smail [option option ...] <addressee> [attachment ...]
--from -f mail sender (default is \${USER}@\$?(hostname -f))
--subject -s mail subject (defailt "mail")
--test -t don't call sendmail, send result to stdout
--help -h print this message and exit
EOF
}
@17e
17e / chain.html
Created March 30, 2015 21:39
JS Chain
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8' />
<meta name='description' content='JS Chain'>
<meta name='author' content='Anton Reznikov <anton.n.reznikov@gmail.com>'>
<title>JS chain</title>
<script type='text/javascript' src='//yastatic.net/jquery/2.1.3/jquery.min.js'></script>
<script type='text/javascript' src='//yastatic.net/bootstrap/3.3.1/js/bootstrap.min.js'></script>
<link rel='stylesheet' href='//yastatic.net/bootstrap/3.3.1/css/bootstrap.min.css'>
@17e
17e / example.pl
Created October 31, 2014 23:04
[Moscow.pm] __PACKAGE__ namespace
use strict;
use warnings;
use 5.010;
package BasePackage;
my %STORAGE = ();
sub add {
my ($class, $key) = @_;
say "add $class <- $key";
#!/bin/gawk -f
/^[[:blank:]]*(\#.*)?$/ {
next;
}
{
v = $1 + 0.0;
xs = xs + v;
xxs = xxs + v * v;