Skip to content

Instantly share code, notes, and snippets.

View Kedrigern's full-sized avatar

Ondřej Profant Kedrigern

View GitHub Profile
@Kedrigern
Kedrigern / readme.md
Last active April 18, 2017 08:46
RSS schema úřední deska Praha

Úřední deska Praha

Nápady na zlepšení:

  • doplnit strojově čitelně do RSS metadata, proti webu chybí:
    • Evidenční číslo
    • Typ
    • Odbor
    • Datum stažení
    • Typ zprávy
@Kedrigern
Kedrigern / subtitles.sh
Created February 6, 2017 21:07
Mass convert name and coding of subtitles
#!/usr/bin/env bash
# Converts subtitles
# from> grimm.301.hdtv-lol.srt
# to> Grimm.S03E01.HDTV.x264-LOL.srt
season=3
num_episodes=22
for i in `seq -w 1 $num_episodes`; do
fr="grimm.${season}${i}.hdtv-lol"
@Kedrigern
Kedrigern / jekyll-deploy.sh
Created October 8, 2016 09:54
jekyll deploy
#!/usr/bin/env bash
repo_url_prefix="https://github.com/pirati-web/"
repo_prefix="./git/"
deploy_prefix="./jekyll/"
jekyll_bin="/usr/local/bin/jekyll"
repos=( strednicechy.pirati.cz jihocesky.pirati.cz )
function prerequisite {
mkdir -p "$deploy_prefix"
#!/usr/bin/env bash
# usage: ./check.sh *.csv
# Check if given csv have correct format for currency.
col_money="4 6"
col_date="17 18 19 20"
lines="2 3 4"
for f in $@; do
if file "$infile" | grep "UTF-8"; then
#Properties saved by PropertyProvider
#Mon Jun 08 23:12:27 CEST 2015
visibleSignature.img=
keystore.type=BCPKCS12
signature.reason=
tsa.url=
inpdf.file=
keystore.keyIndex=0
signature.location=
tsa.cert.file=
@Kedrigern
Kedrigern / my_array_splice.php
Created October 27, 2014 15:38
my_array_splice
#!/usr/bin/php
<?php
class A {
public $a;
public function __construct($a) {
$this->a = $a;
}
@Kedrigern
Kedrigern / select.sql
Created March 29, 2014 22:54
DV view for data
SELECT *, md5(data) as md5, TRUNCATE(LENGTH(`data`)/1000,1) as "SIZE (kB)"
FROM `image`
@Kedrigern
Kedrigern / convert.sh
Created November 29, 2013 15:56
Syntax highlight and markdown via Pandox
#!/bin/bash
header="header.html.part"
for input in *.md; do
output="${input%.md}.html"
echo "input: $input output $output"
pandoc --no-highlight -o "$output" -H "$header" "$input"
@Kedrigern
Kedrigern / dices.html
Last active December 24, 2015 07:09
Dices is really small app, which show using of knockout.js
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Dices</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta name="author" content="Ondřej Profant" />
</head>
<?php
/**
* Homepage presenter.
*/
class HomepagePresenter extends BasePresenter
{
public function __construct(\Nette\Http\Session $session)
{
parent::__construct();