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
File.write "inode.txt",Dir["**/*.*"].reject{|z| z !~ /\.mp3$/i}.map{|z| [z,File.stat(z).ino] | |
}.sort_by{|z| z[1] | |
}.collect.with_index.map{|z,i| [i+1,z[0]].join(" -> ") | |
}.join("\n") |
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
[ | |
[ | |
"Baks", | |
"Bakson", | |
"Baksra", | |
"község", | |
"Csongrád", | |
"Kisteleki", | |
2294, | |
"6768" |
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
[ | |
[ | |
"Aba", | |
"Abán", | |
"Abára", | |
"város", | |
"Fejér", | |
"Abai", | |
4574, | |
"8127" |
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
H=("ÖÜÓŐÚŰÁÉÍ".split(//).zip("OUOOUUAEI".split(//))).to_h | |
t=('A'..'Z').to_a | |
tt={} | |
tt.merge!({t[0]=>t.zip(t).to_h}) | |
for p in 0..t.size-2 do | |
tt.merge!({t[p+1]=>t.zip(t[p+1..-1]+t[0..p]).to_h}) | |
end |
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/ruby | |
require "json" | |
require "peach" rescue nil | |
felh=ARGV[0] | |
jelsz=ARGV[1] | |
%x{curl 'http://www.imagebam.com/login' -s -c ~/imagebam-cookie.txt -H 'User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36' -H 'Referer: http://www.imagebam.com/login' --data "action=true&nick=#{felh}&pw=#{jelsz}"} | |
ret=%x{curl 'http://www.imagebam.com/sys/gallerybrowser/getData/' -b ~/imagebam-cookie.txt -H 'Pragma: no-cache' -H 'Accept-Encoding: gzip, deflate, sdch' -H 'Accept-Language: en-US,en;q=0.8' -H 'User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.76 Safari/537.36 OPR/43.0.2442.806' -H 'Content-Type: text/plain; charset=utf-8' -H 'Accept: */*' -H 'Referer: http://www.imagebam.com/gwt/gallerybrowser/FC785CCD0E5C531F9C9EB53A9C0334E9.cache.html' -H 'Connection: keep-alive' -H 'Cache-Control: no-cache' --compressed -L} |
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/ruby | |
require "pry" | |
require "peach" rescue nil | |
gallery=ARGV[0].chomp("/") | |
page_num=1 | |
gallery_id=gallery.split("/").last | |
%x{mkdir "#{gallery_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/ruby | |
ttf=ARGV[0] | |
cp=ARGV[1].rjust(4,"0") | |
cp1="00"+cp[0..1] | |
cp2=cp[2..3] | |
s=%x{fc-query "#{ttf}"} | |
charset=s.scan(/charset: \n\t(.*?)\n[^\t]/m).flatten[0].split("\n\t") | |
row=charset.find{|r| r=~/^#{cp1}: /} |
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 "matrix" | |
require "benchmark" | |
def mprint(m) | |
#pretty-print matrices | |
puts m.map{|z| z.map{|q| q.round(4).to_s.rjust(7," ")}.join(", ")}.join("\n") | |
end | |
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/ruby | |
now_a=Time.now | |
require "cgi" | |
require "set" | |
require "json" | |
Code={"AD"=>"Andorra", "AE"=>"Egyesült Arab Emirátusok", "AF"=>"Afganisztán", |
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/ruby | |
require "yaml" | |
require "cgi" | |
#require "pry" | |
require_relative "weighted" | |
cgi=CGI.new(:accept_charset => "UTF-8") | |
puts "Content-Type: text/plain; charset=\"UTF-8\"" |