Skip to content

Instantly share code, notes, and snippets.

View jirutka's full-sized avatar
🇺🇦
Слава Україні!

Jakub Jirutka jirutka

🇺🇦
Слава Україні!
View GitHub Profile
@jirutka
jirutka / format-toggle-csv.rb
Last active December 1, 2015 17:36
Quick & dirty script for conversion of CSV export from Toggle to a readable textual table. It also deduplicates entries and groups entries without a description or duration less than 0.5 hours under one entry “Others”.
#!/usr/bin/env ruby
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
require 'csv'
@jirutka
jirutka / InlineXHtmlPegdownPluginParser.java
Created September 3, 2013 21:18
Pegdown plugin that demonstrates how to “hide” any inline or block rule defined in the Pegdown Parser class.
import java.util.ArrayList;
import java.util.List;
import org.parboiled.Rule;
import org.parboiled.matchers.FirstOfMatcher;
import org.parboiled.matchers.Matcher;
import org.pegdown.Parser;
import org.pegdown.ast.InlineHtmlNode;
import org.pegdown.plugins.InlinePluginParser;
@jirutka
jirutka / -README.adoc
Last active January 13, 2016 22:36
Benchmark various JavaScript libs for recursive conversion of object keys from underscore_case to camelCase.

Benchmark

Results

humps x 3,050 ops/sec ±2.32% (76 runs sampled)
camelcase-keys-recursive x 2,194 ops/sec ±3.16% (65 runs sampled)
camelify-recursive x 1,491 ops/sec ±2.64% (74 runs sampled)
camelize x 3,481 ops/sec ±2.27% (75 runs sampled)
camelscore x 3,280 ops/sec ±2.66% (68 runs sampled)
@jirutka
jirutka / README.md
Last active February 15, 2016 21:01
Some experimental filters for OpenSMTPD.

Warning: Filter API is not stable yet.

Filters are not triggered when sending e-mail directly using the sendmail command.

@jirutka
jirutka / check_openrc
Last active March 2, 2016 18:20
Very simple NRPE (nagios) module to check crashed services via OpenRC.
#!/bin/sh
# vim: set ts=4:
crashed=$(sudo rc-status --crashed)
if [ -n "$crashed" ]; then
echo "CRITICAL - crashed services: ${crashed//$'\n'/, }"
exit 2
else
echo 'OK'
@jirutka
jirutka / README.adoc
Created March 9, 2016 14:30
Twitter statistics and archive for #InstallFest 2016

Twitter statistics for #InstallFest 2016

Tweets between 2016-03-04 and 2016-03-07

  • Number of tweets (excluding RTs): 143

  • Number of favourites: 440

  • Number of retweets: 153

  • Number of tweeting users: 53

@jirutka
jirutka / gitlab-sidekiq.conf
Last active March 18, 2016 05:28
Upstart job configuration files (aka runscripts) for GitLab CE.
#!upstart
description "GitLab (Sidekiq)"
author "Jakub Jirutka"
start on starting gitlab
stop on stopping gitlab
env sidekiq_logfile="/var/log/gitlab/sidekiq.log"
env sidekiq_queues="-q post_receive -q mailer -q system_hook
@jirutka
jirutka / -README.adoc
Last active May 22, 2016 13:12
OpenRC runscript for QEMU/KVM / Moved to https://github.com/jirutka/qemu-openrc

UPDATE: Kdo si chcete jenom počíst a napsat mi, že byt nepotřebujete, tak prosím třeba přes Facebook https://www.facebook.com/lstrojil - děkuji, zájemci o byt prosím pište přes kontaktní formulář. :-)

Prodám byt. Je to moc hezký byt.

Přesto ho prodám. Jinak bych musel prodat děti a ženu a těch pár tun věcí, co nám tu společně nashromáždili.

Má všechno, co takový byt potřebuje: dveře (a ne jedny!), okna, podlahy, stropy, vodu, elektriku, sousedy, koupelnu, garáž, záchod, internet, sklep, komoru, komodu, šatnu, atmosféru, hypotéku...

@jirutka
jirutka / config.lua.example
Last active August 22, 2016 23:16
Lua script for synchronization of Git mirrors that uses MQTT to get notified about changes in the origin repositories.
mqtt_host = 'mqtt.example.org'
mqtt_topics = {
'git/foo/+',
'git/bar/+',
}
origin_url = 'git://git.example.org/%s'
mirror_url = 'git@github.com:example/%s.git'