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
$ perl6 -e ' | |
my %h; | |
for lines("lib/November.pm") -> $line { | |
for $line.comb -> $word { | |
++%h{$word} | |
} | |
} | |
say .value, "\t", .key for %h.sort({ $^b.value <=> $^a.value })[^10]' | |
60 { | |
48 = |
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 di | |
diff --git a/build/gen_setting_pm.pl b/build/gen_setting_pm.pl | |
index 7d97aea..7141e8a 100644 | |
--- a/build/gen_setting_pm.pl | |
+++ b/build/gen_setting_pm.pl | |
@@ -22,8 +22,10 @@ foreach my $file (@files) { | |
my @classes = ('Any'); | |
foreach my $file (@files) { | |
- next unless $file =~ /[\/\\](\w+)\.pm$/; |
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 hitomi-example.xml | |
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml" | |
xmlns:pe="http://github.com/masak/hitomi"> | |
<head> | |
<title>Slurp: News</title> | |
</head> | |
<body class="index"> | |
<div id="header"> | |
<h1>News</h1> |
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 hitomi-example.xml | |
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml" | |
xmlns:pe="http://github.com/masak/hitomi"> | |
<head> | |
<title>Slurp: News</title> | |
</head> | |
<body class="index"> | |
<div id="header"> | |
<h1>News</h1> |
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
for (Class<?> interfaze | |
: findAllPublishedInterfaces(manager.getClass())) | |
// Is there a death punishment for calling a variable '_'? | |
// I think it's nice. | |
for (String _ : new String[] { | |
interfaze.getAnnotation(PublishedClass.class).value(), | |
NEWLINE, | |
NEWLINE, | |
" This manager has the following methods:", | |
NEWLINE } ) |
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
sub links() { | |
return [ | |
{ | |
:url<http://ihrd.livejournal.com/>, | |
:title("ihrd's blog"), | |
:username<ihrd>, | |
:time(1240904601) | |
}, | |
{ :url<http://blogs.gurulabs.com/stephen/>, | |
:title("Tene's blog"), |
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
private static Map<String, String[]> topLevelCommands | |
= new HashMap<String, String[]>() {{ | |
// { "fn name" => [ "parameters", "fn body" ] } | |
put("clear", new String[] { "", "js.clear()" } ); | |
put("print", new String[] { "message", "js.print(message)" } ); | |
put("say", new String[] { "message", "js.say(message)" } ); | |
}}; | |
static { | |
for (Map.Entry<String, String[]> e : topLevelCommands.entrySet()) |
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
Double d = new Double(7); | |
Integer i = new Integer((int)(d.doubleValue())); | |
System.out.println(i); |
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 hitomi | |
use v6; | |
grammar XML { | |
regex TOP { ^ <pi>* <xmlcontent>+ {*} $ }; | |
token xmlcontent { | |
| <node> {*} #= node | |
| <empty> {*} #= empty | |
| <content> {*} #= content |
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
sub get-deps($deps-file) { | |
return unless $deps-file ~~ :f; | |
my &remove-line-ending-comment = { .subst(/ '#' .* $ /, '') }; | |
my &trim-spaces = { .subst(/ ^ \h+ /, '').subst(/ \h+ $ /, '') }; | |
return slurp($deps-file)\ | |
.split("\n")\ | |
.map({remove-line-ending-comment($^line)})\ | |
.map({trim-spaces($^line)})\ | |
.grep({$^keep-all-nonempty-lines}); | |
} |