Skip to content

Instantly share code, notes, and snippets.

@toritori0318
toritori0318 / .perldb
Created December 10, 2011 18:01
perldb補足
# エイリアス設定したり
$DB::alias{'rerun'} = 'exec "perl -d $DB::filename"';
$DB::alias{'len'} = 's/^len(.*)/p length($1)/';
$DB::alias{'stop'} = 's/^stop (at|in)/b/';
# トレース情報をdb.outに保存
parse_options("LineInfo=db.out AutoTrace");
# デバッガの初期化終了後に呼び出されるサブルーチン
sub afterinit {
@toritori0318
toritori0318 / myperl5db.patch
Created December 11, 2011 14:29
perlデバッグプロンプトくるくるパッチ
--- myperl5db.pl 2011-12-11 23:26:51.000000000 +0900
+++ perl5/perlbrew/perls/perl-5.14.2/lib/5.14.2/perl5db.pl 2011-12-11 23:23:02.000000000 +0900
@@ -517,14 +517,6 @@
$header = "perl5db.pl version $VERSION";
-my @pattern_original = (
- '\(^o^)/',
- '\(o^ ) ',
- '\(^ ) ',
@toritori0318
toritori0318 / remove_rt.pl
Created February 12, 2012 14:45
Net::Twitter::Liteでリツイート削除
use strict;
use warnings;
use Net::Twitter::Lite;
my($consumer_key, $consumer_secret) = qw/
vvvvvvvvvvvvvvvvvvvvvv
wwwwwwwwwwwwwwwwwwwwww
/;
my $nt = Net::Twitter::Lite->new(
consumer_key => $consumer_key,
@toritori0318
toritori0318 / twitter_date.pm
Created February 12, 2012 14:52
Twitterの日付変換とか
package Twitter::Date;
use strict;
use warnings;
use Time::Piece;
sub convert_statuses {
my ($statuses) = @_;
my $len = scalar @$statuses;
$len -= 1 if $len != 0;
@toritori0318
toritori0318 / get_all_friends.pl
Created February 12, 2012 15:00
friend全員を取得するスクリプト
# $nt = Net::Twitter:Lite
my @friends;
for ( my $cursor = -1, my $r; $cursor; $cursor = $r->{next_cursor} ) {
$r = $nt->friends({ cursor => $cursor });
push @friends, @{ $r->{users} };
}
@toritori0318
toritori0318 / ptags.py
Last active October 2, 2015 05:17
ptagsのディレクトリ再帰版
#! /usr/bin/env python
# ptags
#
# Create a tags file for Python programs, usable with vi.
# Tagged are:
# - functions (even inside other defs or classes)
# - classes
# - filenames
# Warns about files it cannot open.
@toritori0318
toritori0318 / bench.txt
Created June 1, 2012 17:27
node.js template engine benchmark
#############################################################################
# simple_server.js
% ./ab -c 10 -n 5000 http://127.0.0.1:3000/
This is ApacheBench, Version 2.3 <$Revision: 1178079 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient)
Completed 500 requests
@toritori0318
toritori0318 / config
Created June 22, 2012 16:49
dynamodb crud script(App::Rad)
accessKeyId=xxxxxxxxxxxxxxxxxxxxxxx
secretAccessKey=yyyyyyyyyyyyyyyyyyyyyy
host=dynamodb.ap-northeast-1.amazonaws.com
@toritori0318
toritori0318 / deploy.pl
Created June 22, 2012 16:50
deploy script (App::Rad)
use strict;
use warnings;
use App::Rad;
App::Rad->run();
# 初期化処理
sub setup {
my $c = shift;
@toritori0318
toritori0318 / config.yaml
Created July 21, 2012 19:28
growthforecastの複合グラフ作るスクリプト
---
host: localhost:5125
# 指定するとフィルタがかかる
#service_name: hogehoge
#section_name: fugafuga
# グラフデータのデフォルト値
#graph_data:
# sumup: 1 # 合計値を表示するかどうか?