This file contains hidden or 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
# Read about factories at http://github.com/thoughtbot/factory_girl | |
FactoryGirl.define do | |
factory :star do | |
user {|user| user.association(:ksuda)} | |
entry {|entry| entry.association(:yahoo)} | |
quotation 'quotation' | |
end | |
end |
This file contains hidden or 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
--colour | |
--format doc |
This file contains hidden or 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 Hoge() { | |
if (!(this instanceof Hoge)) { | |
return new Hoge(); | |
} | |
this.a = 'a'; | |
} | |
Hoge.prototype.b = 'b'; | |
var hoge1 = new Hoge(), | |
hoge2 = Hoge(); |
This file contains hidden or 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 Hoge = function () {}; | |
Hoge.a = function () { | |
return 'a'; | |
}; | |
Hoge.prototype.b = function () { | |
return 'b'; | |
}; |
This file contains hidden or 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
<div id="click-wrap"> | |
<input type="button" value="0"> | |
<input type="button" value="0"> | |
<input type="button" value="0"> | |
</div> | |
<script> | |
<!-- | |
document.getElementById('click-wrap').addEventListener('click', function (e) { | |
var src; |
This file contains hidden or 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
# -*- coding: UTF-8 -*- | |
require 'drb/drb' | |
class Puts | |
def initialize(stream=$stdout) | |
@stream = stream | |
end | |
def puts(str) | |
@stream.puts(str) |
This file contains hidden or 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
// 普通の書き方 | |
// コンストラクタとprototypeの宣言が離れていて気になる | |
// 行数は短い | |
var Tako = function () {}, | |
Ika = function () {}, | |
Hoge = function () {}; | |
Ika.prototype = {}; | |
Hoge.prototype = {}; | |
// コンストラクタとprototypeの宣言がまとめてかける |
This file contains hidden or 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
diff --git a/.rspec b/.rspec | |
new file mode 100644 | |
index 0000000..61f260b | |
--- /dev/null | |
+++ b/.rspec | |
@@ -0,0 +1,2 @@ | |
+--colour | |
+--drb | |
diff --git a/Gemfile b/Gemfile | |
index 7620608..911a1f4 100644 |
This file contains hidden or 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
<!doctype html> | |
<html lang="ja"> | |
<head> | |
<meta charset="utf-8"> | |
<title>QUnit skeleton</title> | |
<link rel="stylesheet" href="http://code.jquery.com/qunit/git/qunit.css"> | |
<script src="http://code.jquery.com/qunit/git/qunit.js"></script> | |
<script> | |
// write test | |
</script> |