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
| HEAD | grep | ag | rg | |
------------------------------------------------------------------------ | |
ack foo /home/andy/parrot/ | 0.43 | 0.08 | 0.09 | 0.08 | |
ack foo -w /home/andy/parrot/ | 0.40 | 0.08 | 0.08 | 0.09 | |
ack foo\w+ -w /home/andy/parrot/ | 0.36 | 0.09 | 0.12 | 0.07 | |
ack foo\w+ -C10 /home/andy/parrot/ | 0.52 | 0.09 | 0.14 | 0.07 | |
ack (set|get)_\w+ /home/andy/parrot/ | 0.82 | 0.18 | 0.18 | 0.08 | |
------------------------------------------------------------------------ | |
Total | 2.53 | 0.52 | 0.61 | 0.39 |
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
Testing under Perl 5.026000, /home/andy/perl5/perlbrew/perls/perl-5.26.0/bin/perl | |
| 1.96 | 2.22 | 2.999_01 | 2.999_02 | 2.999_03 | HEAD | grep | ag | rg | |
-------------------------------------------------------------------------------------------------------------------------- | |
ack foo /home/andy/linux/ | 11.24 | 14.60 | 16.85 | 8.02 | 6.16 | 6.19 | 1.30 | 2.23 | 0.84 |
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 strict; | |
use warnings; | |
use 5.010; | |
sub every(\%) { | |
my $hash = shift; | |
my $id = "$hash"; |
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
Usage: ack [OPTION]... PATTERN [FILES OR DIRECTORIES] | |
Search for PATTERN in each source file in the tree from the current | |
directory on down. If any files or directories are specified, then | |
only those files and directories are checked. ack may also search | |
STDIN, but only if no file or directory arguments are specified, | |
or if one of them is "-". | |
Default switches may be specified in ACK_OPTIONS environment variable or | |
an .ackrc file. If you want no dependency on the environment, turn it |
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
Here's how I built a sidebar with sections in Jekyll: | |
```{% comment %} | |
The sections for the sidebar are managed through _data/sections.yml. We load | |
them in the order they're declared (`site.data.sections`), then loop through | |
each section and list any pages. | |
To allow pages to be ordered without explicitly requiring it, we sort by | |
weight. The lower the weight, the higher a page floats in the order (get it?). | |
{% endcomment %} | |
{% assign sections = site.data.sections %} |
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 warnings; | |
use strict; | |
use 5.010; | |
use Data::Dumper; | |
my $re = '\Qfoo('; | |
warn Dumper( $re ); |
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
$ cat foo.t | |
#!/var/perl/bin/perl | |
use strict; | |
use warnings; | |
use lib '/home/alester/Test-Simple-1.302085/blib/lib'; | |
use Test::Tester; | |
use Test::More tests => 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; | |
use Test::Tester; | |
use Test::More tests => 1; | |
use TW::Test::More; | |
#check_test( sub { is_fs_custnum( 'GARBAGECRAP' ) }, { ok => 0 }, 'Garbage should fail' ); |
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 Test::Tester; | |
use Test::More tests => 1; | |
use TW::Test::More; | |
check_test( sub { is_fs_custnum( 'GARBAGECRAP' ) }, { ok => 0 }, 'Garbage should fail' ); |
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
defmodule Euler003 do | |
# http://projecteuler.net/index.php?section=problems&id=3 | |
# The prime factors of 13195 are 5, 7, 13 and 29. | |
# What is the largest prime factor of the number 600851475143 ? | |
def largest_prime_factor( n ) do | |
factors = prime_factors( n ) | |
[largest|_] = factors | |
IO.write 'Prime factors are ' |