- 四角い枠の中にボール
- フリックでこすると転がる
- ※ボールは
transform:translate()
で移動する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tds = document.querySelectorAll('td'); | |
for (var i=0,l=tds.length; i<l; i++) { | |
tds[i].addEventListener('click', function(event) { | |
this.querySelector('input').checked = true; | |
}, false); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 注意: 動かしてない、想像で書いてるコードです。 | |
// "_off"を含む画像ファイルを検索 | |
$('img[src~=_off]').each(function (index, elem) { | |
// 画像URL取得 | |
var offSrc = elem.src; | |
// _onな画像URLを生成 | |
var onSrc = offSrc.replace('_off', '_on'); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function f(aaa, bbb) { | |
console.log('aaa='+aaa, 'bbb='+bbb); | |
} | |
var context = null; // 何でもいい(thisになる) | |
var args = [ 'A', 'B' ]; // 引数に展開される | |
f.apply(context, args); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var obj1 = { name:'Alice' }; | |
var obj2 = { name:'Bob' }; | |
function say(talk, age) { | |
console.log(talk + ', I am ' + this.name + ', ' + age + ' years old.'); | |
} | |
say.apply(obj1, ['Hi', 12]); // "Hi, I am Alice, 12 years old." | |
say.apply(obj2, ['Good morning', 36]); // "Good morning, I am Bob, 36 years old." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// (start) -> Any jobs... -> "OK 1" -> Any jobs... -> "OK 3" -> Any jobs... -> "OK 3" | |
Promise(function(resolve) { | |
console.log('OK 1'); | |
setTimeout(resolve, 1000); | |
}).then(function() { | |
Promise(function(resolve) { | |
console.log('OK 2'); | |
setTimeout(resolve, 1000); | |
}).then(function() { | |
console.log('OK 3'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo == アプリ作成 == | |
rails new uploader | |
cd uploader | |
echo == CarrierWave導入 == | |
echo "gem 'carrierwave'" >> Gemfile | |
bundle | |
echo == 投稿モデル作成 == | |
rails g scaffold post name:string comment:text |
- 公開する仕組みがない
- wiki
- イントラブログ
- GHE+gist
- 検索機能がない
- 使いやすいのあるかな……
- 公開しても見返りがない
- 論文の参考文献みたいに参照件数をカウントしてみては
- 公開した結果、無知を晒すのが怖い
- 公開した結果、他人が得するのが面白くない
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.nested-fields | |
= f.input :file, as: :image_preview, input_html: { 'data-url' => work_images_path, 'data-form-data' => "{\"token\":\"#{@work.token}\"}" } | |
= f.input :caption | |
= link_to_remove_association t('simple_form.cocoon.remove_link'), f, class: 'right' |
- Canvas [MDN] [Spec (WHATWG)]
- SVG [MDN (en)] [Spec (W3C)]
- CSS 3
- Video, Audio [MDN] [Spec (WHATWG)]
- Form Validation [MDN] [Spec (WHATWG)] (?)]
- HTML Editing APIs (RTE)] [MDN] [Spec (W3C)]
- Drag & Drop [MDN] [[Spec (WHATWG)](http://www.whatw