Skip to content

Instantly share code, notes, and snippets.

View kan's full-sized avatar

Kan Fushihara kan

View GitHub Profile
# ./example.pl -a 100 --border=20 -c
use Smart::Options;
warn Dumper(argv);
=> {
'a' => 100,
'border' => 20,
'c' => 1,
use Acme::PrettyCure::Girl::CurePeace;
my $peace = Acme::PrettyCure::Girl::CurePeace->new;
say $peace->challenge_with_jankenpon($ARGV[0]);
# % ./peace2.pl 17
# ピカピカぴかりんじゃんけんぽん (パー)♪ キュアピース!
use Acme::PrettyCure::Girl::CurePeace;
my $peace = Acme::PrettyCure::Girl::CurePeace->new;
say $peace->challenge_with_jankenpon;
# % ./peace.pl
# ピカピカぴかりんじゃんけんぽん (チョキ)♪ キュアピース!
@kan
kan / hoge.pl
Created October 5, 2012 07:06
今日の電波
use WAF::Casual;
sub index {
# render HTML
return "hello world";
}
sub json {
req my $self, $x, $y;
@kan
kan / gist:1576906
Created January 8, 2012 02:25
Images.Mediaの有効なbucket一覧を取得する
Uri uri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
Cursor c = managedQuery(uri, null, null, null, null);
buckets.clear();
c.moveToFirst();
for (int i = 0; i < c.getCount(); i++) {
String bucket_id = c
.getString(c.getColumnIndexOrThrow("bucket_id"));
String bucket_name = c.getString(c
.getColumnIndexOrThrow("bucket_display_name"));
buckets.put(bucket_id, bucket_name);
ラーメン
つけ麺
油そば
野菜
二郎
スープ
Posted3weeks ago
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Data::Dumper;
use File::Slurp;
use Time::Piece;
use WebService::Tumblr;
use Config::Pit;
sub _normalize {
my $value = shift;
if ( $value =~ /^([-+]?)(\d+)\.(\d+)\.([0-9.]+)$/ ) {
my $degree = int($2) + int($3) / 60 + $4 / 3600;
$degree *= -1 if $1 && $1 eq '-';
return $degree;
}
else {
return $value;
/usr/bin/perl "-Iinc" /usr/share/perl/5.8/ExtUtils/xsubpp -typemap /usr/share/perl/5.8/ExtUtils/typemap xs/Text-Xslate.xs > xs/Text-Xslate.x
sc && mv xs/Text-Xslate.xsc xs/Text-Xslate.c
cc -c "-I." "-I." -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -Wall -Wextra -Wdeclaration-after-statement -Wc++-compat -Wall -g -O2 -DVERSION=\"0.1048\" -DXS_VERSION=\"0.1048\" -
o xs/Text-Xslate.o -fPIC "-I/usr/lib/perl/5.8/CORE" -DUSE_PPPORT xs/Text-Xslate.c
In file included from Text-Xslate.xs:21:
./xslate_ops.h: In function 'tx_init_ops':
./xslate_ops.h:211: warning: implicit declaration of function 'hv_stores'
In file included from Text-Xslate.xs:137:
./xs/xslate_opcode.inc: In function 'TXCODE_concat':
Bacall
Ball
Callaghan
Callahan
Callao
Callas
Callie
Calliope
Callisto
Caracalla