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 python2 | |
# -*- coding: utf-8 -*- | |
""" | |
Usage: %prog [width [columns]] < table.csv | |
Pretty-print CSV file with fixed width columns. | |
Arguments: |
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
// ==UserScript== | |
// @name CSS Hyphenation | |
// @namespace https://github.com/astanin | |
// @description Enable CSS hyphenation everywhere. | |
// If lang attribute is missing, lang=defaultLang is assumed. | |
// Edit script code and set appropriate defaultLang language code. | |
// @include http://* | |
// @include https://* | |
// ==/UserScript== |
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
# Contributor: Frank Ickstadt (frank dot ickstadt at gmail dot com) | |
# for argyllcms 1.3.5 color management system | |
# Note for rebuilders: | |
# The name of the file to be downloaded is always the same! | |
# So if you are a bad boy (Santa knows everything!) and build as root, this file | |
# will be saved in /var/cache/pacman/src . Therefore, rebuilding a later version | |
# likely will fail due to an MD5 error. If so, delete the files from the cache | |
# to force a new download. |
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 python2 | |
# requires PIL (python-imaging) | |
import Image | |
import ImageStat | |
from sys import argv, exit | |
from os.path import basename, splitext |
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
-- A script to generate Atom feed from a feed-less webpage | |
import Network.HTTP | |
import Text.HTML.TagSoup | |
import Text.Atom.Feed | |
import Text.Atom.Feed.Export | |
import Text.XML.Light | |
import Data.List (isPrefixOf) | |
import Data.Time (getCurrentTime) | |
import Control.Monad (liftM) |
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 | |
# Public Domain | |
""" | |
Uncrop a sequence of Cropped TIFFs[1] generated by Hugin, nona or | |
PTmender. | |
Pad images with transparent background to the minimum common extent | |
according to XPosition, YPosition tags. Images are save to uncrop/ | |
subdirectory. |
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
""" | |
This module provides splitBy function which splits a sequence into two | |
subsequences, in single pass and preserving order. | |
Some tests: | |
>>> def odd(x): return x%2 != 0 | |
>>> odds, evens = splitBy(odd, range(10)) | |
>>> odds.next() | |
1 |
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
{- Два солдата подошли к реке, по которой на лодке катаются двое | |
мальчиков. Как солдатам переправиться на другой берег, если лодка | |
вмещает только одного солдата либо двух мальчиков, а солдата и | |
мальчика уже не вмещает? -} | |
import Data.List (intercalate, (\\), sort, nub, permutations) | |
data C = Boy | Soldier deriving (Show, Eq, Ord) | |
data S = S { thisbank :: [C], otherbank :: [C] } deriving (Show) | |
type Move = [C] |
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
{- Крестьянину нужно перевезти через реку волка, козу и капусту. Но | |
лодка такова, что в ней может поместиться только крестьянин, а с ним | |
или один волк, или одна коза, или одна капуста. Но если оставить волка | |
с козой, то волк съест козу, а если оставить козу с капустой, то коза | |
съест капусту. Как перевёз свой груз крестьянин, если известно, что | |
все переправились через реку в целости и сохранности? -} | |
import Data.List (intercalate) | |
data C = Wolf | Goat | Cabbage deriving (Show, Eq) |
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 __future__ import with_statement | |
from cgi import escape | |
from os.path import expanduser | |
from string import Template | |
from sys import argv, version_info, exit | |
from xml.etree import ElementTree as ET | |
# import pickle | |
import warnings |