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 warnings;
use Config::Pit;
use HTTP::Headers;
use HTTP::Request::Common;
use LWP::UserAgent;
use AnyEvent::HTTP;
use MIME::Base64 qw( encode_base64 );
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;
;;; 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)
#!/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(
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 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;
}