Skip to content

Instantly share code, notes, and snippets.

@punytan
punytan / gist:351087
Created March 31, 2010 23:27
AnyEvent::HTTP::Simple
package AnyEvent::HTTP::Simple;
use strict;
use AnyEvent::HTTP ();
use HTTP::Request::Common ();
use HTTP::Request;
use HTTP::Response;
use HTTP::Cookies;
use Any::Moose;
our $VERSION = '0.02';
#!/usr/bin/perl
use strict;
use utf8;
use Encode;
open (my $in, '<', 'source.csv') or die $!;
my @csv = <$in>;
close $in or die $!;
。「」、・ヲァィゥェォャュョッーアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワン゛゜
。「」、・ヲァィゥェォャュョッーアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワン゙゚
ヴガギグゲゴザジズゼゾダヂヅデドバビブベボパピプペポ
ヴガギグゲゴザジズゼゾダヂヅデドバビブベボパピプペポ
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
0123456789
0123456789
 !”#$%&’()*+,-./:;<=>?@[¥]^_‘{|}~
!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
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;
/*
* 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 :)
*
use strict;
use warnings;
use Plack;
use Plack::Request;
my $app = sub {
my $env = shift;
my $req = Plack::Request->new($env);
@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 utf8;
use Encode;
use Email::MIME::Creator;
use Email::Sender::Simple qw/sendmail/;
sub send {
my $email = shift;
@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
@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 ],
);