Skip to content

Instantly share code, notes, and snippets.

mala mala

Block or report user

Report or block mala

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:174530
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);
View gist:180142
#!/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;
View gist:183515
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."]
View gist:192543
use AnyEvent;
my $cv = AE::cv;
my $count = 0;
my $timer;
$timer = AE::timer 0, 0.1, sub {
$count++;
$cv->send("hoge" . $count);
View gist:202121
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);
View mxhr.js
/*
// 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("");
@mala
mala / background.html
Created Mar 10, 2010
presen to jpg extension
View background.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script type="text/javascript">
chrome.browserAction.onClicked.addListener(function(tab){
capture();
});
View gist:376149
--- 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;
+ }
View gist:388419
#!/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;
@mala
mala / memcachedos.pl
Created Aug 13, 2010
DoS for memcached
View memcachedos.pl
#!/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;
You can’t perform that action at this time.