Skip to content

Instantly share code, notes, and snippets.

View msgre's full-sized avatar

Michal Valoušek msgre

  • Valašské Meziříčí, Czech Republic
View GitHub Profile

Keybase proof

I hereby claim:

  • I am msgre on github.
  • I am msgre (https://keybase.io/msgre) on keybase.
  • I have a public key whose fingerprint is 0BF8 285E C3F5 FF1E 6289 ADD9 97DD 7999 F5F9 2FD1

To claim this, I am signing this object:

@msgre
msgre / parse.py
Created April 26, 2016 07:11
Homeworks parser
# -*- coding: utf-8 -*-
import re
import sys
import requests
import simplejson
from datetime import date
from pyquery import PyQuery as pq
SITE_URL = 'http://www.zerotinova4b.estranky.cz'
@msgre
msgre / Vagrantfile
Last active April 24, 2016 07:00
Pomocné soubory k talku o Ansible, viz https://github.com/msgre/ansible-talk. Soubory nginx.conf.j2 a content.html.j2 ulož do adresáře templates.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# control masina, ze ktere budeme vsecko ovladat
$control_script = <<SCRIPT
if [ ! -f /home/vagrant/.ssh/id_rsa.pub ]; then
ssh-keygen -t rsa -N '' -f /home/vagrant/.ssh/id_rsa
chown vagrant:vagrant /home/vagrant/.ssh/id_rsa*
cp /home/vagrant/.ssh/id_rsa.pub /vagrant/
@msgre
msgre / texytypo.py
Created September 30, 2012 04:47
Texy typoška
import re
# sada regularnich vyrazu pro lepsi typosku
# zdroj: texy-2.1/texy/modules/TexyTypographyModule.php
TEXY_CHARS = ur'A-Za-z\u00C0-\u02FF\u0370-\u1EFF'
TEXY_TYPO_PATTERNS = [
(re.compile(ur'(?<![.\u2026])\.{3,4}(?![.\u2026])', re.M | re.U), u"\u2026"), # ellipsis ...
(re.compile(ur'(?<=[\d ])-(?=[\d ]|$)'), u"\u2013"), # en dash 123-123
(re.compile(ur'(?<=[^!*+,/:;<=>@\\\\_|-])--(?=[^!*+,/:;<=>@\\\\_|-])'), u"\u2013"), # en dash alphanum--alphanum
#!/bin/bash
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y install dkms build-essential linux-headers-generic
sudo apt-get -y install git vim postgresql-9.1-postgis
@msgre
msgre / Cakefile
Created March 8, 2011 13:43
Definuje 2 prikazy: "build" spoji vice *.coffee skriptu do jedineho vystupniho *.js, "watch" sleduje vstupni *.coffee soubory a po jakekoliv zmene automaticky spousti "build".
# https://gist.github.com/860272
#
# Tento Cakefile definuje 2 prikazy:
#
# * "build" spoji vice *.coffee souboru do jedineho a zkompiluje jej do vysledneho
# javascriptu. To, ktere soubory patri k sobe je definovano v hashi appFiles.
# Klic je nazev vystupniho souboru (ulozi se do adresare `out`), hodnoty nazvy
# souboru z adresare `source` bez pripony '.coffee'
# * "watch" sleduje zmeny v adresari `src` a pokud detekuje zmenu v nekterem z
# .coffee souboru, vyvolava "build"