22> A1 = hashtree:compute(hashtree:generate(hashtree:test()), []).
[<<229,160,31,238,20,224,237,92,72,113,79,34,24,15,37,173,
131,101,181,63,151,121,247,157,196,163,215,233,...>>,
<<191,254,11,52,219,161,107,198,250,193,124,8,186,197,93,
103,108,222,213,164,173,228,31,226,201,146,74,...>>,
<<63,121,187,123,67,91,5,50,22,81,218,239,211,116,205,
198,129,220,6,250,166,94,55,78,56,51,...>>]
25> A2 = hashtree:compute(A1, []).
[<<20,237,229,232,233,122,217,55,35,39,114,143,80,153,185,
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
# coding=UTF-8 | |
from __future__ import division | |
import re | |
# This is a naive text summarization algorithm | |
# Created by Shlomi Babluki | |
# April, 2013 | |
class SummaryTool(object): |
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
#! perl | |
use List::Util qw(shuffle); | |
use Data::Dumper; | |
my @input = ( [ 'a', 1 ], [ 'b', 1 ], [ 'c', 2 ], [ 'd', 2 ] ); | |
my @element_1s = map { $_->[0] } @input; | |
my @element_2s = map { $_->[1] } @input; |
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 -C | |
# My ghetto clipboard.com clip importer for kippt. | |
# | |
# cpanm HTTP::Tiny IO::Socket::SSL Path::Tiny | |
use 5.014; | |
use Path::Tiny; | |
use HTTP::Tiny; | |
use JSON::PP; |
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 5.018; | |
use charnames (); | |
binmode(STDOUT, ":utf8"); | |
my $upper_prefix = "CIRCLED LATIN CAPITAL LETTER"; | |
my $lower_prefix = "CIRCLED LATIN SMALL LETTER"; |
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
-module(riemann). | |
-export([riemann/2]). | |
riemann(Function, Delta) when is_function(Function) andalso is_float(Delta) -> | |
I = fun(X) -> Function(X) * Delta end, | |
R = fun(X1, Acc) -> I(X1) + Acc end, | |
fun(A, B) -> lists:foldl(R, 0, seq_float(A, B, Delta)) end. | |
% https://gist.github.com/andruby/241489 |
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 5.010; | |
use warnings; | |
use strict; | |
use Data::Dumper; | |
# If you have access to CPAN, check out Data::Printer | |
# https://metacpan.org/module/Data::Printer | |
## build a list of hashes |
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
% By Grabthar's Hammer you will be avenged. | |
-module(grabthar). | |
-export([start_link/3]). | |
-record(state, { | |
customer_id, | |
timer, | |
threshold, | |
current = 1, |
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; | |
use warnings; | |
{ | |
package JSON::ObjectFactory; | |
use Carp; | |
use Class::Tiny { json => sub { 'JSON::PP'->new } }; | |
use Import::Into; | |
use JSON::PP (); |
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 Benchmark qw(:all); | |
use Data::Random::Structure; | |
use Data::Dumper; | |
use JSON::PP (); | |
use JSON::XS (); |