Skip to content

Instantly share code, notes, and snippets.

View mix3's full-sized avatar

mix3@サタデーナイトフィーバー mix3

View GitHub Profile
@mix3
mix3 / MobileTplCompiler.pm.diff
Created June 27, 2011 05:16
MobaSiF用絵文字変換
--- pm/MobileTplCompiler.pm.orig 2011-06-27 14:10:08.000000000 +0900
+++ pm/MobileTplCompiler.pm 2011-06-27 14:11:08.000000000 +0900
@@ -180,6 +180,8 @@
my $saveFile = "$saveDir/$name.bin.$type";
my $text = readFile($srcName, $type);
+ $text = replace_emoji($text);
+
my $mtime2 = get_mtime($saveFile);
return if ($mtime < $mtime2);
@mix3
mix3 / show_replace_hash.pl
Created August 5, 2011 18:01
show_replace_hash.pl
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Encode;
my $sample = {
test1 => {
@mix3
mix3 / fwbench.pl
Created August 17, 2011 15:41
fwbench.pl
package Class;
sub new {
my $class = shift;
my $self = shift || {};
return bless $self, $class;
}
sub add {
my $self = shift;
@mix3
mix3 / eval_goto_bench.pl
Created August 22, 2011 09:07
eval_goto_bench.pl
use Benchmark qw(cmpthese timethese);
cmpthese timethese(100000, {
eval => sub {
eval {
die;
};
if($@){}
},
goto => sub {
@mix3
mix3 / fileopen_abbr.pl
Created August 23, 2011 15:01
perlのファイルオープンの例
#!/usr/bin/env perl
use strict;
use warnings;
# <> でopen無しに引数のファイルを読み取れる
while (<>) { print; }
@mix3
mix3 / gist:1513202
Created December 23, 2011 05:04
/etc/init.d/memcached_socket
@@ -12,15 +12,15 @@
# Source function library.
. /etc/init.d/functions
-PORT=11211
-USER=memcached
+#PORT=11211
+USER=apache
MAXCONN=1024
CACHESIZE=64
@mix3
mix3 / glob_sample.pl
Created December 27, 2011 11:04
glob sample
package Sample;
sub hello {
print "Hello\n";
}
1;
package main;
@mix3
mix3 / gist:1589242
Created January 10, 2012 14:04
Dancer::Plugin::Teng
package Dancer::Plugin::Teng;
BEGIN {
$Dancer::Plugin::Teng::VERSION = '0.1';
}
use strict;
use warnings;
use Dancer::Plugin;
use DBI;
@mix3
mix3 / gist:1907353
Created February 25, 2012 08:36 — forked from shin1ogawa/GDataCalendarExample.java
GDataOAuth2Example.java
import java.io.*;
import java.net.*;
public class GDataOAuth2Example {
static final String CLIENT_ID = "";
static final String CLIENT_SECRET = "";
static final String REDIRECT_URI = "urn:ietf:wg:oauth:2.0:oob"; // InstalledApplication
static final String SCOPES = "https://www.googleapis.com/auth/userinfo.profile"
@mix3
mix3 / IOCaptureTest.t
Created April 14, 2012 14:53
C output capture test
use strict;
use warnings;
use Test::More;
BEGIN { use_ok('IOCaptureTest') };
use Capture::Tiny qw/:all/;
my $output;