更新: | 2013-11-01 |
---|---|
バージョン: | 0.0.1 |
作者: | @voluntas |
URL: | http://voluntas.github.io/ |
概要
更新: | 2013-11-01 |
---|---|
バージョン: | 0.0.1 |
作者: | @voluntas |
URL: | http://voluntas.github.io/ |
概要
# This is a skeleton for testing models including examples of validations, callbacks, | |
# scopes, instance & class methods, associations, and more. | |
# Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
# | |
# I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
# so if you have any, please share! | |
# | |
# This skeleton also assumes you're using the following gems: | |
# | |
# rspec-rails: https://github.com/rspec/rspec-rails |
JavaScript のための小さな FRP (Functional Reactive Programming) ライブラリです。
手続き型から関数型に切り替えることで、イベントスパゲッティのコードがクリーンで宣言スタイルの「風水の bacon」(feng shui bacon)に変わります。入れ子のループを map
と filter
のような関数型プログラミングのコンセプトに置き換えることに似ています。個別のイベントに取り組むことを止め、イベントストリームを扱います。map
と filter
でデータを変換します。merge
と combine
でデータを combine します。重火器に切り替え、上司のように flatMap
と combineTemplate
を掌握します。
このライブラリはイベントのアンダースコア( _
)です。残念なことに ~
の記号は JavaScript では認められていないからです。
資料です。
Updated for Rails 4.0.0+
Set up the bower
gem.
Follow the Bower instructions and list your dependencies in your bower.json
, e.g.
// bower.json
{
Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.
Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.
//クリックイベントの中で | |
if(target.find("input").size()>=1){ | |
setTimeout(function(){ | |
//webkit,geckoにはfocus()にsetTimeoutが必要 | |
target.find("input").focus();//入力欄にフォーカス | |
},0); | |
} |
# Support for Rspec / Capybara subdomain integration testing | |
# Make sure this file is required by spec_helper.rb | |
# (e.g. save as spec/support/subdomains.rb) | |
def switch_to_subdomain(subdomain) | |
# lvh.me always resolves to 127.0.0.1 | |
hostname = subdomain ? "#{subdomain}.lvh.me" : "lvh.me" | |
Capybara.app_host = "http://#{hostname}" | |
end |
<body> | |
<script> | |
function popupNonBlock() { | |
var win = window.open("", "child", "width=400, height=300"); | |
win.document.body.innerHTML = "loading..."; | |
location.href = 'opener.html'; | |
} | |
</script> | |
<a href="opener.html">block</a> |