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
# ruby port.rb [begin] [end] | |
require 'socket' | |
if ARGV.count < 2 | |
puts 'Usage: ruby port.rb [begin] [end]' | |
exit | |
end | |
port_begin = ARGV[0].to_i |
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 replaceIcon() { | |
if (timer) return; | |
timer = setTimeout(function() { | |
var iconClass = ""; // ex. cw_a123456 | |
var newIconUrl = "https://gist.github.com/chocoby/5320696/raw/3afb39adf96976e5b76cda4fb9cf7c490021619c/mikudayo.jpg"; | |
var icons = document.getElementsByClassName(iconClass); | |
for (var i = 0; i < icons.length; i++) { | |
icons[i].setAttribute("src", newIconUrl); |
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
# LTSV logformat | |
log_format ltsv "time:$time_local" | |
"\thost:$remote_addr" | |
"\tmethod:$request_method" | |
"\turi:$request_uri" | |
"\tprotocol:$server_protocol" | |
"\tstatus:$status" | |
"\tsize:$body_bytes_sent" | |
"\treferer:$http_referer" | |
"\tua:$http_user_agent" |
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
require 'jp_prefecture' | |
pref = JpPrefecture::Prefecture.find 13 | |
#=> #<JpPrefecture::Prefecture:0x007fcd25909440 @code=13, @name="東京都"> | |
pref.name | |
# => "東京都" |
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
Rails.cache.fetch('Hatsune') do | |
'Miku' | |
end | |
# => "Miku" |
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
DELETE_BRANCH=feature/1234_hoge; git branch -d $DELETE_BRANCH && git branch -r -d origin/$DELETE_BRANCH && git push origin :$DELETE_BRANCH | |
# Git でマージ済みのブランチを一括削除する #git - Qiita | |
# http://qiita.com/items/10a57a4f1d2806e3a3b8 | |
# と組み合わせると良いかもしれない |
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
hoge >= min and hoge <= max |
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
a = { 'hoge': 'a' } | |
b = { 'hoge': 'b' } | |
$.extend(a, b); | |
// Object | |
// hoge: "b" | |
// __proto__: Object |
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
$ curl http://shitajiki.herokuapp.com -X POST -d "data=# shitajiki \n寿司 :sushi:" | |
# <h1>shitajiki</h1> | |
# | |
# <p>寿司 <img src="http://shitajiki.herokuapp.com/emojis/sushi.png" width="20" height="20" title=":sushi:" alt=":sushi:" class="emoji" /></p> |
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
<html> | |
<body> | |
<div id="gallery"> | |
<div id="test1">a</div> | |
<div id="test2">b</div> | |
</div> | |
</body> | |
</html> |
NewerOlder