This file contains hidden or 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 | |
# растеризовать все страницы в двутональные картинки (для цветных убрать -mono) | |
pdftoppm -r 600 -mono $1 rawpage | |
# каждую страницу сжать в чёрно-белый DjVu (cjb2, для цветных использовать c44) | |
for p in `ls -1 rawpage-*.pbm`; do | |
# вырезать левую половину: -gravity West -crop 50%x100% +repage | |
# или правую: -gravity East -crop 50%x100% +repage | |
# обрезать поля: -trim +repage |
This file contains hidden or 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 runhaskell | |
> import Data.Char (toLower) | |
Once @malfet wrote: uʍop ǝpısdn ǝʇıɹʍ oʇ pǝsn ǝq uɐɔ sloqɯʎs sɔıʇǝuoɥd. | |
Indeed, there are upside-down pairs for most of the lower-case letters. | |
Only 'j' is a problem. | |
> abc = [ ('a', 'ɐ'), ('b', 'q'), ('c', 'ɔ'), ('d', 'p'), ('e', 'ə') |
This file contains hidden or 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
% draw an angle arc on tikz plots | |
% | |
% #1: A point of ∠ABC | |
% #2: B point of ∠ABC | |
% #3: C point of ∠ABC | |
% #4: arc radius (length units) | |
% #5: arc style (e.g. fill=red!50!white or draw) | |
% #6: label | |
% | |
% Issues: |
This file contains hidden or 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
diff --git a/twidge.cabal b/twidge.cabal | |
index 6883036..428e628 100644 | |
--- a/twidge.cabal | |
+++ b/twidge.cabal | |
@@ -49,7 +49,7 @@ Flag withBitly | |
Executable twidge | |
Build-Depends: network, unix, parsec, MissingH>=1.0.0, | |
mtl, base >= 4 && < 5, HaXml>=1.13.2, HaXml<1.19, hslogger, hoauth, | |
- ConfigFile, directory, HSH, regex-posix, utf8-string, binary, | |
+ ConfigFile, directory, HSH, regex-posix, utf8-string >= 0.3.5, binary, |
This file contains hidden or 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
{- Count reverse dependencies by license type. | |
Output on 20100603 (license, # of revdeps, # of packages, revdeps per package): | |
BSD3 33469 1519 22.033574720210666 | |
LGPL 1018 99 10.282828282828282 | |
GPL 603 334 1.8053892215568863 | |
OtherLicense 300 77 3.896103896103896 | |
PublicDomain 214 64 3.34375 | |
BSD4 53 4 13.25 |
This file contains hidden or 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
(tool-bar-mode 0) | |
(scroll-bar-mode 0) | |
(menu-bar-mode 0) | |
(defun add-subdirs-to-load-path (dir) | |
(let ((default-directory (concat dir "/"))) | |
(normal-top-level-add-subdirs-to-load-path))) | |
;;; My location for external packages. | |
(add-to-list 'load-path "~/.emacs.d/site-lisp") |
This file contains hidden or 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
" Change HTML of Yandex fotki album snippet. | |
" vim: set expandtab ts=4 sw=4 ai si ci: | |
function! FixYandexFotkiSnippet() | |
" remove cuts | |
s#<lj-cut><cut><!--more-->## | |
s#</cut></lj-cut>## | |
" remove wrapping links | |
s#</\?a[^>]*>##g | |
" remove hardcoded border, replace with CSS class | |
s#border="0"#class="whitebg"#g |
This file contains hidden or 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/sh | |
# grep wrapper to look into PDF files | |
# supports -i, -c, -v options | |
# depends on pdftotext | |
# known bugs: | |
# FIXED 1. does not suppot spaces in the pattern | |
# 2. does not support grep -r | |
# WONTFIX 3. does not support grep -f (it is used to keep pattern) |
This file contains hidden or 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/sed -f | |
# remove cuts | |
s|<lj-cut><cut><!--more-->|| | |
s|</cut></lj-cut>|| | |
# remove wrapping links | |
s|</\?a[^>]*>||g | |
# remove hardcoded border, replace with CSS class | |
s|border="0"|class="whitebg"|g | |
# separate by blank links |
This file contains hidden or 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 | |
"""Compare two aligned images of the same size. | |
Usage: python compare.py first-image second-image | |
""" | |
import sys | |
from scipy.misc import imread | |
from scipy.linalg import norm |
OlderNewer