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
#!/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 |
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
// http://ejohn.org/blog/simple-javascript-inheritance/ | |
function Class() {} | |
Class.extend = function extend(props) { | |
var SuperClass = this; | |
function Class() { | |
if (typeof this.init === 'function') { | |
this.init.apply(this, arguments); |
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
$ ruby -e 'C=`stty size`.scan(/\d+/)[1].to_i;S="\xf0\x9f\x8d\xa3";a={};puts "\033[2J";loop{a[rand(C)]=0;a.each{|x,o|;a[x]+=1;print "\033[#{o};#{x}H \033[#{a[x]};#{x}H#{S} \033[0;0H"};$stdout.flush;sleep 0.01}' |
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
" Capture {{{ | |
command! | |
\ -nargs=1 | |
\ -complete=command | |
\ Capture | |
\ call Capture(<f-args>) | |
function! Capture(cmd) | |
redir => result | |
silent execute a:cmd |
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
**課題1 | |
なぜエラーが発生したのかその理由を記述しなさい。 | |
server.close()を呼ぶとこれ以上のコネクションは受け付けなくなるが、 | |
既存のコネクションに関してはそのまま接続された状態になる。 | |
また、HTTPの接続はkeep-aliveで行われるため、明示的にコネクションを | |
終了させなければ接続がタイムアウトするまでコネクションは生きている。 | |
最初のリクエスト(GET /)のときにserver.close()が呼ばれ、新規接続を |
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
// http://wiki.commonjs.org/wiki/Unit_Testing/1.0 | |
// | |
// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8! | |
// | |
// Originally from narwhal.js (http://narwhaljs.org) | |
// Copyright (c) 2009 Thomas Robinson <280north.com> | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the 'Software'), to | |
// deal in the Software without restriction, including without limitation the |
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
" こういうHTMLがあったときに | |
" <div id="hoge" class="fuga"> | |
" ... | |
" </div> | |
" | |
" 実行するとこうなる | |
" <div id="hoge" class="fuga"> | |
" ... | |
" <!-- /div#hoge.fuga --></div> |
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() { | |
function Dispatcher() { | |
this.routes = []; | |
} | |
Dispatcher.prototype.route = function route(path, action) { | |
this.routes.push({ path: path, action: action }); | |
return this; | |
}; |
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
import React from 'react'; | |
import { Frame, FrameSet } from './react-flex-frame'; | |
class App extends React.Component { | |
render() { | |
return ( | |
<FrameSet direction="row"> | |
<Frame width="300" resiable={true} className="side"> | |
<h1>Side Bar</h1> | |
</Frame> |
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
p AhoCorasick.new(["8年", "18年"]).match('平成18年') #=> ["18年"] | |
p AhoCorasick.new(["8年", "18年", "平成17年台風第11号"]).match('平成18年') #=> ["8年"] |
NewerOlder