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
let stat={"uniszex":{"A|k":1,"k|i":5,"i|t":9,"t|a":7,"a| ":37,"A|l":2,"l|a":10,"a|m":9,"m|u":3,"u|sz":7,"sz|i":4,"i| ":111,"A|n":1,"n|gy":1,"gy|a":1,"a|l":7,"l| ":3,"Á|cs":1,"cs|i":8,"Á|f":1,"f|o":1,"o|ny":1,"ny|a":2,"Á|l":2,"l|m":3,"m|i":17,"m|o":9,"o|s":14,"s| ":33,"B|a":3,"a|g":6,"g|i":3,"i|r":11,"r|a":7,"a|j":4,"j|u":1,"sz| ":9,"a|n":10,"n|d":8,"d|i":4,"B|e":3,"e|r":10,"r|i":18,"r|r":4,"r|y":2,"y| ":6,"B|í":1,"í|b":1,"b|o":2,"o|r":18,"r| ":13,"B|i":5,"i|gy":1,"gy|ó":2,"ó| ":23,"i|m":6,"m|b":6,"b|i":7,"b|ó":4,"i|z":3,"z|g":1,"g|a":1,"i|zs":1,"zs|u":1,"u| ":14,"B|l":1,"a|c":5,"c|k":2,"k|y":3,"B|o":9,"o|gy":1,"o|h":3,"h|ó":2,"ó|c":9,"c| ":11,"o|j":1,"j|sz":1,"o|l":8,"l|h":1,"h|a":2,"a|zs":3,"zs|á":1,"á|k":2,"k| ":13,"o|ly":3,"ly|h":1,"h|o":1,"o|n":7,"n|b":1,"n| ":13,"r|z":3,"z|a":1,"a|s":7,"z|i":3,"B|u":4,"u|b":2,"u|c":9,"c|i":22,"u|m":6,"m|e":4,"r|á":3,"á|n":11,"n|g":4,"g| ":7,"u|t":4,"t|u":3,"u|s":7,"B|ü":1,"ü|d":1,"C|a":2,"a|k":5,"k|k":3,"k|o":4,"m|p":4,"p|a":6,"a|r":11,"C|é":1,"é|r":4,"r|n":1,"n|a":2,"C |
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
# unnepnap.rb | |
require "json" | |
nn=JSON.load(File.read(File.expand_path(File.dirname())+"/nevnapok.json")) | |
td=Time.now.to_s[5,5] | |
jj=[["01-01", "Újév"], ["01-06", "Vízkereszt, a farsang kezdete"], ["01-07", "Karácsony a keleti keresztény egyházakban"], ["01-08", "A világirodalom napja"], ["01-21", "A vallások világnapja"], ["01-22", "A magyar kultúra napja"], ["01-26", "Nemzetközi vámnap"], ["01-27", "A holokauszt nemzetközi emléknapja"], ["01-30", "A lepra elleni harc világnapja"], ["02-01", "A Tisza élővilágának emléknapja"], ["02-01", "A civilek napja"], ["02-01", "Választások világnapja"], ["02-02", "Szerzetesek világnapja, a vizes élőhelyek napja"], ["02-03", "Rejtvényfejtők világnapja"], ["02-04", "Rákellenes világnap"], ["02-06", "A magyar rádiótechnikai fegyvernem napja"], ["02-11", "Betegek világnapja"], ["02-13", "Budapest ostroma végének emléknapja"], ["02-14", "Valentin-nap"], ["02-14", "Szerelmesek napja, az epilepszia világnapja"], ["02-18", "A kínai újév kezdete"], ["02-21", "Hamvazószerda, az a |
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
titles=Array.from(document.querySelectorAll("#video-title")).map(z=>z.innerText) | |
ids=Array.from(document.querySelectorAll("div#content a#thumbnail")).map(z=>(z.href.match(/\?v\=(.*?)\&/))[1]).splice(1,document.querySelectorAll("div#content a#thumbnail").length-1) | |
console.log(JSON.stringify(ids.map((z,i)=>[z,titles[i]]))) |
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 "time" | |
wu=%x{journalctl -b 0 -r|grep -i "Waking up from hibernate" -m 1} | |
li=%x{journalctl -b 0 -r|grep -i "Reached target Graphical Interface" -m 1} | |
t = (wu!="" ? wu : li).split[0..2].join(" ") | |
seconds=(Time.now-Time.parse(t)).round | |
d=seconds / (3600*24) | |
if d==0 then | |
puts "up: %02d hour, %02d min" % [(seconds-3600*24*(d)) / 3600, (seconds-3600*24*(d)) / 60 % 60, (seconds-3600*24*(d)) % 60] |
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
Alán | |
Antonella | |
Ariella | |
Cserne | |
Darla | |
Dávid-csillag | |
Ervina | |
Febrónia | |
Fehére | |
Filotea |
This file has been truncated, but you can view the full file.
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
abajgat | |
abakusz | |
abál | |
abált | |
abaposztó | |
abárol | |
abba | |
abbahagy | |
abbahagyat | |
abbahagyogat |
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
nevnapok=nevnapok.map{|k,v| [k,v["t"] ? {"t"=>v["t"]} : {"n"=>v["n"],"s"=>v["s"]}]}.sort_by{|k,v| k.unicode_normalize(:nfd)}.to_h |
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
{ | |
"Andor": { | |
"n": { | |
"11-30": 1 | |
}, | |
"s": "F" | |
}, | |
"Apollinár": { | |
"n": { | |
"01-08": 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
{ | |
"Aba": { | |
"n": { | |
"11-12": 1 | |
}, | |
"s": "F" | |
}, | |
"Abád": { | |
"n": { | |
"04-16": 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 "nokogiri" | |
require "json" | |
require "open-uri" | |
url=ARGV[0]||"https://hu.wikipedia.org/wiki/Magyarorsz%C3%A1g_v%C3%A1rosai" | |
d=Nokogiri::HTML(URI.open(url).read) | |
table=d.css(".wikitable").max_by{|z| z.to_html.size} | |
th=table.css("tr").css("th").map{|z| z.text.chomp.strip.scan(/([[:alpha:]]+)/).flatten[0]} | |
puts %Q{/*#{th.join("|")}*/\n}+JSON.pretty_generate(table.css("tr")[1..-1].map{|row| row.css("td").map{|cell| data=cell.text.chomp.strip;data=~/^[0-9\s\u00a0]+$/ ? data.gsub(/[\s\u00a0]+/,"").to_i : data}}.reject{|row| row.size==0}) |
NewerOlder