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 perl_string_ranking.pl ~/co/Plack/lib/**/**.pm | sort | uniq -c | sort -n -k 1 | |
| # Stringリテラルだけ出力する | |
| # sortすると重複を探すときに使える予定 | |
| use strict; | |
| use warnings; | |
| use PPI; | |
| use Perl6::Say; | |
| sub parse { |
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
| class Worker | |
| constructor: -> | |
| @jobs = [] | |
| register: (job) -> | |
| @jobs.push job | |
| work: -> | |
| job = do @jobs.shift | |
| return unless job |
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 Perl6::Say; | |
| for my $i (0..10) { | |
| if ($i % 2 == 0) { | |
| say "$i: Even"; | |
| } else { | |
| say "$i: Odd"; | |
| } |
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
| (defadvice flymake-start-syntax-check (around flymake-start-syntax-check-visible-only activate) | |
| (when (get-buffer-window (current-buffer)) | |
| ad-do-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
| later = (f) -> | |
| setTimeout (args...)-> | |
| f *args | |
| , 1000 |
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
| class Duel | |
| def initialize(*jobs) | |
| @lock = Mutex.new | |
| @done = false | |
| make_thread(jobs) | |
| end | |
| def join | |
| return if @done | |
| @threads.first.join |
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
| if (!context.setup) { | |
| context.setup = true; | |
| var app = { | |
| counts: { | |
| GET: 0, | |
| POST: 0, | |
| }, | |
| $log: $('<pre>').appendTo($(document.body)), | |
| urls: [], |
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
| function once(callback) { | |
| var results = {}; | |
| var key = callback.toString(); | |
| return function() { | |
| if (!results.hasOwnProperty(key)) { | |
| results[key] = callback(); | |
| } | |
| return results[key]; |
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 IO::Handle; | |
| STDOUT->autoflush; | |
| while(1) { | |
| print "\a"; | |
| sleep 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> | |
| <script src="stalker.js"></script> | |
| </head> | |
| <body> | |
| </body> | |
| </html> |