Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
include "/usr/share/X11/locale/en_US.UTF-8/Compose" | |
# Punctuation | |
# знаки препинания, необходимые в русском, которых нет в en_US.UTF-8/Compose | |
<Multi_key> <period> <minus> : "…" U2026 # HORIZONTAL ELLIPSIS, многоточие | |
<Multi_key> <period> <space> : "…" U2026 # HORIZONTAL ELLIPSIS, многоточие | |
<Multi_key> <?> <!> : "⁈" U2048 # QUESTION EXCLAMATION, ?! | |
<Multi_key> <period> <colon> : "…" # ELLIPSIS | |
# №: набирается в русской раскладке без ухищрений, |
""" | |
Copyright (c) 2012 Zohaib Sibte Hassan | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR |
# converting image to pdf | |
sudo apt-get install imagemagick | |
convert cover.png cover.pdf | |
# combining multiple pdfs into a single one | |
sudo apt-get install gs pdftk | |
gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=combinedpdf.pdf -dBATCH cover.pdf ch1.pdf ch2.pdf ch3.pdf ix.pdf |
@media print { | |
/* Append the address of the link */ | |
a[href]:after { | |
content: " (" attr(href) ")"; | |
/* break long urls that don't fit the page width [http://www.w3.org/TR/css3-text/] */ | |
word-break: break-all; | |
overflow-wrap: break-word; | |
} | |
a[href^="javascript:"]:after, | |
a[href^="#"]:after { content: "" } |
svn log --quiet | grep "^r[0-9]" | awk '{print $3}' | sort | uniq | |
svn log --quiet | awk '/^r[0-9]/ {print $3}' | sort | uniq | |
svn log --quiet | awk '/^r[0-9]/ {print $3}' | sort -u |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
""" | |
Код, который можно использовать, чтоб понять, какого рода | |
насоздавались питоновые объекты за время между вызовами | |
с creageGcIds() и newGcIdsAndBreak(). Вторая функция, | |
очевидно, выкинет сразу в отладчик. | |
Можно использовать, когда на интересующие объекты | |
не получается поставить weakref. (с) Леонид Евдокимов. | |
См. также http://homo-virtualis.livejournal.com/25634.html |
#!/usr/bin/env python | |
""" | |
Можно использовать например так: | |
(svn up && make ) && sendxmpp "Всё прошло успешно!" \ | |
|| sendxmpp "Произошла ошибка!" | |
""" | |
import xmpp | |
import sys |
#!/bin/sh | |
error=0 | |
for file in `git diff-index --name-only HEAD | grep -e "\.py"`; do | |
grep -e 'coding: utf-8' $file > /dev/null | |
if [ $? -ne 0 ]; | |
then | |
echo "python $file without coding directive" | |
error=1 | |
fi |
# Set prefix command to Ctrl-a | |
set -g prefix C-a | |
unbind C-b | |
# Reduce tmux delay for more responsiveness | |
set -sg escape-time 1 | |
# Window and pane index count starts in 1 rather tan 0 | |
set -g base-index 1 | |
setw -g pane-base-index 1 |