Skip to content

Instantly share code, notes, and snippets.

View aereal's full-sized avatar

aereal aereal

View GitHub Profile
#!/usr/bin/env ruby
REPOS_DIR = File.expand_path('~/repos')
owner_and_repo, * = *ARGV
clone_dir = File.join(REPOS_DIR, '@' + owner_and_repo)
if FileTest.directory?(clone_dir)
abort "#{owner_and_repo} is already cloned"
end
#!/bin/sh
set -ue
if [[ $# -le 0 ]]; then
cat <<ERROR 1>&2
Usage:
$(basename $0) TAP_OWNER/TAP_REPO
ERROR
exit 1
fi
export SOCKSIFY=1
#!/usr/bin/env perl
use strict;
use warnings;
use cartonup;
use Plack;
using AntiString
puts !"和尚" # -> 尚和
package t::constraints;
use strict;
use warnings;
use FormValidator::Lite::Constraint;
use Test::More;
rule VALUES => sub {
diag explain +{
'$_' => +{
use strict;
use warnings;
use Test::More;
sub detect_context {
my $is_wantarray;
return \$is_wantarray, sub { $is_wantarray = wantarray };
}
subtest 'list context' => sub {
function logicalConjunction (criteria) {
return criteria.reduce(function (f, g) {
return function () { return f.apply(this, arguments) && g.apply(this, arguments) };
});
}
use strict;
use warnings;
use Test::More;
use HTML::TreeBuilder::Select;
my $HTML = <<EOF;
<header id="header"></header>
EOF
my $tree = HTML::TreeBuilder::Select->new;
$tree->parse_content($HTML);
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Section::Simple qw( get_data_section );
use HTML::TreeBuilder::Select;
use HTML::Selector::XPath qw( selector_to_xpath );
use Test::More;
my $tree = HTML::TreeBuilder::Select->new();