2012年6月30日土曜日

キーボードショートカット操作でアプリwindowを操作するmac app「Spectacle」

「Spectacle」のmacアプリがいい感じです。

macでキーボードはなさずに、windowを操作できないのかなーってずっと思ってたので、これでwidnow操作がかなり楽にできようになりました。

http://itunes.apple.com/jp/app/spectacle/id487069743?mt=12

以下のようなショートカットキーで操作できます

Screen Shot 2012 06 30 at 2 09 34 PM

 

自分は command+alt+ ` で同じwindow内のアプリwindowを操作できるようにしているので 、command+altを押したまま同じデスクトップないwindowを思ったまま操作できるので快適です。

ちなみに、command+ `で同じアプリで切り替え、command+tabで起動しているアプリ切り替えで、このへんアプリの画面操作がキーボード左上にまとまっていて、快適macライフ良い感じです。
Screen Shot 2012 06 30 at 2 06 55 PM

僕のUSキーボードだったりするので、JISキーボードはショートカットが少し違うと思いますが、適当あわせてみてくださいー。もっといい方法あれば教えてくだいさい。

2012年6月28日木曜日

新しいPC のheroku への ssh key 登録

新しいmacを購入して、xcode3.4にビビりつつrails環境構築をしていて、意外とはまらずいけたと思ったら最後の最後に

$ git push heroku master 
ssh: Could not resolve hostname heroku.yahsan2: nodename nor servname provided, or not known
fatal: The remote end hung up unexpectedly

エラー。。
とりあえずググって 

http://d.hatena.ne.jp/opamp_sando/20110914/1316011399 
などを参考に

$ ssh-keygen -C "yahsan2@gmail.com" -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/yahsan2/.ssh/id_rsa): heroku_id_rsa
Enter passphrase (empty for no passphrase):
Enter same passphrase again:

~./ssh/config を作成

前にheroku-accountsのプラグインを使ってたから、Host heroku.yahsan2 みたいな感じで。
んで、herokuにsshkey 登録は

$ heroku keys:add
Found the following SSH public keys:
1) heroku_id_rsa.pub
2) id_rsa.pub
Which would you like to use with your Heroku account? 1
Uploading SSH public key /Users/yahsan2/.ssh/heroku_id_rsa.pub... done

これで

$git push heroku master 
:
:
f3aa1e4..ce9bc8e master -> master

okでしたー 

MarsEdit

こんにちは、宮本です。

お試しで, MarsEditのアプリ使ってます。

よろしくお願いします。感想は後ほど。

2012年6月13日水曜日

ブログバーツのjavascriptのembedができない

あまりにもblogの整形をしていないので、まずcodeにsyntaxhighlightをしようってことで
gistに集める作戦にしました。

あとで、とりあえずハマッたり、ぐぐって書いたコードはgistに登録しておいて
blog書くときはgistのembed機能を使う。
provate repoばかりのgithubをpublicな感じにできるのかなーってことで。

しかし、scriptを埋め込んでも表示されない現象なりました。
何度貼り直しても表示されないし、ずっとなんでだと放置して諦めていたけど、ふとmobileでみたら表示されてる!?

ってことでtemplateを疑って変えてみたら表示された!!

その時bloggerの動的templateを使っていたのだけど、
なにかjs的なとこで干渉してるみたいで表示されてないみたいでしたー。

他にも埋込みjs scriptとかだと不具合起こる可能性ありますから、一回疑ってみても良いかもですね

2012年5月30日水曜日

wordpress customfieldに文章を書けるようにする方法。(改行使えたり、リンクタグが飛び出ない)

アンカータグを使うと width 指定した div.wrapからはみ出たりする。 そこで、cssで以下のように white-spaceをしてする。
アンカータグ<a></a>を使うと width 指定した div.wrapからはみ出たりする。


そこで、cssで以下のように white-spaceをしてする。



すると、通常や改行や半角スペースがひとつにまとめられてしまうところ


改行や半角文字として認識してくれる!


http://www.htmq.com/style/white-space.shtml


ただし、


<p>


ちわー


</p>


とか無駄なインデントや改行もそのまま反映されるので、その辺は注意ですね。

2012年5月29日火曜日

instagram-ruby-gem の undefined method `configure' for Instagram:Module(NoMethodError) 続き

$ bundle isntall


できたーと思って


$rails s


起動したら今度は


Bundler could not find compatible versions for gem "faraday":


In snapshot (Gemfile.lock):


faraday (0.8.0)


In Gemfile:


instagram (>= 0) ruby depends on


faraday (= 0.7.6) ruby


Running `bundle update` will rebuild your snapshot from scratch, using only


the gems in your Gemfile, which may resolve the conflict.


今度はfaradayで喧嘩。

ググる。

https://github.com/Instagram/instagram-ruby-gem/issues/33


というわけで、0.7.6にあわせればいいらしい。


forkして、


local に clone


instagram.gemspec


s.add_runtime_dependency('faraday', '0.7.6')

に変更。

$ git add . $ git commit -a -m 'changed faraday verstion to 0.7.6 $ git push origin master

これで

Gemfile

'gem 'instagram', :git => 'git://github.com/yahsan2/instagram-ruby-gem.git'

に変更。

再びGem.lockを消して$ bundke install$rails s

できたー!!!!






2012年5月28日月曜日

instagram-ruby-gem の undefined method `configure' for Instagram:Module (NoMethodError)

instagram-ruby-gem を bundle install後、rails sで起動したら、以下のエラーが起きたのでメモ。


/config/initializers/instagram.rb:5:in `<top (required)>': undefined method `configure' for Instagram:Module (NoMethodError)


Gemfile


gem 'instagram'


と記述して


$bundle install


$rails s


で起動。


/config/initializers/instagram.rb:5:in `<top (required)>': undefined method `configure' for Instagram:Module (NoMethodError)


のエラー


ググる。


https://github.com/Instagram/instagram-ruby-gem/issues/21


こちらがヒット。


Gemfile


gem 'instagram', :git => 'git://github.com/Instagram/instagram-ruby-gem.git'


と記述して


$ bundle install

Updating git://github.com/Instagram/instagram-ruby-gem.gitFetching gem metadata from https://rubygems.org/.......Fetching gem metadata from https://rubygems.org/..Bundler could not find compatible versions for gem "multi_json": In snapshot (Gemfile.lock): multi_json (1.3.4)

In Gemfile: instagram (>= 0) ruby depends on multi_json (~> 1.0.3) ruby

Running `bundle update` will rebuild your snapshot from scratch, using onlythe gems in your Gemfile, which may resolve the conflict.

今度はgemどうしで喧嘩。

https://github.com/kylefox/instagram-ruby-gem/commit/95dbe0af2bfe1061aa757bf88726370ccb475ce4

これ読み込んだりこれように、forkなどして変更したがダメ。

とりあえず、gemなおしてgem 'instagram', :git => 'git://github.com/Instagram/instagram-ruby-gem.git'

なんとなく In snapshot (Gemfile.lock):ってあるから、これ全部消して

$bundle install

...

...Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

!! できた!?

$rails s

動いた!!よくわからけど、これで喧嘩収まることもあるらしいです。



ちなみで、https://github.com/mshk/Instagram-on-Rails-Sample

を参考にして、appは作ってったー