require("./i2").log("Log1");
var ollog = console.log;
console.log = function(str){
ollog.apply(this, ["Intercepted\t",str]);
};
require("./i2").log("Log2");
This file contains 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 assignAlias = _.alias; | |
_.alias = function(){ | |
/* transform arguments[0] from camel to _ */ | |
assianAlias.apply(_, arguments); | |
}; |
This file contains 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 perl6 | |
class Text::CSV { | |
has $.binary = 1; | |
has $.file_handle = Nil; | |
has $.contains_header_row = 0; | |
has $.field_separator = ','; | |
has $.line_separator = "\n"; | |
has $.field_operator = '"'; | |
has $.escape_operator = '\\'; |
This file contains 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
method parse ( Str $templ ) { | |
my $chopper = '^\s*(' ~ $.open ~ '[\\' ~ %.nestables{'open'} ~ '\\' ~ | |
%.nestables{'close'} ~ '].*?' ~ $.close ~ ')\s*$'; | |
my $template = $templ.subst(/$chopper/, "\$1", :g:m); | |
my $length = $template.chars; | |
my @templarr = $template.split(''); | |
my @opener = $.open.split(''); | |
my @closer = $.close.split(''); | |
my $status = 0; # 0=in text, 1=in code | |
my @nodes; |
This file contains 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 perl6 | |
use DBIish; | |
use Digest::SHA; | |
use JSON::Tiny; | |
sub buf_to_hex { | |
$^buf.list.fmt('%02x', ''); | |
} |
This file contains 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
Welcome to MoarVM! | |
Configuring native build environment ................... OK | |
make: make | |
compile: clang -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -Weverything | |
link: clang -g | |
libs: -lm -lpthread | |
Configuring 3rdparty libs .............................. FAIL |
This file contains 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
6 <script> | |
7 var delicious = { | |
8 % use JSON::Tiny qw{j}; | |
9 % my $count = 0; | |
10 % for my $e (@{$stash->{employers}}) { | |
11 % my $hash = {}; | |
12 % for (keys $e->{_result_source}->{_columns}) { | |
13 % $hash->{$_} = $e->{_column_data}->{$_} || undef; | |
14 % } | |
15 %== ($count++ != 0 ? ',' : '') . $hash->{eid} . ': ' . j($hash) |
This file contains 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
#!/bin/sh | |
HOST=$1 | |
PORTF=$2 | |
PORTT=$3 | |
echo "Scanning $HOST:$PORTF-$PORTT" | |
for ((PORTF; PORTT >= PORTF; PORTF++)) do | |
SVC=`cat /etc/services | egrep "\\s$PORTF/tcp" | awk '{print $1}'` | |
nc -z -w 1 -G 2 -d "$HOST" "$PORTF" || echo "[$PORTF/$SVC] Failed"; |
This file contains 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 perl6 | |
class REST::Server { | |
has $.host = '127.0.0.1'; | |
has $.port = 8080; | |
has %.options is rw; | |
has $.debug = 1; | |
has Supply $!scheduler; |
This file contains 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
my $num = 0; | |
IO::Socket::Async.listen($.host,$.port,).tap(-> $connection { | |
my $snum = $num++; | |
my @chunks; | |
"connected #$snum".say; | |
my $tap := $connection.chars_supply.tap({ | |
$_.say; | |
try { | |
$connection.send("HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\nContent-Length: 6\r\n\r\nstring"); | |
"closing connection $snum".say if $.debug; |