Skip to content

Instantly share code, notes, and snippets.

@syohex
syohex / flow.pl
Created May 31, 2011 09:17
clowの出力結果から blockdiag形式に変換する
#!/usr/bin/env perl
use strict;
use warnings;
package App::cflow2blockdiag;
use Carp ();
use File::Which ();
sub new {
my ($class, $files_ref, $ignores_regexp) = @_;
@syohex
syohex / prompt.pl
Created June 24, 2011 13:29
Failed IO::Prompt::prompt in Perl-5.14
#!perl
use strict;
use warnings;
package Test;
use IO::Prompt;
sub test {
my $input = prompt "input >> ";
print "$input\n";
@syohex
syohex / t0501_min.output
Created June 29, 2011 14:27
Object file create by v850-gcc (4.6.1)
t0501_min.o: file format elf32-v850
Disassembly of section .text:
00000000 <_func2>:
0: d0 3a shl 16, r7
2: b0 3a sar 16, r7
4: 60 3a cmp 0, r7
@syohex
syohex / get-shit-done.pl
Created July 4, 2011 13:54
Perl版 get-shit-done
#!perl
package App::GetShitDone;
use strict;
use warnings;
use Carp qw(croak);
my $HOSTS = '/etc/hosts';
my $START_TOKEN = '## start-gsd';
my $END_TOKEN = '## end-gsd';
@syohex
syohex / m32-sample.s
Created July 5, 2011 14:47
RX and m32c configurations of binutils-2.21 and gcc-4.6.1
sample.o: file format elf32-m32c
Disassembly of section .text:
00000000 <_null>:
0: f3 rts
00000001 <_return_zero>:
1: d9 00 mov.w:q #0,r0
@syohex
syohex / 04_lite.log
Created July 10, 2011 14:27
Amon2 2.41 test log
# Failed test at t/01_root.t line 15.
# got: '500'
# expected: '200'
# Cannot load configuration file: /private/var/folders/hB/hBvE9Tc7FLq+yh1HQlk9W++++TI/-Tmp-/NH5VxZtrW0/config/test.pl at /Users/syohei/.cpanm/work/1310307739.989/Amon2-2.41/t/300_setup/../../lib/Amon2/Config/Simple.pm line 12.
# Looks like you failed 1 test of 1.
# PSGI error: Cannot load configuration file: /private/var/folders/hB/hBvE9Tc7FLq+yh1HQlk9W++++TI/-Tmp-/NH5VxZtrW0/config/test.pl at /Users/syohei/.cpanm/work/1310307739.989/Amon2-2.41/t/300_setup/../../lib/Amon2/Config/Simple.pm line 12.
# Failed test 'GET /'
# at t/02_mech.t line 12.
@syohex
syohex / arm_linux_config
Created August 10, 2011 00:16
Linux 3.0.1 ARM configuration
#
# Automatically generated make config: don't edit
# Linux/arm 3.0.1 Kernel Configuration
#
CONFIG_ARM=y
CONFIG_MIGHT_HAVE_PCI=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
CONFIG_HAVE_SCHED_CLOCK=y
# CONFIG_ARCH_USES_GETTIMEOFFSET is not set
CONFIG_GENERIC_CLOCKEVENTS=y
@syohex
syohex / IO-Prompt-Simple.patch
Created September 20, 2011 14:17
IO::Prompt::Simpleの anyoneオプションの拡張
diff --git a/lib/IO/Prompt/Simple.pm b/lib/IO/Prompt/Simple.pm
index 5d5d4df..da1d7c3 100644
--- a/lib/IO/Prompt/Simple.pm
+++ b/lib/IO/Prompt/Simple.pm
@@ -13,7 +13,7 @@ sub prompt {
my ($message, $default, $opts) = @_;
_croak('Usage: prompt($message, [$default, $opts])') unless defined $message;
- my $dispaly_default = defined $default ? "[$default]: " : ': ';
+ my $display_default = defined $default ? "[$default]: " : ': ';
@syohex
syohex / bench.pl
Created October 5, 2011 15:19
List::UtilsBy::XSのベンチマーク
#!/usr/bin/env perl
use strict;
use warnings;
use List::UtilsBy;
use List::UtilsBy::XS;
use Benchmark qw(cmpthese);
use String::Random;
@syohex
syohex / md2html.pl
Created October 6, 2011 07:30
カレントディレクトリ以下の Markdown形式のファイルを HTMLに変換する
#!perl
use strict;
use warnings;
use File::Find;
use File::Basename;
use Text::Markdown qw(markdown);
find(\&md2html, '.');