2007-12-01から1ヶ月間の記事一覧

Synergys with Growl

set theConfFile to "~/.synergy_home.conf" try set thePid to do shell script ("/bin/ps -x|grep synergys| grep -v grep|perl -ne '/^\\s*(\\d+)\\s+/;print $1;'") do shell script ("/bin/kill " & thePid) on error end try try -- 会社は有線 set is…

Mozilla.orgマークアップリファレンス

http://www.mozilla.org/contribute/writing/markup 訳:http://www.mozilla-japan.org/contribute/writing/markup.html適当に抜粋 一般構造 段落(パラグラフ):<p> と <div class="para"> 段落を分ける為ではなく囲む為に <p> 使用。 <div class="para"> は、<p> に許されていないブロックレベル要素を</p></div></p></div></p>…

Mozilla.org

マークアップリファレンス http://www.mozilla.org/contribute/writing/markup 訳:http://www.mozilla-japan.org/contribute/writing/markup.html http://www.mozilla.org/css/base/content.css /* mozilla.org Base Styles * maintained by fantasai * (cl…

Mailのインデックスの最適化

osx

% cd /Users/oppara/Library/Mail % cp Envelope\ Index Envelope\ Index.bak % sqlite3 Envelope\ Index vacuum

新しもの好きのダウンロード RSS

車輪? Hatena::Rss http://r.hatena.ne.jp/oppara/ Firefox rss.cgi #!/path/to/perl use strict; use warnings; use lib( './lib' ); use Encode; use CGI::Carp qw( fatalsToBrowser ); use Data::Dumper; use XML::RSS; use WWW::Atarashimonozuki::Scra…

Time::Piece->strptime()

時には、setlocaleしとかないと怒られることもある Error parsing time at /path/to/Time/Piece.pm line 470. #!/path/to/perl use Time::Piece; use POSIX qw( strftime locale_h); setlocale( LC_TIME, 'C' ); my $date = 'Mon Dec 17 22:19:36 2007 GMT';…

タイムゾーンゲット

http://www.misao.gr.jp/~koshian/?20050819S1 #!/path/to/perl use POSIX qw( strftime ); ( my $z = strftime( '%z', localtime) ) =~ s/(\d\d)(\d\d)/$1:$2/; print strftime( '%Y-%m-%dT%H:%M:%S', localtime ), $z, "\n";

mbまわり

php

php.iniまわり mbstring.language = Japanese mbstring.internal_encoding = UTF-8 mbstring.encoding_translation = 0 mbstring.http_input = pass mbstring.http_output = pass mbstring.detect_order = ASCII,JIS,UTF-8,EUC-JP,SJIS mbstring.substitute_…

IEの戻るボタンを有効にする設定

php

パイプ

sh

pipe.sh #!/bin/sh if [ -p /dev/stdin ]; then cat - fi % echo 'hoge'|/path/to/pipe.sh

ユーザー追加

#!/bin/sh USER=$1 PASS=$2 USERADD=`which useradd` PERL=`which perl` if [ $# -lt 2 ]; then cat <

SessionComponent::setFlash(), SessionHelper::flash()

SessionComponent::setFlash($message, $layout = 'default', $params = array(), $key = 'flash');[br] SessionHelper::flash($key = 'flash'); デフォルト controller内で $this->Session->setFlash( 'Message!!' ); view内で if ( $session->check( 'Mess…