Skip to content

Instantly share code, notes, and snippets.

View shimizukawa's full-sized avatar

Takayuki SHIMIZUKAWA shimizukawa

View GitHub Profile
# -*- coding: utf-8 -*-
#
# Sphinx extension for renaming _static/ directory
#
# Author: Takeshi KOMIYA / License: BSD
#
import re
import os
import shutil
@aodag
aodag / run
Last active August 29, 2015 14:08
reSTから、LuaLaTeXでフォント埋め込み、しおり付の日本語なPDFを作るためのtexに変換するオプション
rst2latex --documentclass=ltjsbook --hyperref-options="unicode=true" --latex-preamble="\usepackage[ipa]{luatexja-preset}" book.rst book.tex
lualatex book.tex
sample.py:6: undefined name 'h'
sample.py:9: undefined name 'z'
========================================
In defense of zope libraries 翻訳
========================================
Pyramid が Zope ライブラリを使っていることについての非常に長い defence
----------------------------------------------------------------------
freenode の #pyramid IRC チャンネルで、以下のような質問に私は
うんざりするほど多くの時間を割いてきた。
diff -r c9910fd022fc -r 0cc743bd3a6d Doc/library/ssl.rst
--- a/Doc/library/ssl.rst Tue Apr 10 10:59:35 2012 -0400
+++ b/Doc/library/ssl.rst Tue May 29 14:31:16 2012 -0700
@@ -218,14 +218,6 @@
Note that use of this setting requires a valid certificate validation file
also be passed as a value of the ``ca_certs`` parameter.
-.. data:: PROTOCOL_SSLv2
-
- Selects SSL version 2 as the channel encryption protocol.
@t2y
t2y / conftest.py
Created July 24, 2012 02:43
simple plugin for shelldoctest with pytest, though this script reports only its result
import pytest
import shelldoctest
# use this if you run only shelldoctest
#def pytest_addoption(parser):
# parser.addoption("--shelldoctest", action="store_true",
# help="run shell-doctest")
#
#def pytest_runtest_setup(item):
# if not isinstance(item, item.Function):
@aodag
aodag / myenv.py
Created September 5, 2012 01:35
installing distribute after pyenv created
#!/opt/python-3.3.0rc1/bin/python3.3
import venv
import sys
import argparse
import subprocess
import os
here = os.path.dirname(__file__)
# put it into your conf.py
def setup(app):
# disable versioning for speed
from sphinx.builders.gettext import I18nBuilder
I18nBuilder.versioning_method = 'none'
def doctree_read(app, doctree):
if not isinstance(app.builder, I18nBuilder):
return
from docutils import nodes
@ymotongpoo
ymotongpoo / pyspa_advent.py
Created November 30, 2012 05:58
2012 PySpa advent calendar抽選
import random
participants = ["ymotongpoo",
"shiumachi",
"mopemope",
"tk0miya",
"shimizukawa",
"kuenishi",
"ransui",
"turky",
rst2textileのend_stateの仕様について質問→自己解決
元々のコード
def visit_literal_block(self, node):
self.new_state(0)
def depart_literal_block(self, node):
self.end_state(wrap=False, first="<pre>\n", end=['</pre>'])
出力されるもの
<pre>