Skip to content

Instantly share code, notes, and snippets.

View Songmu's full-sized avatar

Masayuki Matsuki Songmu

View GitHub Profile
<?php
require_once('MDB2.php');
/*
MDB2PLUS is wrapper class of MDB2.
Its interface is same as MDB2.
(Some method doesn't work(eg. MDB2::isResult). But, these are
not too necessary.)
When occurring error, it not returns PEAR::Error object,
@Songmu
Songmu / japanese.holiday.js
Created November 17, 2010 11:56
祝日を求めるjavascript
//祝日を求めるjavascript 昔書いたやつ
// Ported From Calendar::Japanese::Holiday.pm
"use strict"
var FurikaeStr = '振替休日';
var staticHolidays = [
// 4/29 みどりの日 : 昭和の日 変更
// みどりの日は5/4に移行
{
@Songmu
Songmu / japanese.date.js
Created November 17, 2010 11:58
Dateをがんばって継承してみようとしたメモ
/* Dateをがんばって継承してみようとしたメモ
* based on:
* Prototypal Inheritance by Douglas Crockford
* http://javascript.crockford.com/prototypal.html
*/
//Dateを拡張していろいろはまったので
//http://nanto.asablo.jp/blog/2005/10/24/118564
//http://nanto.asablo.jp/blog/2006/10/18/566348
//http://groups.google.co.jp/group/comp.lang.javascript/browse_thread/thread/7ef79470e8fba7a5/e8fb95e4a7693e47
//http://d.hatena.ne.jp/send/20070622/p1
@Songmu
Songmu / twg.plee
Created December 16, 2010 00:31
EmEditor macro for get twitter timeline
#language="PerlScript";
our $Window;
my $document = $Window->document;
use strict;
use warnings;
use utf8;
use Data::Dumper;
use YAML::Syck;
@Songmu
Songmu / twp.plee
Created December 16, 2010 00:31
EmEditor macro to post twitter msgs
#language="PerlScript"
our $Window;
use strict;
use warnings;
use utf8;
use YAML::Syck;
use Encode;
use Net::Twitter;
@Songmu
Songmu / nw7_barcode.pl
Created December 16, 2010 10:57
make barcode
#!/usr/bin/perl
use strict;
use warnings;
use GD::Barcode::NW7;
use Math::CheckDigits;
my $bcd = qq{123432456};
my $cd = Math::CheckDigits->new(
modulus => '10',
@Songmu
Songmu / string_ramdom_sample.pl
Created December 20, 2010 09:00
String::Randomのサンプル
#!/usr/bin/perl
use String::Random;
use utf8;
use Encode qw/ encode decode /;
my $rand_maker = String::Random->new;
print encode('cp932', String::Random->rand_maker->randregex('[ーァ-ヶ]{3,6}')) ."\n" for 1..5;
@Songmu
Songmu / swfmill-0.3.1.patch
Created June 2, 2011 11:10
swfmill-0.3.1.patch
diff -ur ./src/Makefile.am ../swfmill-0.3.1.patch/src/Makefile.am
--- ./src/Makefile.am 2010-07-15 09:30:13.000000000 +0900
+++ ../swfmill-0.3.1.patch/src/Makefile.am 2011-06-02 19:46:54.000000000 +0900
@@ -74,7 +74,7 @@
$(SIMPLE_DIALECT_GENERATEDSOURCES): $(SIMPLE_DIALECT_GENERATEDSOURCES:.cpp=.xml) xslt/assemble.xsl $(SIMPLE_DIALECT_XSLTS)
xsltproc $(srcdir)/xslt/assemble.xsl $< > $(@:.cpp=.xsl)
- echo "#include \"xslt/xslt.h\"" > $@
+ echo "#include \"/usr/include/libxslt/xslt.h\"" > $@
echo "const char *xslt_simple = " >> $@
@Songmu
Songmu / cntl
Created July 6, 2011 15:03
制御文字
[\x00-\x09\x0B\x0C\x0E-\x1F\x7F]
@Songmu
Songmu / gist:1364512
Created November 14, 2011 17:24 — forked from nazoking/gist:1173662
stone 起動スクリプト(cent os)
#!/bin/bash
# /etc/init.d/stone として保存する。
# 設定ファイルは /etc/stone.conf
# chkconfig: 345 98 02
# description: stone
. /etc/rc.d/init.d/functions
if [ -f /etc/sysconfig/stone ]; then