Skip to content

Instantly share code, notes, and snippets.

Jakub Pavlík igneus

Block or report user

Report or block igneus

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@igneus
igneus / frances_of_rome_in_passion_week.rb
Created Jun 14, 2019
In which years does the feast of St. Frances of Rome occur in the Passion Week?
View frances_of_rome_in_passion_week.rb
require 'calendarium-romanum'
CR = CalendariumRomanum
def passion_week(liturgical_year)
easter = CR::Temporale::Dates.easter_sunday liturgical_year
((easter - 7) .. (easter - 1))
end
@igneus
igneus / README.md
Created Mar 4, 2019
BaseX - examples of concurrent connections (fails in Python, OK in other tested languages)
@igneus
igneus / normostrany.sh
Last active Jan 6, 2019
Kolik normostran textu obsahuje daný pdf dokument?
View normostrany.sh
#!/bin/bash
# Klasicka otazka studentova: Kolik normostran ma me pdf?
if [ $# -lt 1 ]
then
echo "pdf file expected as command line argument."
exit 1
fi
@igneus
igneus / pedal_channel_switch.py
Created Dec 26, 2016
Switch MIDI presets by piano pedals
View pedal_channel_switch.py
# mididings patch translating piano pedals to Program switch messages
#
# I use it to switch presets in aeolus
from mididings import *
config(
client_name='pedal_channel_switch'
)
@igneus
igneus / gabc_quanta.rb
Created Dec 12, 2016
"How melismatic chants do my gabc files contain?"
View gabc_quanta.rb
# takes a list of gabc file paths as commandline arguments,
# for each of them prints syllable count, note count and notes per syllable
require 'grely'
class GabcScore
def syllables_count
i = 0
each_syllable {|s| i += 1 }
i
@igneus
igneus / feast.cr
Last active Nov 23, 2016
On feast days display feast title
View feast.cr
# 2016-11-18
# connects to the Church Calendar API
# If there is a celebration of rank feast or higher, prints it's title
# For me to fill a textbox widget in awesome:
# In rc.lua:
#
# calendarbox = widget({ type = "textbox" })
# calendarbox.text = awful.util.pread("/path/to/feast --calendar=czech-pha")
@igneus
igneus / http_error_raiser.rb
Last active Sep 18, 2016
returns unhappy HTTP status codes you ask for.
View http_error_raiser.rb
# Application returning unhappy HTTP status codes you ask for, e.g.
# GET /404
# returns 404 Not Found etc.
# Created for manual testing of HTTP clients.
require 'sinatra'
require 'json'
KNOWN_ERRORS = {
400 => 'Bad Request',
@igneus
igneus / Rakefile
Last active Aug 24, 2016
my seminar paper template (studying Theology at http://www.tf.jcu.cz/)
View Rakefile
deps = Dir["*.tex"] + Dir["*.*bx"] + Dir['*.bib']
main = Dir['*.tex'].first # only one expected
main_noext = main.sub '.tex', ''
main_pdf = main.sub '.tex', '.pdf'
file main_pdf => deps do |t|
sh "xelatex #{main_noext}"
sh "biber #{main_noext}"
sh "xelatex #{main_noext}"
View consecration_of_virgins.gly
\header
title: Antiphons for the Consecration of Virgins
\score
annotation: I D
c4
d f ef g ,
g ixhih g h ;
h g f ef d ,
d e d d f e c d ::
@igneus
igneus / threefold_piano.py
Last active Jul 30, 2016
mididings patch transforming a single-manual MIDI piano with standard three piano pedals to a two-manual organ with pedal (sort of)
View threefold_piano.py
# mididings patch making a single-manual MIDI piano with standard
# three piano pedals capable of simple organ music:
# * splits keyboard in two manuals (MIDI channels 1, 2)
# * transforms the piano pedals in a diatonic
# single-octave organ pedal playing on MIDI channel 4
# (it isn't possible to play more simultaneous pedal notes -
# combinations are instead used to expand the pedal's range)
from mididings import *
from mididings.event import CtrlEvent
You can’t perform that action at this time.