Skip to content

Instantly share code, notes, and snippets.

View superbrothers's full-sized avatar
🌏
Working from the earth

Kazuki Suda superbrothers

🌏
Working from the earth
View GitHub Profile
# 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
--colour
--format doc
function Hoge() {
if (!(this instanceof Hoge)) {
return new Hoge();
}
this.a = 'a';
}
Hoge.prototype.b = 'b';
var hoge1 = new Hoge(),
hoge2 = Hoge();
var Hoge = function () {};
Hoge.a = function () {
return 'a';
};
Hoge.prototype.b = function () {
return 'b';
};
<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;
# -*- coding: UTF-8 -*-
require 'drb/drb'
class Puts
def initialize(stream=$stdout)
@stream = stream
end
def puts(str)
@stream.puts(str)
// 普通の書き方
// コンストラクタとprototypeの宣言が離れていて気になる
// 行数は短い
var Tako = function () {},
Ika = function () {},
Hoge = function () {};
Ika.prototype = {};
Hoge.prototype = {};
// コンストラクタとprototypeの宣言がまとめてかける
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
<!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>