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
# hcidump -R の出力を改行無しにする | |
sudo hcidump -i hci0 -R | ruby -ne 'BEGIN{l = ""}; $_.strip!; if $_[0] == ">" then puts l; l = $_ else l << " " << $_ end' | |
# ruby one-liner | |
ruby -E UTF-8 -ne "print $_ if $_.include? 'hoge' or $_.include? 'fuga'" strings.xml | |
# gitリポジトリが管理するファイルのリスト表示 | |
git ls-files | |
# gitリポジトリのログをツリー表示 |
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
# Run directly from github | |
# ruby -e "$(curl https://raw.github.com/gist/3962976/)" | |
randam = rand(10) | |
while true do | |
input = gets | |
number = input[0..-1].to_i | |
if number == randam | |
puts 'hit!' | |
break |
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
javascript:(function(){ | |
d = document; | |
w = window; | |
if (d.selection) { | |
s = d.selection.createRange().text; | |
} else if (w.getSelection) { | |
s = w.getSelection(); | |
} else if (d.getSelection) { | |
s = d.getSelection(); | |
}; |
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
var http = require('http'); | |
http.createServer(function (req, res) { | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
res.end('Hello World\n'); | |
}).listen(1337, "127.0.0.1"); | |
console.log('Server running at http://127.0.0.1:1337/'); |
NewerOlder