- 著者
打田 旭宏
- ライセンス
- 更新日時
Sphinx の LaTeX 出力を利用するときに見栄えを凝るのに知っておくとよいかもしれない小技をまとめました。
#!/usr/bin/env emacs --script | |
(defadvice message (before message-disable activate) | |
"disable message function to trash stderr message" | |
(ad-set-args 0 nil)) | |
(defun insert-standard-input () | |
"insert contents from standard input" | |
(condition-case nil | |
(let (line) |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from itertools import chain, izip_longest, groupby | |
def hyphenate(s): | |
""" | |
>>> hyphenate("1 2 3") | |
'1-3' | |
>>> hyphenate("1 2 3 5 7 8") |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# by Akihiro Uchida, CC0 dedicated to the public domain | |
# see http://creativecommons.org/publicdomain/zero/1.0/ | |
import os.path | |
import time | |
import re | |
import subprocess | |
import atexit | |
import cPickle as pickle |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# by Akihiro Uchida, CC0 dedicated to the public domain | |
# see http://creativecommons.org/publicdomain/zero/1.0/ | |
import sys, re | |
import email, email.header | |
import os.path | |
import argparse | |
from locale import getpreferredencoding |
#!/usr/bin/env bash | |
if [ "$?" -eq "0" ]; then | |
pygmentize -g -O "style=native,encoding=$(nkf -g $1)" -f console256 $1 | nkf -w | |
else | |
exit 1 | |
fi |
#!/usr/bin/env bash | |
# convert anything to UTF-8 for LESSOPEN | |
LESSPIPE=lesspipe.sh | |
conv_utf8() { | |
if [ -x "$(which nkf 2> /dev/null)" ]; then | |
nkf -w -Lw "$1" | |
elif [ -x "$(which ruby 2> /dev/null)" ]; then | |
ruby -r nkf -pe '$_=NKF.nkf "-w -Lw",$_' "$1" | |
else | |
cat "$1" |
c = get_config() | |
c.TerminalInteractiveShell.confirm_exit = False | |
c.TerminalInteractiveShell.logstart = True | |
from time import strftime | |
c.TerminalInteractiveShell.logfile = strftime('ipython-%Y%m%d-%T.py') |
#!/bin/bash | |
# MacTeX uninstaller script based on pkgutil command | |
# by Akihiro Uchida, CC0 dedicated to the public domain | |
# see http://creativecommons.org/publicdomain/zero/1.0/ | |
IFS=$(echo -en "\n") | |
for pkg in $(pkgutil --pkgs|grep org.tug.mactex); do | |
volume="$(pkgutil --pkg-info "$pkg"|grep volume|cut -d' ' -f2-)" | |
location="$(pkgutil --pkg-info "$pkg"|grep location|cut -d' ' -f2-)" | |
echo "remove all of the files installed under the $pkg" | |
for file in $(pkgutil --files "$pkg"); do |
打田 旭宏
Sphinx の LaTeX 出力を利用するときに見栄えを凝るのに知っておくとよいかもしれない小技をまとめました。