Skip to content

Instantly share code, notes, and snippets.

View igneus's full-sized avatar

Jakub Pavlík igneus

View GitHub Profile
\version "2.16.0"
global = {
% \key c \major
\cadenzaOn % no timing, no automatic bars
% no stem
\override Stem #'transparent = ##t
\override Stem #'Y-extent = ##f
import unittest
import time
import os
_COLOR = {'green': "\x1b[32;01m",
'red': "\x1b[31;01m",
'reset': "\x1b[0m"
}
def red_str(text):
@igneus
igneus / petynka.rb
Last active August 29, 2015 14:05
Koupaliště Petynka - teplota vzduchu, vody a počet návštěvníků bez otvírání webového prohlížeče
#!/usr/bin/env ruby
# 2015-05-09
#
# prints information from the Koupaliste Petynka's website
require 'mechanize' # interaction with websites
page = Mechanize.new.get('http://www.koupalistepetynka.cz/')
@igneus
igneus / json getter
Created March 27, 2015 15:13
if you have a lot of json files with the same structure and need some piece from all of them ...
#!/usr/bin/python
# jsongetter.py
#
# reads json file/s,
# gets a part specified in a Python dict/list notation,
# prints formatted contents
#
# $ jsongetter.py <keys> [file1 file2 ...]
#
@igneus
igneus / xmpl.json
Created August 4, 2015 09:01
geojson example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@igneus
igneus / petynka.cr
Last active May 6, 2019 17:32
Koupaliště Petynka - teplota vzduchu, vody a počet návštěvníků bez otvírání webového prohlížeče (Crystal)
# coding: utf-8
# petynka.cr
#
# Extracts temperature and count of visitors from the website
# of Koupaliste Petynka, Prague
require "http/client"
require "http/headers"
require "option_parser"
@igneus
igneus / pizzeria-manna-find-vegetarian.py
Last active December 13, 2015 22:59
My daily task - find some meatless meal in the daily menu of a local pizzeria - automated
# encoding: utf-8
from __future__ import unicode_literals
import sys, re
from bs4 import BeautifulSoup
import requests
from termcolor import colored
MENU_URL = 'http://www.pizzeria-manna.cz/index.asp?id=dennimenu'
@igneus
igneus / opraem_bohemia_1934.gly
Created December 15, 2015 18:45
Antiphonal proper for Bohemian Premonstratensian houses - chants only, transcribed from a 1934 Premonstratensian antiphonal
\header
title: Supplementum Antiphonarii pro eclesiis Montis Sion, Siloensi et Neorisensi
% Die 4. Martii
% Translatio S. Wenceslai Martyris
\score
office-part: antiphona ad Magnificat
mode: 1
annotation: Ad Magnif.
@igneus
igneus / collect_countries.rb
Created May 30, 2016 14:28
Country names harvested from the "countries" Ruby gem (https://github.com/hexorx/countries)
require 'countries'
require 'json'
require 'active_support'
require 'sort_alphabetical'
lang = ARGV[0] || 'cs'
data = ISO3166::Country
.all
.collect {|c| {name: c.translations[lang], code: c.alpha2} }
@igneus
igneus / seznam_searches.rb
Last active July 3, 2016 14:13
Analyze incoming traffic from seznam.cz search in your Apache access log
# script analyzing incoming traffic from seznam.cz search
# in Apache access log
# Seznam search is "kind enough" to preserve the query in referer
# typical usage:
# grep search.seznam.cz access.log | seznam_searches.rb
#
# grepping the log isn't really necessary, it just spares the script
# parsing each line and makes it work only with the interesting