Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-settings.php on line 472

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-settings.php on line 487

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-settings.php on line 494

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-settings.php on line 530

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-includes/cache.php on line 103

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-includes/query.php on line 21

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-includes/theme.php on line 623

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/custom_posts/custom_posts.php on line 22

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/pukiwiki.php on line 46

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/pukiwiki.php on line 67

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/pukiwiki.php on line 75

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/pukiwiki.php on line 92

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/modPukiWiki/class/PukiWikiRender.php on line 70

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/modPukiWiki/class/PukiWikiElement.php on line 181

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/modPukiWiki/class/PukiWikiElement.php on line 538

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/modPukiWiki/class/PukiWikiElement.php on line 695

Deprecated: Assigning the return value of new by reference is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/modPukiWiki/class/PukiWikiElement.php on line 1087

Deprecated: Function ereg() is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/wp-ban/wp-ban.php on line 112

Deprecated: Function ereg() is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/wp-ban/wp-ban.php on line 112

Deprecated: Function ereg() is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/wp-ban/wp-ban.php on line 112

Deprecated: Function ereg() is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/wp-ban/wp-ban.php on line 112

Deprecated: Function ereg() is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/wp-ban/wp-ban.php on line 112

Deprecated: Function ereg() is deprecated in /home/users/1/fool.jp-ichi/web/blog/wp-content/plugins/wp-ban/wp-ban.php on line 112
おれせか

おれせか

なんかそれっぽいのをうにうに。

rakなんかしたときに「invalid byte sequence in UTF-8」みたいなこと言われたら、たぶんファイルがutfじゃないんでしょうよ、ということでとりあえず適当にutfに変換するとかなんとか。

  • jsファイルまとめて変換の場合(mac os x)
    find . -type f -name \*.js -print0 | xargs -0 nkf -w --overwrite
    

-print0 とか -0 忘れないように。
Macでfindとxargsをパイプで繋いで使うなら -print0 と -0 を必ず使うメモ - kanonjiの日記

ほんとはまとめて変換しないでちゃんと対象ファイルしっかり選んで変換したほうがきっといいよ!

PAGETOP

最近お仕事でtitaniumでのiphoneアプリ開発などちょいちょいしております。

で、最初はフツーにjavascriptをガリガリ書いてたのですが、coffeescriptなるものの噂を聞いたので使ってみるとこりゃいいやということに。

で、こっから本題。

で、coffeescriptってjsにコンパイルしなきゃいけないんですが毎度叩くのもなんだかなーて感じだったのでwatchrていうgemがあったのでこいつをインストール。

  • coffee_compile.watchr
    coffee_files = %r{^(.*\.coffee)$}
    
    watch(coffee_files) do
      cmd = "coffee --bare --compile ."
      puts "$#{cmd}"
      `#{cmd}`
    end

で、下記で実行。

watchr -d coffee_compile.watchr

しかし、追加ファイル感知してくれないとか、ファイル削除のイベントがなぜか止まらないとかあったので、結局使わなくなったり。

というわけで、毎度コンパイル叩くことにしたんだけど、

ちょっとは楽しようということでRakefile書いた

  • Rakefile
    task :default => ["coffee:compile"]
    
    def show_and_cmd(title, cmd = nil)
      cmd = title if cmd.nil?
      puts %{===== #{title} =====}
      puts %{$#{cmd}}
      system cmd
    end
    
    namespace :coffee do
      desc "Compile coffee scripts"
      task :compile do
        show_and_cmd 'compile coffee', %{coffee --bare --compile .}
      end
    
      desc "Watch coffee scripts"
      task :watch do
        watchr_file = 'coffee_compile.watchr'
        show_and_cmd 'watching files', %{watchr -l #{watchr_file}}
        puts ''
        show_and_cmd 'watch coffee', %{watchr -d #{watchr_file}}
      end
    end

これで、

rake #または rake coffee:compile

でコンパイルできるぜー。ひゃっほい。

いちおう念のため、watchrのほうも

rake coffee:watch

でいけるようにしてたり。

あと、titaniumのほうも

titaniumって普段はbuildやシミュレータの起動をtitanium developerてアプリを立ち上げといて、その中にあるボタンをぽちっとなするわけなんですが、毎度これ起動しとくのヤダナーと思ってたんですよ。

と思ってたら、なんかコマンドラインで叩けるらしいじゃないですか。
コマンドラインでTitanium Mobileを操作する - kaz_konno’ blog: walkthisway

やったー!

というわけでRakefile修正。

task :default => ['coffee:compile', 'titanium:run']

def show_and_cmd(title, cmd = nil)
  cmd = title if cmd.nil?
  puts %{===== #{title} =====}
  puts %{$#{cmd}}
  system cmd
end

namespace :titanium do
  desc "build & run on iphone simulator"
  task :run do
    show_and_cmd 'build & run', '/Library/Application\ Support/Titanium/mobilesdk/osx/1.7.X/iphone/builder.py run ./'
  end
end

namespace :coffee do
  desc "Compile coffee scripts"
  task :compile do
    show_and_cmd 'compile coffee', %{coffee --bare --compile .}
  end
  desc "Watch coffee scripts"
  task :watch do
    watchr_file = 'coffee_compile.watchr'
    show_and_cmd 'watching files', %{watchr -l #{watchr_file}}
    puts ''
    show_and_cmd 'watch coffee', %{watchr -d #{watchr_file}}
  end
end

namespace :git do
  desc %{Show "git diff -- *.coffee"}
  task :diff do
    show_and_cmd 'git diff *.coffee', 'git diff -- \*.coffee'
  end
end

「rake」で以下まとめて出来るようになったよー。

  1. coffeescriptのコンパイル
  2. titaniumのビルド
  3. iphone simulatorの起動

やったー!

#ちなみにRakefieの最後に書いてあるrake git:diffはcoffeeファイルの差分だけ見たくてよく使うコマンドだったのでついでに追加しといた。

PAGETOP

無くしたのは結局まだ見つかんないんだけどね(´・ω・`)

新たにまたIS03購入して使うことにしました。
電話番号やメアドは変わってません。

そして同期してなかったデータとかがだいぶすっとんでしまったので、今年に入って電話番号やらメアドを変更した方のデータがおそらく無くなってるかと。

というわけで、今年になって電話番号/メアド変えた方は再度ご連絡頂けるとありがたく。

よろしくおねがいしますー。

PAGETOP

Search