<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
		xmlns:xhtml="http://www.w3.org/1999/xhtml"
>

<channel>
	<title>Aerialarts &#187; tips</title>
	<atom:link href="http://aerial.st/tags/tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://aerial.st</link>
	<description></description>
	<lastBuildDate>Tue, 15 May 2012 01:27:51 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://aerial.st/tags/tips/feed/" />
		<item>
		<title>rubygemsをバージョンを指定して更新</title>
		<link>http://aerial.st/archive/2011/06/09/update-rubygems-with-specific-version/</link>
		<comments>http://aerial.st/archive/2011/06/09/update-rubygems-with-specific-version/#comments</comments>
		<pubDate>Thu, 09 Jun 2011 02:00:25 +0000</pubDate>
		<dc:creator>ikm</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[gem]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://aerial.st/?p=1059</guid>
		<description><![CDATA[メモ。 gem install rubygems-update -v update_rubygems バージョンの一覧はrubygems.orgなどで確認するとよい。]]></description>
		<wfw:commentRss>http://aerial.st/archive/2011/06/09/update-rubygems-with-specific-version/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://aerial.st/archive/2011/06/09/update-rubygems-with-specific-version/" />
	</item>
		<item>
		<title>__FILE__と$0</title>
		<link>http://aerial.st/archive/2011/04/12/__file_-and-dollar-zer/</link>
		<comments>http://aerial.st/archive/2011/04/12/__file_-and-dollar-zer/#comments</comments>
		<pubDate>Tue, 12 Apr 2011 13:47:26 +0000</pubDate>
		<dc:creator>ikm</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://aerial.st/?p=997</guid>
		<description><![CDATA[FILE はそのコードが書かれているファイルを指し、$0は起動されたスクリプトを指す。 「FILE は実行中のプログラムのファイル名」が詳しい。 先程の記事に載せたgistではこれを利用してサンプルプログラムを末尾に記述している。]]></description>
		<wfw:commentRss>http://aerial.st/archive/2011/04/12/__file_-and-dollar-zer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://aerial.st/archive/2011/04/12/__file_-and-dollar-zer/" />
	</item>
		<item>
		<title>コマンドラインアプリ作成にちょっと便利なStringの拡張</title>
		<link>http://aerial.st/archive/2011/04/12/string-extra-supporting-cli-apps/</link>
		<comments>http://aerial.st/archive/2011/04/12/string-extra-supporting-cli-apps/#comments</comments>
		<pubDate>Tue, 12 Apr 2011 13:31:15 +0000</pubDate>
		<dc:creator>ikm</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://aerial.st/?p=992</guid>
		<description><![CDATA[githubをうろうろしていたら「なるほど」と思ったコードを見つけたのでメモっておく。 get-twitter-oauth-token / bin / get-twitter-oauth-token （gistじゃないので残念ながら埋め込むことができない。コピペするのも微妙なのでリンクだけ提示しておく） これは@jugyoさん作のコマンドラインからTwitterのOAuthのアクセストークンと秘密鍵を取得するスクリプトで、openコマンドを使ってるあたり多分Mac専用なんだと思う（Linuxとかでもあるのかな？）。 なるほどなーと思ったのはStringを拡張しているcolorとaskという二つのメソッド。 colorはその名のとおり文字列に色をつけるもので、引数numにはANSIエスケープシーケンス（？）で指定できる色の番号を渡す（「bashのプロンプトに色をつける」などを参照。zshでもいける）。 もうひとつのaskはユーザからの入力を受け付けを表示するもので、レシーバの文字列を印字してから入力された内容を返す。凄く短いメソッドだけど、これひとつだけで可読性が向上するから感動してしまった。 ただこれだとパスワードの入力もみえてしまうので、sttyを使って入力中の文字列を表示しないメソッドもあったほうが便利だと思い、ちょっと書いてみた。 ask_passwordなんて長ったらしいけど、パスワードはそうそう聞くものでもないしまぁいいかな、と。askとcolorはそのまま拝借した。これがあるだけでコマンドラインアプリがちょっと書きやすくなるんじゃないかと思う。]]></description>
		<wfw:commentRss>http://aerial.st/archive/2011/04/12/string-extra-supporting-cli-apps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://aerial.st/archive/2011/04/12/string-extra-supporting-cli-apps/" />
	</item>
		<item>
		<title>ChromeでWeb版Belugaのテキスト入力欄をリサイズ可能に</title>
		<link>http://aerial.st/archive/2011/04/07/make-resizable-textarea-of-beluga-with-google-chrome/</link>
		<comments>http://aerial.st/archive/2011/04/07/make-resizable-textarea-of-beluga-with-google-chrome/#comments</comments>
		<pubDate>Thu, 07 Apr 2011 12:59:12 +0000</pubDate>
		<dc:creator>ikm</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[googlechrome]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://aerial.st/?p=990</guid>
		<description><![CDATA[Web版Belugaのテキスト入力欄はデフォルトでリサイズ不可になっていて使いづらい。というわけでGoogle Chromeのユーザースタイルシートを使ってこの設定を上書きした。 Mac OSXではGoogle Chromeのユーザースタイルシートは~/Library/Application\ Support/Google/Chrome/Default/User\ StyleSheets/Custom.cssにあるので、ここに次のように追記する。 textarea { resize: both !important; } これでtextareaは必ずリサイズ可能になる。]]></description>
		<wfw:commentRss>http://aerial.st/archive/2011/04/07/make-resizable-textarea-of-beluga-with-google-chrome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://aerial.st/archive/2011/04/07/make-resizable-textarea-of-beluga-with-google-chrome/" />
	</item>
		<item>
		<title>jQuery mobileでブラウザネイティブのselectダイアログを使う</title>
		<link>http://aerial.st/archive/2011/03/07/browser-native-select-dialog-on-jquery-mobile/</link>
		<comments>http://aerial.st/archive/2011/03/07/browser-native-select-dialog-on-jquery-mobile/#comments</comments>
		<pubDate>Mon, 07 Mar 2011 06:46:53 +0000</pubDate>
		<dc:creator>ikm</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[jquerymobile]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://aerial.st/?p=975</guid>
		<description><![CDATA[jQuery mobileでselect要素を使うとbodyの後部に選択ダイアログ用のdiv要素を追加してそれっぽく表示してくれる（デモ）。 ただAjaxで動的にoption要素を生成するような場合だとjQuery mobileの初期化に行われるDOMツリーの書き換えのタイミングと合わなくて、意図したとおりにoption要素に追加したものがダイアログに表示されなかったりする。 こういうときはとりあえずselect要素にdata-native-menu="true"を追加すれば、ブラウザネイティブの選択ダイアログが使われるようになるので、動的にoptionを追加した場合にも追従できる。 &#60;select name=&#34;fruit&#34; data-native-menu=&#34;true&#34;&#62; &#60;option&#62;Apple&#60;/option&#62; &#60;option&#62;Orange&#60;/option&#62; &#60;option&#62;Banana&#60;/option&#62; &#60;/select&#62; あまり見た目は良くないかもしれないけど、応急処置ということであれば十分かと思う。]]></description>
		<wfw:commentRss>http://aerial.st/archive/2011/03/07/browser-native-select-dialog-on-jquery-mobile/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://aerial.st/archive/2011/03/07/browser-native-select-dialog-on-jquery-mobile/" />
	</item>
		<item>
		<title>watchrでautospecみたいなこと</title>
		<link>http://aerial.st/archive/2011/01/21/watchr-for-autospec-like/</link>
		<comments>http://aerial.st/archive/2011/01/21/watchr-for-autospec-like/#comments</comments>
		<pubDate>Fri, 21 Jan 2011 11:50:47 +0000</pubDate>
		<dc:creator>ikm</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[rspec]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://aerial.st/?p=953</guid>
		<description><![CDATA[watchrで更新のあったファイルに対してrspecを実行する方法。 secondlifeさんの記事を読んで、取り急ぎやってみた。 $ gem install watchr $ gem install ruby-fsevent # Mac OSXの場合 $ gem install rev # Linux/*BSDの場合 $ cd （RAILSアプリのルートディレクトリ） $ vi spec.watchr watch('app/(.*)\.rb') { &#124;md&#124; system("ruby script/spec spec/#{md[1]}_spec.rb") } watch('spec/(.*)_spec\.rb') { &#124;md&#124; system("ruby script/spec #{md[0]}") } $ watchr spec.watchr autospecより汎用性があって便利かも。 追記 Rails3だとbundle exec rspecを使うのでこんな感じ？ watch('app/(.*)\.rb') { &#124;md&#124; system("bundle exec rspec spec/#{md[1]}_spec.rb") } watch('(lib/.*)\.rb') { &#124;md&#124; system("bundle exec rspec spec/#{md[1]}_spec.rb") } watch('(spec/.*)_spec\.rb') { &#124;md&#124; system("bundle exec rspec #{md[0]}") }]]></description>
		<wfw:commentRss>http://aerial.st/archive/2011/01/21/watchr-for-autospec-like/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://aerial.st/archive/2011/01/21/watchr-for-autospec-like/" />
	</item>
		<item>
		<title>MeCabをhomebrewでインストールする</title>
		<link>http://aerial.st/archive/2011/01/17/install-mecab-with-homebrew/</link>
		<comments>http://aerial.st/archive/2011/01/17/install-mecab-with-homebrew/#comments</comments>
		<pubDate>Mon, 17 Jan 2011 02:39:18 +0000</pubDate>
		<dc:creator>ikm</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[homebrew]]></category>
		<category><![CDATA[mecab]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://aerial.st/?p=944</guid>
		<description><![CDATA[brew install mecab brew install mecab-ipadic MacPortsでインストールするとmecabrcに書かれているdicdirを書き換える必要があったりするけど、homebrewでインストールした場合にはその必要はない。]]></description>
		<wfw:commentRss>http://aerial.st/archive/2011/01/17/install-mecab-with-homebrew/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://aerial.st/archive/2011/01/17/install-mecab-with-homebrew/" />
	</item>
		<item>
		<title>Moduleでextend self</title>
		<link>http://aerial.st/archive/2010/11/22/module-extend-self/</link>
		<comments>http://aerial.st/archive/2010/11/22/module-extend-self/#comments</comments>
		<pubDate>Mon, 22 Nov 2010 06:21:15 +0000</pubDate>
		<dc:creator>ikm</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://aerial.st/?p=817</guid>
		<description><![CDATA[なるほどなーと思ったのでメモ。 Moduleのクラスメソッドを作りたいとき、次のような方法もある。 module Foo extend self def some_method puts "Hello!" end end 実行すると次のようになる。 irb> Foo.some_method #=> Hello! module_methodだと取りこぼしがあり得るのでこの方法なら安心。 もしプライベートメソッドを作りたければprivateを付ければいい（これは結構いい）。 関数的な処理をまとめるだけでSingletonパターンを使うほどではないっていうときにきっと便利。 聞きかじったことをメモしてるだけなのでクラスでincludeしたらどうなるのかは気になるところだけど、多分インスタンスメソッドとしてもsome_methodが使えるんだろうな。]]></description>
		<wfw:commentRss>http://aerial.st/archive/2010/11/22/module-extend-self/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://aerial.st/archive/2010/11/22/module-extend-self/" />
	</item>
		<item>
		<title>ファイルの更新を検知してコマンドを実行するRubyスクリプト</title>
		<link>http://aerial.st/archive/2010/11/11/auto-exec-command-when-file-modified/</link>
		<comments>http://aerial.st/archive/2010/11/11/auto-exec-command-when-file-modified/#comments</comments>
		<pubDate>Thu, 11 Nov 2010 06:29:04 +0000</pubDate>
		<dc:creator>ikm</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://aerial.st/?p=792</guid>
		<description><![CDATA[lessとかautospecとかはファイルの更新を検知してコマンドを実行してくれるけど、それっぽいのを任意のファイルとコマンドについてやりたくなったのでRubyで書いてみた。 コマンド名は適当にjamieとする（誰かすでに書いてあるだろうものに名前をつけるのもおこがましいけど）。次のような感じで使う： $ jamie Usage: jamie file command $ jamie ~/.zsh_history "echo 'こんにちは！こんにちは！'" やっつけでつくったのでクオリティとかは気にしない。 追記 (2010-11-12) 動機は、autospecだとそのときテストしていたspecファイルが通ったら自動で全部のspecファイルをテストするので、バッチ処理などの独立性の高いスクリプトを書いてるときにちょっとウザったかったこと。なので指定した一つのspecファイルを継続的にテストしてくれる仕組みが欲しかった。 で、思わぬ副作用として得られたのが、テスト対象のspecファイルが文法エラーなどで例外を吐いてもこのスクリプトだとループの処理自体は止まらない。autospecだと止まってしまっていたので、全体のテストの実行時間が長い現状ではなかなか辛いものがあった。]]></description>
		<wfw:commentRss>http://aerial.st/archive/2010/11/11/auto-exec-command-when-file-modified/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://aerial.st/archive/2010/11/11/auto-exec-command-when-file-modified/" />
	</item>
		<item>
		<title>Gitで無視するファイルを設定する</title>
		<link>http://aerial.st/archive/2010/02/01/gitignore/</link>
		<comments>http://aerial.st/archive/2010/02/01/gitignore/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 15:12:38 +0000</pubDate>
		<dc:creator>ikm</dc:creator>
				<category><![CDATA[git]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://aerial.st/?p=611</guid>
		<description><![CDATA[gitの操作（addやstatus）で特定のファイルを無視するには、リポジトリのルートディレクトリに.gitignoreファイルを設定すればよい。 ただし以下の点に注意。 .gitignore自体をadd/commitしないと効果は現れない 一度commitしたファイルはあとから無視設定をしても効果がない（一旦リポジトリから削除する必要がある）（gitignoreでハマる） 以下、自分の設定内容をメモっておく。 Xcodeで作成したプロジェクト *.DS_Store profile build/* *.pbxuser *.mode1v3 buildディレクトリ以下の更新内容は無視して構わない（と以前どこかで読んだ）。あとはnib/xib以下にできるバックアップファイルとか、Finderの設定ファイルとか。 Stack Overflowにもいろいろな例があがっている（そこからgistを作った人もいる）。 Rails Railsアプリをgitで管理するときのやり方を参考にするとよさそう。]]></description>
		<wfw:commentRss>http://aerial.st/archive/2010/02/01/gitignore/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://aerial.st/archive/2010/02/01/gitignore/" />
	</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/


Served from: aerial.st @ 2012-05-23 02:08:04 -->
