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
#!/usr/bin/env python3 | |
# coding=utf-8 | |
import difflib | |
import argparse | |
import io | |
import glob | |
import os | |
import itertools | |
import logging |
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
#tady je priklad jednoho projektu: | |
# [-]luft_vagrant | |
# [+].hg | |
# .hgignore | |
# [+].vagrant | |
# README.md | |
# Vagrantfile | |
# [-]provisioning | |
# ansible_hosts |
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
cvt 1680 1050 #get xorg-like line for this resolution | |
xrandr --newmode "flatronw2242s" 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync #make the mode | |
xrandr --addmode VGA1 "flatronw2242s" #add it to xrandr |
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
>>> from decimal import Decimal | |
>>> Decimal(10.2+30) | |
Decimal('40.2000000000000028421709430404007434844970703125') | |
>>> _ == Decimal(40.2) | |
True |
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
class Document(models.Model) | |
def get_uuid(self): | |
def bijective_encode(i, start=0): | |
#http://stackoverflow.com/a/742047/754305 | |
i += start | |
CHARS = list('zpYUgh9XWvHbNVK6kmAufqCSeyiBZ7RcLd4GJ5ETMnwPDrx3s8QaF2jt') #randomized to avoid iteration | |
s = '' | |
base = len(CHARS) | |
while i > 0: | |
s += CHARS[i % base] |
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
#!/usr/bin/env python | |
from pyquery import PyQuery as pq | |
import requests | |
bigs = [] | |
for y in (2012,2013): | |
for m in range(1,13): | |
try: | |
doc = pq(requests.get('http://historje.tumblr.com/archive/%d/%d' % (y,m)).content) |
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
''' | |
99 bottles of beer on the wall, 99 bottles of beer. | |
Take one down and pass it around, 98 bottles of beer on the wall. | |
... | |
1 bottle of beer on the wall, 1 bottle of beer. | |
Go to the store and buy some more, 99 bottles of beer on the wall. | |
''' |
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
>>> one = {} | |
>>> type(one) | |
<type 'dict'> | |
>>> two = { | |
... | |
... | |
... | |
... } | |
>>> type(two) | |
<type 'dict'> |
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
#!/bin/bash | |
cat links | xargs -P 10 -r -n 1 wget --user=mujlogin --password=mojehslicko --auth-no-challenge --header="User-Agent: UFM 1.6" -nv -v | |
find -name "*\-avi" | while read line; do new=`echo "$line" | sed -e 's/\-avi/\.avi/g'`; mv $line $new; done | |
find -name "*\-mkv" | while read line; do new=`echo "$line" | sed -e 's/\-mkv/\.mkv/g'`; mv $line $new; done | |
find -name "*\-mp4" | while read line; do new=`echo "$line" | sed -e 's/\-mp4/\.mp4/g'`; mv $line $new; done | |
find -name "*\-rar" | while read line; do new=`echo "$line" | sed -e 's/\-rar/\.rar/g'`; mv $line $new; done |
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
starenka /opt/awesome-3.5 % DISPLAY=:1.0 /opt/awesome-3.5/awesome -c ~/.config/awesomedbg/rc.lua [73% 04:44:03] | |
/home/starenka/.config/awesomedbg/rc.lua:2: module 'awful' not found: | |
no field package.preload['awful'] | |
no file './awful.lua' | |
no file '/usr/local/share/lua/5.1/awful.lua' | |
no file '/usr/local/share/lua/5.1/awful/init.lua' | |
no file '/usr/local/lib/lua/5.1/awful.lua' | |
no file '/usr/local/lib/lua/5.1/awful/init.lua' | |
no file '/usr/share/lua/5.1/awful.lua' | |
no file '/usr/share/lua/5.1/awful/init.lua' |