外部ファイルのcssの情報を取る
何回やってもわすれるんだ...
document.styleSheets
ていうか、この方のブログがすごくよくまとまってるから、それをみたほうがよい
http://blog.37to.net/2009/04/javascriptcss_from_k/
cakePHP 1.3とbackbone.jsの連携でハマった
すげーハマった。
backbone.jsのsaveメソッドでモデルの変更内容をpostして保存しようとしたんだけど、
cakePHP側で$this->params['form']にも$this->dataにも$this->params['data']にもどこにも入ってこない。
Backbone.syncの内容をdumpしたりして、
ようやく解決。
Backbone.syncだと、
リクエストをapplication/jsonでおくっちゃうから、cakePHP側で取れてなかった。
なんか正規の取り方ってあるんでしょうか。
結局はコンポーネント内でRequestHandlerをcomponentsに設定して、
以下のようにして$this->dataで取れるようにした。
if($this->RequestHandler->requestedWith('json')){ $json = json_decode(trim(file_get_contents('php://input'))); $controller->data = $json; }
これ、みんなハマってないのかな?
swfmillをlionにいれた
とりあえず
依存系
sudo port install libxslt sudo port install libpng sudo port install freetype sudo port install wget
いれて、swfmill実行すると
dyld: Library not loaded: /usr/local/lib/libpng12.0.dylib Referenced from: /usr/bin/swfmill Reason: image not found Trace/BPT trap: 5
と出てうごかない。
find /usr -name "libfreetype*"
で探すと、
/usr/X11/lib/libfreetype.6.dylib
にあった。
もう一回実行すると
dyld: Library not loaded: /usr/local/lib/libpng12.0.dylib
といわれた。きりがないので、
sudo ln -s /usr/X11/lib /usr/local/lib
とした。
そしたらうごいた。
herokuでFacebookアプリ
なんか公式の通りやったけどいまいちうまくいかず...。
以下で大丈夫でそう。
※herokuアカウントは持ってる前提
※Developerサイトで登録はheroku(node.js)ですませておく
1.ローカルにディレクトリ作る
2.gitのレポジトリつくる
$ git init $ git remote add heroku git@heroku.com:************.git $ git clone git@heroku.com:************.git -o heroku
これで、あとは適当に編集して、
$ git add . $ git commit -m "Tekitou" $ git push heroku master
これだと
$ git push heroku master To git@heroku.com:************.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'git@heroku.com:************.git' To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes (e.g. 'git pull') before pushing again. See the 'Note about fast-forwards' section of 'git push --help' for details.
こうなった。
なので
$ git pull git@heroku.com:************.git
こうして
$ git push heroku
これでできた。
しらなかった
改行コードなんでもオッケーにする
ini_set('auto_detect_line_endings', 1);