Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8" ?>
<flashNews flag="0" pubDate="Fri, 06 May 2011 21:12:00 +0900" />
@punytan
punytan / bench.js
Created April 15, 2011 22:29
node.js vs twiggy hello world benchmark
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {"Content-Type": "text/plain"});
res.end("Hello World");
}).listen(4000, '');
console.log('Server running at http://localhost:4000');
@punytan
punytan / app.psgi
Created April 4, 2011 04:38
for blog post - pjax
use strict;
use warnings;
use feature qw/say switch/;
use Data::Section::Simple;
use Text::Xslate;
use Plack::Request;
my $tx = Text::Xslate->new(
path => [ Data::Section::Simple->new->get_data_section ],
);
@punytan
punytan / google_reader_with_instareader.user.js
Created February 14, 2011 14:09
Open feed item with InstaReader in background by pressing 'v'
// ==UserScript==
// @name Google Reader with InstaReader
// @namespace http://linknode.net
// @description Open feed item with InstaReader in background by pressing 'v'
// @include http*://www.google.com/reader/view/*
// ==/UserScript==
document.addEventListener('keypress', function(event) {
if(event.which == 118) { // 118 is 'v'
if (document.getElementById('current-entry') == null) return; // no current entry
use strict;
use warnings;
use utf8;
use Encode;
use Email::MIME::Creator;
use Email::Sender::Simple qw/sendmail/;
sub send {
my $email = shift;
@punytan
punytan / gist:662805
Created November 4, 2010 17:21
download leaked videos
use strict;
use warnings;
use WWW::YouTube::Download;
use Parallel::ForkManager;
my $urls = [qw{
JXkawnuyTn8
bY0tgl6YLGI
3eJsXP4HLVs
gOUvdNjs_Cg
use strict;
use warnings;
use Plack;
use Plack::Request;
my $app = sub {
my $env = shift;
my $req = Plack::Request->new($env);
/*
* epoll_sample.c
*
* forked from http://d.hatena.ne.jp/odz/20070507/1178558340
*
* compile : gcc -O3 -o epoll_sample epoll_sample.c
* bench : ab -n 10000 -c 50 http://localhost:8080/
*
* fix me :)
*
Not a GLOB reference
(F) Perl was trying to evaluate a reference to a "typeglob" (that is, a symbol table entry that looks like *foo) but found a reference to something else instead. You can use the ref function to find out what kind of ref it really was.
typeglob
Use of a single identifier, prefixed with *. For example, *name stands for any or all of $name, @name, %name, &name, or just name. How you use it determines whether it is interpreted as all or only one of them. See "Typeglobs and Filehandles" in Chapter 2.
$fh = *STDOUT;
$fh = \*STDOUT;
。「」、・ヲァィゥェォャュョッーアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワン゛゜
。「」、・ヲァィゥェォャュョッーアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワン゙゚
ヴガギグゲゴザジズゼゾダヂヅデドバビブベボパピプペポ
ヴガギグゲゴザジズゼゾダヂヅデドバビブベボパピプペポ
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
0123456789
0123456789
 !”#$%&’()*+,-./:;<=>?@[¥]^_‘{|}~
!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~