Skip to content

Instantly share code, notes, and snippets.

View gist:109471
--- browser.xul.orig 2009-05-08 23:29:02.000000000 +0900
+++ browser.xul 2009-05-10 11:05:38.000000000 +0900
@@ -1,26 +1,26 @@
<?xml version="1.0"?>
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<popup id="contentAreaContextMenu">
+ <menuseparator insertafter="placesMenu" />
<menuitem
class="menuitem-iconic"
- insertbefore="context-bookmarklink"
View gist:109851
MATCH FAILED
input: [[% USE LinkTo -%]\n[% args = {\n href => '/link/to?foo=bar',\n hoge => 'huga',\n in => 'put',\n} -%]\n[% LinkTo.link_to('link_text', args) %]\n]
expect: [<a href="/link/to?foo=bar&amp;in=put&amp;hoge=huga">link_text</a>]
output: [<a href="/link/to?foo=bar&amp;hoge=huga&amp;in=put">link_text</a>]
FAILED 13: - template text 5 did not match expected
not ok 13 - template text 5 did not match expected
View gist:112184
use Web::Scraper;
use strict;
use Data::Dumper;
use URI;
use YAML;
use utf8;
use Encode qw/ encode_utf8 decode_utf8 /;
my $s = scraper {
process "table.wikitable tr", "tr[]" =>
View gist:115235
use Benchmark qw/:all/;
use List::Util qw/ sum /;
cmpthese(0, {
sum => sub { sum( 1 .. 1000 ) },
loop => sub {
my $x = 0;
$x += $_ for ( 1 .. 1000 );
},
});
__END__
View gist:115444
package Filter;
use strict;
require Exporter;
our @ISA = qw/ Exporter /;
our @EXPORT_OK = qw/ html uri replace html_line_break /;
our %EXPORT_TAGS = ( all => \@EXPORT_OK );
use overload
'|' => sub {
my ($self, @args) = @_;
View gist:202005
?= encoded_string q{<?xml version="1.0" encoding="utf-8"?>}
View gist:209051
package Example;
use URI;
use Web::Scraper;
my $URL = 'http://www.topicmaker.com';
my @FOO = qw/ foo /;
sub scrape {
scraper {
process '//tr', 'rows[]', scraper {
View gist:209118
package Example;
my @FOO = qw/ foo /;
sub nested {
sub {
sub {
warn @FOO;
}->();
}->();
}
1;
View gist:209228
my @FOO = qw/ foo /;
sub nested {
sub {
sub {
warn @FOO;
}->();
}->();
}
nested();
View gist:231881
package main
import (
"fmt";
"os";
"strconv";
)
func main() {
n, error := strconv.Atoi( os.Args[1] );