Skip to content

Instantly share code, notes, and snippets.

@ichigotake
ichigotake / grow.pl
Created March 19, 2012 08:40
30秒ごとに経過時間をGrowlへ通知する
#!/usr/bin/env perl
use strict;
use warnings;
use Growl::GNTP;
my $interval = $ARGV[0] > 0 ? $ARGV[0]:30;
my $growl = Growl::GNTP->new(
@ichigotake
ichigotake / term_colorpallet.sh
Created March 28, 2012 09:39
Print collorpallet for terminal.
#!/bin/sh
for i in {0..255} ; do
printf "\x1b[38;5;${i}mcolour%3d " "${i}"
if [ $(expr $i % 7) == 0 ]
then
echo
fi
done
@ichigotake
ichigotake / yancha_api_request_sample.pl
Created April 22, 2012 01:42
yancha api request sample
#!/usr/bin/env perl
#
## yanchaのAPIリクエストサンプル
##
## https://github.com/uzulla/yancha
##
use strict;
use warnings;
use utf8;
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Encode qw/encode_utf8/;
use HTTP::Request::Common;
use LWP::UserAgent;
use Data::Dumper;
@ichigotake
ichigotake / tweet2yancha.pl
Last active October 9, 2015 21:17
[旧] 特定ワードが含まれるツイートをyanchaへ投げるスクリプト。
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Encode qw/encode_utf8/;
use URL::Encode qw/url_encode_utf8/;
use JSON qw/encode_json decode_json/;
use HTTP::Request::Common qw/POST/;
use LWP::UserAgent;
@ichigotake
ichigotake / check.php
Created September 17, 2012 07:36
SetucoCMSで動作環境のチェックをするページ
<?php
// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
@ichigotake
ichigotake / prompt.sh
Created October 2, 2012 07:02
今使ってるプロンプト
# 出力例
#(*>ヮ<)っ:~ $
PS1="(*>ヮ<)っ:\W\$ "
@ichigotake
ichigotake / echo_holidays.pl
Last active October 11, 2015 16:17
月の休日一覧を出力する。 format: $ echo_holidays.pl [year] [month]
#!/bin/env perl
use strict;
use warnings;
use Calendar::Japanese::Holiday;
use Time::Local qw/timelocal/;
use Encode qw/encode/;
my (undef,undef,undef, undef,$now_mon,$now_year) = localtime(time);
my $year = $ARGV[0] || ($now_year+1900);
@ichigotake
ichigotake / merge_pdf.pl
Created November 11, 2012 11:29
CAM::PDFを利用して複数のPDFを結合するスクリプトサンプル
#!/usr/bin/env perl
# CAM::PDF - search.cpan.org
# http://search.cpan.org/~cdolan/CAM-PDF-1.58/lib/CAM/PDF.pm
use strict;
use warnings;
use CAM::PDF;
# 結合するPDFのファイル名を指定してインスタンス生成
@ichigotake
ichigotake / Yancha-Plugin-PluginAutoloader.pm
Last active December 15, 2015 14:29
Yanchaプラグインのオートローダー
package Yancha::Plugin::PluginAutoloader;
use strict;
use warnings;
sub setup {
my ($class, $sys) = @_;
my %config;
for my$plugin( @{$sys->config->{ plugins }} ) {