Skip to content

Instantly share code, notes, and snippets.

View yoshiki's full-sized avatar

Yoshiki Kurihara yoshiki

View GitHub Profile
#!/usr/local/bin/perl
use strict;
use HTTP::MobileAgent;
sub foo {
local $ENV{HTTP_USER_AGENT} = 'J-PHONE/2.0/J-DN02';
my $agent = HTTP::MobileAgent->new;
return $agent->get_header( 'x-jphone-uid' ) unless $agent->is_type_c;
}
my $external_enc;
if ( $agent->is_docomo ) {
$external_enc = "x-sjis-docomo";
}
elsif ( $agent->is_ezweb ) {
$external_enc = "x-sjis-ezweb-auto";
}
elsif ( $agent->is_softbank ) {
$external_enc = "x-sjis-softbank-auto";
}
#!/usr/local/bin/perl
use strict;
use warnings;
use WWW::Mechanize;
use Term::QRCode;
my $mech = WWW::Mechanize->new;
$mech->get( "http://conferences.yapcasia.org/ya2009/main" );
$mech->submit_form(
;;; tmt-mode.el --- Major mode for editing Text::MicroTemplate syntax
;; Copyright (C) 2009 Yoshiki Kurihara
;; Author: Yoshiki Kurihara <kurihara at cpan.org>
;; Keywords: perl template mode
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
package MyApp::Config;
use strict;
use warnings;
use base qw( Class::Singleton );
use Config::Any;
use Data::Visitor::Callback;
use Catalyst::Utils ();
use Path::Class;
#!/usr/local/bin/perl
use strict;
use warnings;
use Config::Pit;
use HTTP::Headers;
use HTTP::Request::Common;
use LWP::UserAgent;
use AnyEvent::HTTP;
use MIME::Base64 qw( encode_base64 );
package Music::DB;
use base qw( Hako );
__PACKAGE__->connection( 'dbi:mysql:dbname', 'username', 'password' );
__PACKAGE__->schema(
artist => {
primary_key => [ qw( id ) ],
columns => [ qw( id name ) ],
},
cd => {
#!/usr/bin/env perl
use strict;
use warnings;
use DateTime;
use DateTime::Format::MySQL;
my %age_of = (
0 => '未就学児',
6 => '小1', 7 => '小2', 8 => '小3', 9 => '小4', 10 => '小5', 11 => '小6',
#!perl
use strict;
use warnings;
use Data::Dumper;
my $ref = {
foo => {
qux => {
quux => 2,