Skip to content

Instantly share code, notes, and snippets.

Avatar

Michal Valoušek msgre

  • Valašské Meziříčí, Czech Republic
View GitHub Profile
@msgre
msgre / Cakefile
Created Mar 8, 2011
Definuje 2 prikazy: "build" spoji vice *.coffee skriptu do jedineho vystupniho *.js, "watch" sleduje vstupni *.coffee soubory a po jakekoliv zmene automaticky spousti "build".
View Cakefile
# 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"
View startup.sh
#!/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 / texytypo.py
Created Sep 30, 2012
Texy typoška
View texytypo.py
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
@msgre
msgre / Vagrantfile
Last active Apr 24, 2016
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.
View Vagrantfile
# -*- 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 / parse.py
Created Apr 26, 2016
Homeworks parser
View parse.py
# -*- 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'
View keybase.md

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: