This file contains 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
var not_oquno = Array.filter(window.$("#following_list img"),function(img){return!/oquno/.test(img.src)}); | |
setInterval(function(){ | |
if (not_oquno.length == 0) return; | |
var i=Math.floor(Math.random()* not_oquno.length); | |
not_oquno[i].src="http://a3.twimg.com/profile_images/256862425/oquno-c_mini.png"; | |
not_oquno.splice(i, 1); | |
}, 1000); |
This file contains 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 | |
# http://todeskin.g.hatena.ne.jp/eigokun/20090902/1251903150 | |
# TODO: cache LWP response | |
use strict; | |
use URI; | |
use JSON; | |
use LWP::UserAgent; | |
use Web::Scraper; |
This file contains 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 lib qw(../lib); | |
use Plack::Loader; | |
Plack::Loader->load("AnyEvent", port => 8888, host => "127.0.0.1")->run(\&handler); | |
sub handler { | |
my ( $env, $start_response ) = @_; | |
unless ($env->{psgi.async}) { | |
return [200, [], "Not Supported."] |
This file contains 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 AnyEvent; | |
my $cv = AE::cv; | |
my $count = 0; | |
my $timer; | |
$timer = AE::timer 0, 0.1, sub { | |
$count++; | |
$cv->send("hoge" . $count); |
This file contains 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 Plack::Middleware::AsyncSupport; | |
use strict; | |
use warnings; | |
use base qw/Plack::Middleware/; | |
our $USE_CORO = 1; | |
use Coro; | |
use Coro::Channel; | |
use IO::Handle::Util qw(io_from_getline); |
This file contains 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
/* | |
// mxhr.js | |
// BSD license | |
var mxhr = new MXHR; | |
mxhr.listen(mime, function(body){ process(body) }); | |
mxhr.listen('complete', function(status_code){ ... }); // 2xx response | |
mxhr.listen('error', function(status_code){ ... }); // other case | |
mxhr.open("GET", url, true); // or mxhr.open("POST", url, true); | |
mxhr.send(""); |
This file contains 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 type="text/javascript"> | |
chrome.browserAction.onClicked.addListener(function(tab){ | |
capture(); | |
}); |
This file contains 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
--- ares_init.c.old 2010-04-23 11:46:56.000000000 +0900 | |
+++ ares_init.c 2010-04-23 12:19:06.000000000 +0900 | |
@@ -831,12 +831,16 @@ | |
FILE *fp; | |
size_t linesize; | |
int error; | |
+ const char *path_resolv_conf = getenv("ARES_PATH_RESOLV_CONF"); | |
+ if (!path_resolv_conf) { | |
+ path_resolv_conf = PATH_RESOLV_CONF; | |
+ } |
This file contains 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 Benchmark qw(:all); | |
use Data::Dumper; | |
use HTTP::Response; | |
use HTTP::Headers::Fast; | |
{ | |
package HTTP::Headers::Fast; | |
my %CACHE; |
This file contains 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/local/bin/perl | |
# DoS tool for memcached | |
# ulimit -n 15000; perl memcachedos.pl 127.0.0.1 11211 3 | |
# original: http://gist.github.com/522741 | |
# This is Public Domain Software | |
use strict; | |
use warnings; | |
use AnyEvent; |