Skip to content

Instantly share code, notes, and snippets.

View kubicek's full-sized avatar

Jiří Kubíček kubicek

View GitHub Profile
@kubicek
kubicek / Dockerfile
Last active November 10, 2023 13:45
bullettrain with docker-compose with fresh rails in new repo
FROM ruby:3
# based on https://github.com/timbru31/docker-ruby-node/blob/master/3.1/16/Dockerfile
RUN curl -sL https://deb.nodesource.com/setup_17.x | bash -\
&& apt-get update -qq && apt-get install -qq --no-install-recommends \
postgresql-client nodejs redis-tools \
&& apt-get upgrade -qq \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*\
&& npm install -g yarn
@kubicek
kubicek / install.sh
Last active September 2, 2020 21:23
FreeBSD docker
pkg install vm-bhyve
zfs create zroot/vm
mkdir /var/vm
zfs set mountpoint=/var/vm zroot/vm
sysrc vm_enable=YES
sysrc vm_dir=zfs:zroot/vm
sysrc vm_list=debian
@kubicek
kubicek / vshosting.rb
Last active November 12, 2019 18:25
VSHosting invoice downloader
require 'net/https'
require 'json'
auth={
email: 'mujmail',
password: 'mojeheslo'
}
http = Net::HTTP.new('admin.vshosting.cloud', 443)
http.use_ssl = true
@kubicek
kubicek / keybase.md
Created July 26, 2018 13:17
keybase.md

Keybase proof

I hereby claim:

  • I am kubicek on github.
  • I am kubicek (https://keybase.io/kubicek) on keybase.
  • I have a public key whose fingerprint is 85B9 D2F7 0302 D4F8 3C31 625B 62DF B4E6 38F4 5BDB

To claim this, I am signing this object:

datum;darce;penize;bup;popis_bup;poznamka;jmeno;prijmeni;titul_pred;titul_za;narozeni;ic;firma;ulice;psc;obec
<%- @donations=Donation.where("received_on > ? AND received_on < ?","#{params[:year].to_i-1}-12-31", "#{params[:year].to_i+1}-01-01") -%>
<%- @donations.where(donor_type: 'juristic').order(created_at: :desc).each do |d| -%>
<%= [l(d.received_on).gsub(/ /,''),'P',d.amount,0,'','','','','','','',d.ic,d.name,d.street,d.zip.gsub(/ /,''),d.city.strip].join(';') %>
<%- end -%>
<%- @donations.where.not(donor_type: 'juristic').order(created_at: :desc).each do |d| -%>
<%- jmeno, prijmeni = d.name.match(/(([Ii]ng|[Bb]c|M[UV]Dr|Mgr|PharmDr)\.? *)*(.*)/)[3].gsub(/, (MBA|DiS|Ph.?D|CSc|MUDr).?/,'').gsub(/;/,'').split(' ',2) -%>
<%- if d.date_of_birth<Date.parse('2001-01-01') -%>
<%= [l(d.received_on).gsub(/ /,''),'F',d.amount,0,'','',jmeno,prijmeni,'','',l(d.date_of_birth).gsub(/ /,''),'','',d.street,d.zip.gsub(/ /,''),d.city.strip].join(';') %>
<%- end -%>
Pověření
osoby k provedení delegování členů a náhradníků
do okrskových volebních komisí
Já, níže podepsaný předseda politické strany Strana svobodných občanů
Ing. Tomáš Pajonk
nar. 11.8.1981, trvalý pobyt Veselá 52, 756 51 Zašová
tímto pověřuji
@kubicek
kubicek / railsgrills.rb
Created August 25, 2017 18:10
railsgrills
words = %w(acer acre mongol mognol mogul zigul arec reac guliz)
letters = words.collect{|w| w.scan(/\w/).sort }
words.collect.with_index{|w,i|
positions = letters.collect.with_index{|l,i| i if l==letters[words.index(w)]}.compact
puts "#{w}: #{positions.collect{|pi| words[pi] unless i==pi}.compact.join(', ')}"
}
@kubicek
kubicek / server.rb
Last active May 17, 2017 01:13
git repo browser
require 'sinatra'
require 'rugged'
require 'pandoc-ruby'
require 'yaml'
set :port, ENV["PORT"] || 5000
before do
@repo = Rugged::Repository.new('.')
@kubicek
kubicek / bitcoinpay.rb
Last active July 4, 2016 12:32
bitcoinpay transaction history import
require 'rest-client'
require 'json'
data = RestClient::Request.execute(
method: :get,
url: 'https://www.bitcoinpay.com/api/v1/transaction-history/',
headers: {Authorization: 'Token nastoken'}
)
transactions = JSON.parse(data)['data']
@kubicek
kubicek / client.rb
Created June 28, 2016 00:36
Klient pro získání LV z katastru
$:.unshift File.dirname(__FILE__)
require 'savon'
require 'base64'
module Savon
class Response
def xml
@http.body.split("\r\n\r\n")[1].split("--uuid:")[0]
end
end