Skip to content

Instantly share code, notes, and snippets.

View mikz's full-sized avatar

Michal Cichra mikz

  • Prague, Czech Republic
View GitHub Profile
@mikz
mikz / Rules.1b
Created October 8, 2021 15:32
1blocker list pro blokování rizikových webů podle ČOI
[
{
"rules": [
{
"id": "B8C7FA8A-66E8-400F-AB2B-C36E64DD00001",
"name": "lasportivacz.cz",
"content": {
"trigger": {
"url-filter": "https?://+([^:/]+\\.)?lasportivacz.cz[:/]",
"url-filter-is-case-sensitive": false
@mikz
mikz / Unity3D yaml parser.rb
Created October 8, 2021 14:38
Parse unity yaml to ruby objects.
#!/usr/bin/env ruby
require 'yaml'
require 'psych'
require 'pry'
parser = Psych::Parser.new(Unity3DStream.new(&Proc.new{ |doc| binding.pry }))
str = ARGF.read.gsub(/^--- [!]u[!](\d+)/) { "--- !<tag:unity3d.com,2011/#{$1}>" }.gsub(/^(--- .+?) stripped/) { $1 }
parser.parse str
@mikz
mikz / hiring.rb
Created August 20, 2021 09:38
look for github candidates
#!/usr/bin/env ruby
require 'bundler/setup'
Bundler.require
require 'pp'
client = Octokit::Client.new(access_token: ENV.fetch("ACCESS_TOKEN"))
repositories = []
javascript:for(let%20a%20of%20document.querySelectorAll("tr:not(.days_off):not(.leave_date):not(.full_day_holiday)%20input[name^=\"timesheet[timesheetRow]\"][name$=\"[inTime]\"]"))a.value="09:00";for(let%20a%20of%20document.querySelectorAll("tr:not(.days_off):not(.leave_date):not(.full_day_holiday)%20input[name^=\"timesheet[timesheetRow]\"][name$=\"[breakDuration]\"]"))a.value="01:00";for(let%20a%20of%20document.querySelectorAll("tr:not(.days_off):not(.leave_date):not(.full_day_holiday)%20input[name^=\"timesheet[timesheetRow]\"][name$=\"[outTime]\"]"))a.value="18:00",a.dispatchEvent(new%20FocusEvent("blur"));
@mikz
mikz / luarocks.rb
Created August 21, 2016 12:26
LuaRocks Homebrew Formula
require 'formula'
class Luarocks < Formula
homepage 'https://rocks.moonscript.org/'
stable do
url 'https://github.com/keplerproject/luarocks/archive/v2.3.0.tar.gz'
sha256 '92c014889ec6a09c4bb492df6b7f7be784110d6abe031e16418342781ca5c5ce'
end

Keybase proof

I hereby claim:

  • I am mikz on github.
  • I am mikz (https://keybase.io/mikz) on keybase.
  • I have a public key whose fingerprint is 7B3F AA6F 9D9F 7BF5 2D6B 446E AC7A FD01 282E CD85

To claim this, I am signing this object:

@mikz
mikz / jspm.rb
Created June 17, 2016 09:34
detect jspm packages licenses
#!/usr/bin/env ruby
require 'open-uri'
require 'json'
require 'shellwords'
ENV['NODE_PATH'] = '/usr/local/lib/node_modules'
# npm install -g licenses
@mikz
mikz / resque-worker.conf
Last active January 8, 2016 16:36
Upstart config for resque workers
manual
instance ${N}
kill timeout 10800 # 3 hours in seconds
setuid user
stop on stopping resque
env N
env QUEUE="*"
description "Docker daemon"
start on (local-filesystems and net-device-up IFACE!=lo)
stop on runlevel [!2345]
limit nofile 524288 1048576
limit nproc 524288 1048576
respawn
kill timeout 20
module CodeclimateRails
module Git
def info
{
committed_at: git_timestamp,
head: head,
branch: branch
}
end