Skip to content

Instantly share code, notes, and snippets.

View tokuhirom's full-sized avatar
💖
Focusing

Tokuhiro Matsuno tokuhirom

💖
Focusing
View GitHub Profile
@tokuhirom
tokuhirom / gist:34587
Created December 11, 2008 02:46
undefined
repl(main)> my $search_str = 'かずほ';
$VAR1 = 'かずほ';
repl(main)> my $url = 'http://example.com/search?q=' . (($a = $search_str) =~ s/([^0-9A-Za-z_.!~*'()-])/'%' . uc(unpack('H2', $1))/eg && $a);
$VAR1 = 'http://example.com/search?q=%E3%81%8B%E3%81%9A%E3%81%BB';
use strict;
use warnings;
package mt;
use Module::Compile -base;
use Text::MicroTemplate qw/render_mt/;
sub pmc_compile {
my ($class, $source, $extra) = @_;
my @vars = do {
Template error: Use of uninitialized value in substitution (s///) at /home/tokuhirom/project/mobirc/extlib/Text/MicroTemplate.pm line 338.
Template error: Use of uninitialized value in substitution (s///) at /home/tokuhirom/project/mobirc/extlib/Text/MicroTemplate.pm line 339.
Template error: Use of uninitialized value in substitution (s///) at /home/tokuhirom/project/mobirc/extlib/Text/MicroTemplate.pm line 340.
Template error: Use of uninitialized value in substitution (s///) at /home/tokuhirom/project/mobirc/extlib/Text/MicroTemplate.pm line 341.
Template error: Use of uninitialized value in substitution (s///) at /home/tokuhirom/project/mobirc/extlib/Text/MicroTemplate.pm line 342.
Use of uninitialized value in concatenation (.) or string at line 11 in template passed from /home/tokuhirom/project/mobirc/extlib/Text/MicroTemplate/File.pm at line 59.
----------------------------------------------------------------------------
9: <br />
-------------------------------------------------------------
sub strip_nl {
my $code = shift;
my $inner = do {
local $_MT = '';
local $_MT_T = '';
my @args = Devel::Caller::Perl::called_args(0);
$code->(@args);
$_MT;
};
$inner =~ s/^\s+//smg;
sub strip_nl (&) {
my $code = shift;
my $mtref = do {
no strict 'refs';
${__PACKAGE__ . '::_MTREF'};
};
my $before = $$mtref;
$$mtref = '';
$code->();
$$mtref =~ s/^\s+//smg;
sub strip_nl (&) {
my $code = shift;
global_context->mt->filter(sub {
s/^\s+//smg;
s/[\r\n]//g;
})->($code);
}
diff --git a/lib/App/Mobirc/Web/Base.pm b/lib/App/Mobirc/Web/Base.pm
index 6fab4c5..a4ee2bb 100644
--- a/lib/App/Mobirc/Web/Base.pm
+++ b/lib/App/Mobirc/Web/Base.pm
@@ -2,6 +2,7 @@ package App::Mobirc::Web::Base;
use strict;
use warnings;
use base qw/Exporter/;
+use Encode qw/decode_utf8/;
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..567609b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+build/
diff --git a/PTYSession.m b/PTYSession.m
index 65535a9..7955cf4 100644
--- a/PTYSession.m
diff --git a/src/core/Makefile b/src/core/Makefile
index c00f17c..e89dfc9 100644
--- a/src/core/Makefile
+++ b/src/core/Makefile
@@ -7,6 +7,7 @@ CFLAGS+= -fPIC \
-I${IRSSI_INCLUDE} \
-I${IRSSI_INCLUDE}/src \
-I${IRSSI_INCLUDE}/src/core \
+ `pkg-config --cflags glib-2.0` \
`pkg-config --cflags loudmouth-1.0` \