This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# decode the inscription around the SkKySIO logo | |
# https://commons.wikimedia.org/wiki/File:SkKySIO.svg | |
code = 'oiooiioooiioiiiioiiooiiioiioiiiioiiiooii' | |
p code | |
.tr('oi', '01') | |
.scan(/.{8}/) | |
.collect {|i| i.to_i(2).chr } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How many celebrations of rank of a feast or higher have been added | |
# since the 1969 calendar reform? | |
# (Data for the discussion at https://www.facebook.com/Liturgie.cz/posts/pfbid02g7wBtAEfsuwjZDoebsqsjnu5VHAyx42txiRqreZrRZ826mxPPzGfjp48PAjgyZXal ) | |
require 'calendarium-romanum/cr' | |
require 'pp' | |
class CalendariumRomanum::Sanctorale | |
def to_h | |
r = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Which sanctorale feasts are celebrated on inverse dates like 2/5 x 5/2? | |
require 'calendarium-romanum/cr' | |
class CR::AbstractDate | |
def inverse | |
return nil if day > 12 || day == month | |
self.class.new(day, month) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# custom formatter for calrom https://github.com/calendarium-romanum/calrom | |
# Don't expect calrom code to be already loaded, load all direct dependencies of our class - this allows usage like | |
# $ RUBYOPT="-I my/custom/code/dir -r ultra_condensed_formatter" calrom -f ultracondensed --today | |
require 'calrom/formatter/formatter' | |
module Calrom | |
module Formatter | |
# Prints just one or two characters signalling | |
# what kind of celebration is celebrated today. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Which portions of the repertory of Ordinary time Sundays | |
# (lessons, corresponding chants of the Mass and Divine Office) | |
# are left unused in the given range of liturgical years? | |
require 'calendarium-romanum/cr' | |
require 'set' | |
SUNDAYS = (2..33).to_a.freeze | |
SANCTORALE = CR::Data::GENERAL_ROMAN_ENGLISH.load |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In which years does each feast of the Lord fall on Sunday and is thus celebrated with first Vespers? | |
require 'calendarium-romanum/cr' | |
years = 2000 .. 2100 | |
sanctorale = CR::Data::GENERAL_ROMAN_ENGLISH.load | |
sanctorale | |
.each_day | |
.select {|_,celebrations| celebrations.first.rank == CR::Ranks::FEAST_LORD_GENERAL } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Which Ordinary time Sundays were not celebrated in the given liturgical year? | |
require 'calendarium-romanum/cr' | |
SUNDAYS = (2..33).to_a.freeze | |
SANCTORALE = CR::Data::GENERAL_ROMAN_ENGLISH.load | |
def skipped_sundays(year) | |
cal = CR::Calendar.new year, SANCTORALE | |
r = SUNDAYS.dup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In which years Sacred Heart occurs with another solemnity and | |
# https://github.com/igneus/calendarium-romanum/issues/80 | |
# will hit again? | |
require 'calendarium-romanum/cr' | |
sanctorale = CR::Data::GENERAL_ROMAN_ENGLISH.load | |
(2020..2200).each do |liturgical_year| | |
date = CR::Temporale::Dates.sacred_heart liturgical_year |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How often is the feast of St. Adalbert suppressed? | |
require 'calendarium-romanum/cr' | |
cal = CR::PerpetualCalendar.new sanctorale: CR::Data['czech-praha-cs'].load_with_parents | |
date = CR::AbstractDate.new 4, 23 | |
(1970..2100).each do |y| | |
puts y if cal[date.concretize(y)].celebrations.first.symbol != :adalbert | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Which date range(s) must sanctorale of each Liturgia horarum volume cover? | |
require 'calendarium-romanum/cr' | |
years = 1971 .. 3000 | |
dates = CR::Temporale::Dates | |
xviii_sunday = lambda do |y| | |
dates.first_advent_sunday(y + 1) - |
NewerOlder