Skip to content

Instantly share code, notes, and snippets.

View mtsukamoto's full-sized avatar

Makio Tsukamoto mtsukamoto

View GitHub Profile
@mtsukamoto
mtsukamoto / Email::MIME::CreateHTML::Resolver::CustomUA
Created December 8, 2009 14:00
Email::MIME::CreateHTML::Resolver which uses your custom UserAgent
package Email::MIME::CreateHTML::Resolver::CustomUA;
use base qw(Email::MIME::CreateHTML::Resolver);
use Clone;
sub _select_resolver {
my ($self, $uri) = @_;
my $resolver = $self->SUPER::_select_resolver($uri);
return $resolver unless ($self->{ua});
@mtsukamoto
mtsukamoto / Email::MIME::CreateHTML
Created December 8, 2009 14:26
Email::MIME::CreateHTML-1.026 + rt#51208 patch
###############################################################################
# Purpose : Build HTML emails
# Author : Tony Hennessy
# Created : Aug 2006
# CVS : $Header: /home/cvs/software/cvsroot/email/lib/Email/MIME/CreateHTML.pm,v 1.26 2006/08/24 21:41:37 johna Exp $
###############################################################################
package Email::MIME::CreateHTML;
use strict;
package WebScraper::Wassr::Timeline;
use warnings;
use strict;
use base qw(Class::Accessor::Fast);
use Carp;
use HTML::ResolveLink;
use URI::Escape;
use WWW::Mechanize;
use Net::Twitter;
use Encode;
use File::Slurp;
use YAML;
use utf8;
my $username = 'yourname';
my $password = 'yourpassword';
my $max_id = undef;
@mtsukamoto
mtsukamoto / shovelx2growl.pl
Created May 11, 2011 09:13
Showbelx Update to Local Growl for Windows
use utf8;
use strict;
use warnings;
use Encode;
use Growl::GNTP;
use HTTP::Request::Common;
use URI;
use WWW::Mechanize;
use YAML;
@mtsukamoto
mtsukamoto / generate_password.pl
Created August 30, 2011 04:45
Minimal random password generater.
use utf8;
use strict;
use warnings;
print &generate_password(@ARGV);
sub generate_password {
my $length = shift || 8;
my $seeds = shift || [['a'..'z'],['A'..'Z'],[0..9],[qw(! $ % & @ ? * + -),'#']];
@mtsukamoto
mtsukamoto / WWW-OpenPNE3-API-Client.pm
Created January 7, 2013 09:04
WWW::OpenPNE3::API::Client - OpenPNE3 smartphone api client
package WWW::OpenPNE3::API::Client;
use utf8;
use strict;
use warnings;
use Carp;
use base 'WWW::Mechanize';
use Encode;
use JSON -support_by_pp;
対象ウィンドウタイトル = STATUS(0, ST_TITLE)
対象ウィンドウID = ウィンドウID取得(対象ウィンドウタイトル)
// 状態表示
print 対象ウィンドウタイトル //タイトル表示
print "X=" + STATUS(対象ウィンドウID, ST_X) + ",Y=" + STATUS(対象ウィンドウID, ST_Y)
print "幅=" + STATUS(対象ウィンドウID, ST_WIDTH) + ",高=" + STATUS(対象ウィンドウID, ST_HEIGHT)
print "IsICON=" + STATUS(対象ウィンドウID, ST_ICON)
print "IsVISIBLE=" + STATUS(対象ウィンドウID, ST_VISIBLE)
print "IsACTIVE=" + STATUS(対象ウィンドウID, ST_ACTIVE)
@mtsukamoto
mtsukamoto / set_ip_route.bat
Created February 4, 2013 04:47
WindowsコマンドラインでのIPアドレス、ルーティングの設定。とくにrouteコマンドを忘れるので、備忘録として。
set IFNAME="ローカル エリア接続"
set IFIP="10.0.1.2"
set IFMASK="255.255.255.0"
set IFGW="none"
set ROUTEDEST="10.0.2.0"
set ROUTEMASK="255.255.255.0"
set ROUTEGW="10.0.1.254"
netsh interface ip set address name=%IFNAME% source=static addr=%IFIP% mask=%IFMASK% %IFGW%
@mtsukamoto
mtsukamoto / MySAXHandler.pm
Created April 16, 2013 07:01
My sample XML::SAX handler module. With this sample handler, current path and path nodes' name are available in "characters" sub.
package MySAXHandler;
use base qw(XML::SAX::Base);
# --- SYNOPSYS ---
# use XML::SAX;
# use MySAXHandler;
# my $parser = XML::SAX::ParserFactory->parser(Handler => MySAXHandler->new);
# $parser->parse_uri("sample.xml");
sub start_document {