Skip to content

Instantly share code, notes, and snippets.

View Shinpeim's full-sized avatar

Shinpei Maruyama Shinpeim

View GitHub Profile
#!/usr/bin/env perl
use strict;
use warnings;
use Mac::Growl;
system @ARGV;
my $appname = "notice.pl";
Mac::Growl::RegisterNotifications($appname, ['alert'], ['alert']);
@Shinpeim
Shinpeim / favter.rb
Created July 27, 2011 09:28 — forked from kkosuge/favter.rb
favorit爆撃を与えてターゲットのデスクトップをGrowlで埋めるなどします
#coding: utf-8
require 'twitter'
Twitter.configure do |config|
config.consumer_key = YOUR_CONSUMER_KEY
config.consumer_secret = YOUR_CONSUMER_SECRET
config.oauth_token = YOUR_OAUTH_TOKEN
config.oauth_token_secret = YOUR_OAUTH_TOKEN_SECRET
end
client = Twitter::Client.new
use strict;
use warnings;
use Config::Pit;
use Net::Twitter::Lite;
use Encode;
use utf8;
my $message = shift or usage();
$message = Encode::decode('utf-8',$message);
use strict;
use warnings;
use Config::Pit;
use Net::Twitter::Lite;
use DateTime;
use Encode;
use utf8;
my $now = DateTime->now;
@Shinpeim
Shinpeim / yunocchi_in_zsh.markdown
Created November 4, 2011 18:25
ゆのっち in zsh

ゆのっちプロンプト

PS_OK=$'\n''%F{green}CURRENT=%'$'\n%F{yellow}✖╹◡╹✖ %F{magenta}☆☆☆ %F{reset}' PS_NG=$'\n''%F{red}CURRENT=%'$'\n%F{yellow}xX_Xx %F{magenta}☆☆☆ %F{reset}'

PS1="%0(?|${PS_OK}|${PS_NG})"

@Shinpeim
Shinpeim / watchi.pl
Created November 4, 2011 18:36
時間かかってるプロセスを監視して終わったときgrowlに通知するやつ。 $ watch.pl <pid> みたいにして使う
#!/usr/bin/env perl
use strict;
use warnings;
use Proc::ProcessTable;
use Mac::Growl;
my $pid = shift or die "<usage> $0 pid";
die "bad pid" unless $pid !~ m/[^0-9]/;
chomp $pid;
@Shinpeim
Shinpeim / mkpasswd.pl
Created November 4, 2011 18:40
パスワード作るやつ mkpasswd.pl <length> みたいにして使う。
#!/usr/bin/env perl
use strict;
use warnings;
use String::Random;
my $length = shift;
$length //= 8;
die "length must be unsigned int" if $length < 1;
@Shinpeim
Shinpeim / Qudo.pm
Created November 9, 2011 12:09
CloudForecastでQudoの溜まってるjob queueの量をグラフ化するやつ
package CloudForecast::Data::Qudo;
use CloudForecast::Data -base;
use Qudo;
=head1 NAME
CloudForecast::Data::Qudo
=head1 SYNOPSIS
double_lambda = lambda {|x| return x * 2}
def double_fn(x)
return x * 2;
end
p double_lambda.call(4) #8
p double_fn(4) #8
@Shinpeim
Shinpeim / mkdn2html.zshrc
Created November 22, 2011 06:27
markdown to html
alias mkdn2html="perl -MText::Markdown -e 'print Text::Markdown::markdown(join(q{},<>))'"