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
# For Mac OS X | |
# To clean up duplicated files. | |
# isDuplicate(fileName) | |
# It returns true is the files are duplicated. | |
# It tests: | |
# - a file name (before the extention) ends with [0-9], and | |
# - there is a same sized file without trailing [0-9] of its file name. | |
# For example: "Word Power Made Easy Norman Lewis 528p_067174190X 2.pdf" | |
# original: "Word Power Made Easy Norman Lewis 528p_067174190X.pdf" |
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
#!/usr/bin/env ruby | |
require 'webrick' | |
require 'optparse' | |
port = 8000 | |
root = '.' | |
OptionParser.new do |opt| | |
opt.on('-p', '--port PORT', "default: #{port}") { |v| port = v } |
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
/** | |
* Traits with a same private var name does not conflict. | |
* Traits with a same method name do conflict. | |
*/ | |
trait Countable { | |
private var _count:Int = 0 | |
def count:Int = _count | |
def countup:Unit = _count += 1 | |
} |
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
require 'open-uri' | |
require 'json' | |
arg = ARGV.shift | |
if arg.nil? | |
print "usage: $0 username\n" | |
exit | |
end | |
username = arg.strip | |
api_url_fmt = "http://api.booklog.jp/json/%s?count=10000" | |
api_url = sprintf(api_url_fmt, username) |
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 | |
title Morning Relay by Shuntaro Tanigawa | |
script(src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js") | |
body.world | |
#kamchatka.place | |
.person.guy.is-dreaming.giraffe | |
.clock | |
audio(src="alarm-kamchatka-boy.mp3").alarm | |
#mexico.place | |
.person.maiden.is-waiting(for="bus") |
NewerOlder