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 'date' | |
require 'sdbm' | |
url = ARGV[0] | |
today = Date::today.to_s | |
dbm = SDBM.new('/path/to/xvideos.db') |
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 -v | |
ruby 1.9.2p320 (2012-04-20 revision 35421) [i686-linux] | |
$ ruby -Eutf-8 examples/tig.rb --debug | |
examples/tig.rb:2050: invalid multibyte char (US-ASCII) | |
examples/tig.rb:2050: invalid multibyte char (US-ASCII) | |
examples/tig.rb:2050: syntax error, unexpected $end, expecting keyword_end | |
... str = "\00310♺ \017" + str if status.retwe... | |
... ^ |
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
こんにちは!こんにちは! |
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 | |
# MergeSort | |
def merge_sort(arr) | |
return arr if arr.size == 1 | |
lhs = merge_sort( arr.first(arr.size / 2) ) | |
rhs = merge_sort( arr.last(arr.size - arr.size / 2) ) | |
arr_new = [] | |
until( lhs.empty? || rhs.empty? ) do |
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 | |
while $_ = gets | |
a ||= [] | |
if /\d/ ~= $_ | |
a << $_.to_i | |
end | |
if /([-+*\/])/ ~= $_ | |
a << eval([a.pop, a.pop].reverse.join($1) | |
puts a[-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
#!/usr/bin/env ruby | |
require 'readline' | |
class Naming | |
def initialize(argv) | |
@strs1 = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'] | |
@strs2 = ['E','F','H','I','K','L','M','N','T','V','W','X','Y','Z'] | |
@strs3 = ['C','D','E','F','H','L','M','N','O','X','Z'] | |
@strs4 = [ 'Y','H','B','U','J','N','I','K','M','O','L','P'] |
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:args = '%s'.split(/ /i); if (args.length > 1) { var serv = args[0]; var id = args[1];} else { var serv = 'd'; var id = args[0] } location.href = "http://" + serv + ".hatena.ne.jp/" + id; |
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 | |
# vim:fileencoding=utf-8 | |
require 'socket' | |
require 'digest/sha1' | |
def send(msg) | |
print msg + "\r\n" |
NewerOlder