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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <stdbool.h> | |
static bool is_prime(const int candidate) { | |
if( candidate <= 1 ) | |
return false; | |
if( candidate <= 3 ) |
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
{ | |
package Plain; | |
use Moose; | |
sub no_args { return 42 } | |
sub one_arg { | |
my $self = shift; | |
my $arg = shift; |
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; | |
use Benchmark qw(cmpthese); | |
sub match { $_[0] =~ $_[1] } | |
sub wrapper { match(@_) } | |
sub wrapper_alias_args { &match } | |
my @args = ("foo", qr/bar/); |
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; | |
sub current_branch { | |
my $branch=`git symbolic-ref --short HEAD`; | |
chomp $branch; | |
die "Cannot figure out the current branch.\n" unless $branch; |
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
$ git remote show origin | |
* remote origin | |
Fetch URL: git://github.com/CPAN-API/cpan-api.git | |
Push URL: git://github.com/CPAN-API/cpan-api.git | |
HEAD branch: master | |
Remote branches: | |
apeiron/signature-false-positive-pod tracked | |
apeiron/support-signed-dists tracked | |
grantm/#159 tracked | |
haarg/download-ssl tracked |
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 -wle 'use Devel::Peek; $foo = 1.23; print $foo; print int $foo; Dump $foo' | |
1.23 | |
1 | |
SV = PVNV(0x7f99f3804730) at 0x7f99f4808350 | |
REFCNT = 1 | |
FLAGS = (NOK,POK,pIOK,pNOK,pPOK) | |
IV = 1 | |
NV = 1.23 | |
PV = 0x7f99f3609040 "1.23"\0 | |
CUR = 4 |
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; use 5.010; | |
use DBI; | |
use Benchmark qw{:all} ; | |
my $EXECUTES_PER_PREPARE = 10; | |
my $BENCH_TIMES = int(200_000 / $EXECUTES_PER_PREPARE); | |
my $dbh = DBI->connect('DBI:mysql:database=test', '', '', | |
{RaiseError => 1, AutoCommit => 0} | |
); |
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/perl | |
use v5.18; | |
use strict; | |
use warnings; | |
my $total = 0; | |
local $/ = "\n\n"; | |
while(<DATA>) { |
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(cmpthese); | |
my $String = "ATGC" x 1000; | |
my @Genes = qw(A T G C); | |
my %Count; |
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(cmpthese); | |
my $String = "ATGC" x 1000; | |
my @Genes = qw(A T G C); | |
my %Count; |