2007-01-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…

モック

知り合いの知り合いの陶芸家に、ロボ達の餌入れをオーダーするためにモックをつくる... できた。

bindkey

zsh

設定しないと環境変数 EDITORやVISUALを参照するので設定 export SVN_EDITOR='/opt/local/bin/vim' export EDITOR='/opt/local/bin/vim'bindkey -e コマンド履歴の検索機能 bindkey "^P" history-beginning-search-backward-end bindkey "^N" history-beginn…

depotmapまわり

svk

基本 ~/.svk/をhogeデポットとして登録 % svk depotmap --init /Users/oppara/hogeをhogeデポットとして登録 % svk depotmap hoge /Users/oppara/hoge hogeデポット削除 % svk depotmap -d hoge デポット一覧 % svk depotmap -l mirror % svk mirror svn+ssh…

カーソル上の関数のマニュアルを表示

let g:php_man_url = 'http://jp.php.net/manual-lookup.php?lang=ja&pattern=' function! PhpMan() let b:word = expand( "<cword>:p" ) let $url = g:php_man_url.b:word " echo $url !open -a safari $url endfunction nnoremap <silent> <leader>h :call PhpMan()<CR></cr></leader></silent></cword>

開いてるファイルをSafariで確認

vim

let g:localhost = 'http://oppara/' let g:docroot = '/Users/oppara/Sites/' function! RunSafari() :write let b:fullpath = expand( "%:p" ) let $url = substitute( b:fullpath, g:docroot, g:localhost, '' ) "echo $url !open -a safari $url endfunc…

ロボ

1号(カリ) 2号(マリ(ヨーゼフ)) カリ出現

MacIE5

textareaで入力した文字が化ける。 日本語を入力した場合のカーソールの位置が変 textarea { font-family:'メイリオ',Meiryo,'ヒラギノ角ゴ Pro W3','Hiragino Kaku Gothic Pro','MS Pゴシック', Osaka, sans-serif; leter-spaceng: 0; } charset=utf-8で…

16進表示

cmd

% echo -n a |hexdump -C

モジュールのインストール先

% perldoc -ml Hoge

よくわからんマシンにモジュールをインストール

適当なディレクトリにインストール perl Makefile.PL PREFIX=/path/to/want localeエラー perl -vとかすると以下のエラーが出る perl: warning: Please check that your locale settings: LANGUAGE = "ja_JP.SJIS", LC_ALL = "ja_JP", LANG = "ja_JP" are su…

ドロップシャドウ

css

body { padding:10px; background: url( bg.gif ); } div.shadow { margin: 2px 0 0 2px; float: left; margin-left: 10px; } * html div.shadow { filter:progid:DXImageTransform.Microsoft.AlphaImageLoader( src=shadow.png,sizingMethod=scale ); } htm…

入力関連

FAQ Happy Hacking Keyboard 英語配列用(101104.reg)を使用 Keylay 21 for WindowsXP ctl → 左windows ctl → 右windows CmdSpace ctl + spaceで切替え

HEM CORPORATION PRECIOUS CHANDAN HEM CORPORATION All seasons HEM CORPORATION MAGNOLIA Shrinivas SUGANDHALAYA SATYA NATURAL PREMSAGAR AUROBINDO

term != "screen"

screenでvimがこける。 % echo $TERM xterm-color % screen % echo $TERM vt100 % vi E437: terminal capability "cm" required Press ENTER or type command to continueなので ~/.screenrc term ansi ~/.vimrc " if &term =~ "screen" if &term !~ "xterm-…

インストール

zsh

$ curl -O http://www.zsh.org/pub/zsh-4.3.4.tar.gz $ tar xzvf zsh-4.3.4.tar.gz $ ./configure --enable-multibyte --enable-locale $ make $ sudo make install $ vi /etc/shells $ cat /etc/shells # List of acceptable shells for chpass(1). # Ftpd …

ドロップレットでファイルを新規タブで開く

splhack: vim7.1.100 property CR : ASCII character of 13 property ESC : ASCII character of 27 on open theList set thePath to POSIX path of (item 1 of theList as string) --display dialog thePath tell application "Vim" to activate tell applic…

SVN::Web

SVN-Web-0.53 - Subversion repository web frontend - metacpan.org インストール 素のperlは面倒そうだったので、portのperlを使用。 $ cd ~/src $ curl -O http://search.cpan.org/CPAN/authors/id/A/AS/ASH/SVN-Placeholder-0.00001.tar.gz $ tar xzvf S…

夏休みの宿題

AGORA Pop-up Goal 畳めん...