Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
require 'date'
require 'sdbm'
url = ARGV[0]
today = Date::today.to_s
dbm = SDBM.new('/path/to/xvideos.db')
@dzfl
dzfl / addMenu.uc.js
Created November 20, 2012 10:21
addMenu.uc.js to Everything
// ==UserScript==
// @name addMenu.uc.js
// @description メニューを拡張する userChromeJS 用のスクリプト
// @namespace http://d.hatena.ne.jp/Griever/
// @author Griever
// @include main
// @license MIT License
// @compatibility Firefox 5
// @charset UTF-8
// @version 0.0.4
@dzfl
dzfl / _addmenu.js
Created November 20, 2012 07:35
addMenu.uc.js to Everything Patch
page({
label: "Search Everything",
text: " -search \"%s\"",
exec: "C:\\path\\to\\Everything.exe",
condition: "select"
});
$ 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...
... ^
こんにちは!こんにちは!
#!/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
#!/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]
#!/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']
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;
#!/usr/bin/env ruby
# vim:fileencoding=utf-8
require 'socket'
require 'digest/sha1'
def send(msg)
print msg + "\r\n"