Skip to content

Instantly share code, notes, and snippets.

@csabahenk
csabahenk / 00README.md
Last active August 5, 2021 10:58
Mi lett volna ha?...
@csabahenk
csabahenk / 00README.md
Last active April 14, 2018 06:58
2018 választási eredmények

Választókerületi összesített egyéni, szavazóköri egyéni és listás, illetve orszégos listás eredmények JSON formátumban.

Az adatok forrása: Platón Párt NVI mirror

A dokumentum a következő strukrúrát követi:

{
  "választókerületek": [
    {
@csabahenk
csabahenk / tibetanalpha.rb
Last active October 22, 2017 19:49
Tibetan alphabet
#!/usr/bin/env ruby
require 'optparse'
TibetanAlpha =
[%w[ཀ ཁ ག ང],
%w[ཅ ཆ ཇ ཉ],
%w[ཏ ཐ ད ན],
%w[པ ཕ བ མ],
%w[ཙ ཚ ཛ ཝ],
@csabahenk
csabahenk / statedumpparse.rb
Last active August 30, 2017 22:42
GlusterFS state dump parsing snippet
#!/usr/bin/env ruby
require 'yaml'
require 'time'
ARRSEP = /^(-----=-----)?$/
HEAD = /^\[(.*)\]$/
d0 = [[]]
d1 = {}
@csabahenk
csabahenk / glusterconf.rb
Last active December 2, 2016 14:48
gluster volfile parser / extractor
#!/usr/bin/env ruby
module GlusterConf
extend self
class GlusterConfError < Exception
end
def assert x, *bool
bool.each { |b| raise GlusterConfError, "#{$.}: #{x}" unless bool }
@csabahenk
csabahenk / elastictest.rb
Last active July 10, 2017 11:43
Elasticsearch test script that indexes Mediawiki dumps
#!/usr/bin/env ruby
require 'yaml'
require 'net/http'
require 'socket'
require 'uri'
require 'open-uri'
require 'pathname'
require 'fileutils'
require 'etc'
#!/usr/bin/env ruby
require 'cgi'
checkopt = proc { |a|
!a.flatten.map { |o| $*.delete o }.compact.empty?
}
increment = checkopt[%w[-i --increment]]
breaknl = checkopt[%w[-b --break]]
checklist = checkopt[%w[-c --checklist]]
@csabahenk
csabahenk / default.min.css
Last active May 17, 2016 15:06
The Kerberos-hater’s guide to installing Kerberos (read on http://bl.ocks.org/csabahenk/raw/fccfb58d1220bcdf2b90aaa6762b4ea2/)
@font-face{font-family:TablePress;src:url(tablepress.eot);src:url(tablepress.eot?) format('embedded-opentype'),url(data:application/x-font-woff;base64,d09GRgABAAAAAAXYAAwAAAAACXwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABHAAAABwAAAAcZInHOk9TLzIAAAE4AAAAPgAAAGB7NXPDY21hcAAAAXgAAABMAAABUvD45QVnYXNwAAABxAAAAAgAAAAIAAAAEGdseWYAAAHMAAABKQAAAgjYVHFyaGVhZAAAAvgAAAAvAAAANv2jaBNoaGVhAAADKAAAAB0AAAAkCk0F6GhtdHgAAANIAAAAIAAAACgoAADqbG9jYQAAA2gAAAAWAAAAFgJWAbxtYXhwAAADgAAAAB0AAAAgAE4AH25hbWUAAAOgAAAB3AAAA43ZugaUcG9zdAAABXwAAABZAAAAgeNVfAkAAAABAAAAAMwXcmMAAAAAy1XFoAAAAADNHI82eJxjYGbexjiBgZWBhaWHxZiBgaENQjMVM0SB+ThBQWVRMYPDh+APd9gY/gP5bAyMykCKEUmJAgMjAC56Ct8AAHicY2BgYGaAYBkGRgYQ8AHyGMF8FgYDIM0BhEwMDB9CPtz6cOf/fyAr+MN1EIt/A78evy5UFxgwsjHAuYxAPSB9KICRYdgDAL67D8kAAQAB//8AD3icXU/NTsJAEJ5ZFggxxmCbkiwHAzLTowlu4ejeyxPwCOBR7r3rE/geeubuG3i3TyGts12MtT18ndnd7w8QsvpdX/Q/IAboI9s1rpY3mMTDkcAVDuaqPD0RqRfaU05UGSxJhj2p5wDNUplqyjsZQT6EQ/2mc9GcyBIPReQOObPrkccHMZhgonMS3R1tiLCsDNFm8bgQF3W06ekgqqnN5Aa//D9nlrOgDeg09Aq4lK3RTiX16n621BBVLrIe2PQK09s2c