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 express = require('express'); | |
var http = require('http'); | |
var app = express(); | |
app.get('/', function(req, res) { | |
res.send( | |
'<body>' + | |
'<form action="/a" method="POST">' + | |
'<input type="text" name="foo">' + | |
'<input type="submit">' + |
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 | |
class Concern < ActiveRecord::Base | |
belongs_to :publication | |
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
Backbone.sync = function(method, model, options) { | |
var type = methodMap[method]; | |
// Default options, unless specified. | |
options || (options = {}); | |
// Default JSON-request options. | |
var params = {type: type, dataType: 'json'}; | |
// Ensure that we have a URL. |
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 m = new Backbone.Model(); | |
var View = Backbone.View.extend({ | |
initialize: function() { | |
this.listenTo(this.model, 'change', this.render); | |
} | |
}); | |
var v = new View({ model: m }); |
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/index.html b/index.html | |
index 581e230..b252a17 100644 | |
--- a/index.html | |
+++ b/index.html | |
@@ -3,6 +3,8 @@ | |
<head> | |
<meta http-equiv="content-type" content="text/html;charset=UTF-8" /> | |
<meta http-equiv="X-UA-Compatible" content="chrome=1" /> | |
+ <meta name="viewport" content="width=device-width"> | |
+ <link rel="canonical" href="http://backbonejs.org" /> |
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
**課題1 | |
なぜエラーが発生したのかその理由を記述しなさい。 | |
server.close()を呼ぶとこれ以上のコネクションは受け付けなくなるが、 | |
既存のコネクションに関してはそのまま接続された状態になる。 | |
また、HTTPの接続はkeep-aliveで行われるため、明示的にコネクションを | |
終了させなければ接続がタイムアウトするまでコネクションは生きている。 | |
最初のリクエスト(GET /)のときにserver.close()が呼ばれ、新規接続を |
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 curry(fn, _this) { | |
return function(arg) { | |
return fn.bind(_this, arg); | |
} | |
} | |
function add(a, b, c) { return a + b + c } | |
var curried_add = curry(add); |
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
$ npm -v | |
1.1.24 | |
$ npm -g -p ll | |
/Users/hokamura/.nodebrew/current/lib::/Users/hokamura/.nodebrew/node/v0.6.19/lib | |
/Users/hokamura/.nodebrew/current/lib/node_modules/jshint:[email protected]:/Users/hokamura/.nodebrew/node/v0.6.19/lib/node_modules/jshint | |
/Users/hokamura/.nodebrew/current/lib/node_modules/jshint/node_modules/cli:[email protected]:/Users/hokamura/.nodebrew/node/v0.6.19/lib/node_modules/jshint/node_modules/cli | |
/Users/hokamura/.nodebrew/current/lib/node_modules/jshint/node_modules/cli/node_modules/glob:[email protected]:/Users/hokamura/.nodebrew/node/v0.6.19/lib/node_modules/jshint/node_modules/cli/node_modules/glob | |
/Users/hokamura/.nodebrew/current/lib/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs:[email protected]:/Users/hokamura/.nodebrew/node/v0.6.19/lib/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/graceful-fs | |
/Users/hokamura/.nodebrew/current/lib/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits:[email protected]:/Users/hokamura/.no |
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
#!/usr/bin/env ruby | |
# https://gist.github.com/3957219 | |
@cache = nil | |
def hoge | |
@cache ||= Proc.new { | |
fuga = piyo() | |
"result: #{fuga}" |
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
#!/bin/sh | |
set -e | |
if [ $# -ne 2 -a $# -ne 3 ]; then | |
echo 'Usage:' | |
echo ' $ git export-diff <commit> <output_dir>' | |
echo ' $ git export-diff <commit> <commit> <output_dir>' | |
exit 1 | |
fi |