View gist:137761
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
package Foo; | |
use parent 'signatures'; | |
sub import { | |
my $class = shift; | |
my $caller = shift; | |
$class->setup_for($caller); | |
return; |
View gist:137778
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
package Foo; | |
use strict; | |
use warnings; | |
use parent 'signatures'; | |
require Method::Signatures; | |
sub proto_unwrap { | |
my $class = shift; | |
return Method::Signatures->parse_sub( proto => $_[0] ); |
View perl5i.c
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
#include <unistd.h> | |
#include <stdlib.h> | |
/* | |
* Meant to mimic the shell command | |
* exec perl -Mperl5i "$@" | |
* | |
* This is a C program so it works in a #! line. | |
*/ |
View Daring Fireball URI regex
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
qr{ | |
\b | |
( | |
# scheme or schemeless | |
([\w-]+://? | www[.]) | |
# anything but whitespace or brackets | |
[^\s()<>]+ | |
# letters and numbers in parens |
View gist:306297
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/perl | |
use utf8; | |
use YAML::XS qw(Load); | |
binmode $_, ':encoding(utf8)' for (*STDIN, *STDOUT, *STDERR, *DATA); | |
#no utf8; # its interfering with the DATA loading | |
my $authors2email = Load(join "", <DATA>); | |
exit; |
View wrapping require benchmark.pl
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/perl -w | |
use strict; | |
use warnings; | |
use Benchmark qw(cmpthese); | |
BEGIN { | |
*CORE::GLOBAL::require = sub { | |
return CORE::require $_[0]; |
View release.pl
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/local/bin/perl | |
use perl5i::0; | |
use File::Copy; | |
my %Is; | |
my $builder; | |
my $build_file; | |
my @build_args; |
View git-child
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/bash | |
# Find the child of the current (or supplied) commit. | |
REV=$1 | |
if [ x$REV == x ]; then | |
REV="HEAD" | |
fi |
View uniq.pl
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/perl -w | |
use strict; | |
use warnings; | |
use List::MoreUtils qw(uniq); | |
use Benchmark qw(cmpthese); | |
sub somni_uniq { my %seen; grep { !$seen{$_}++ } @_ } |
View try.c
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
#include <time.h> | |
#include <stdio.h> | |
int main() { | |
time_t now = -4136232677718LL; | |
printf("%lld\n", (long long int)timegm(gmtime(&now))); | |
return 0; | |
} |
OlderNewer