Skip to content

Instantly share code, notes, and snippets.

View shimizukawa's full-sized avatar

Takayuki SHIMIZUKAWA shimizukawa

View GitHub Profile
sample.py:6: undefined name 'h'
sample.py:9: undefined name 'z'
@shimizukawa
shimizukawa / conf.py
Last active August 29, 2015 14:13
Sphinx (http://sphinx-doc.org/) autodoc example
# -*- coding: utf-8 -*-
import sys
import os
sys.path.insert(0, os.path.abspath('.')) # directory path that contain 'foo.py'
extensions = [
'sphinx.ext.autodoc',
]
@shimizukawa
shimizukawa / README.rst
Last active August 29, 2015 14:08
link2rst : Sphinx linkto context function for template of HTML builder. (CC BY)
@shimizukawa
shimizukawa / rst2html.py
Created October 4, 2014 00:06
rst2html.py to work with dotfigure directive plugin
#!D:\venv\Scripts\python.exe
# $Id: rst2html.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: David Goodger <[email protected]>
# Copyright: This module has been placed in the public domain.
"""
A minimal front end to the Docutils Publisher, producing HTML.
"""
vagrant@precise64:/tmp/test$ make latexpdf SPHINXOPTS="-D language=it"
sphinx-build -b latex -d _build/doctrees -D language=it . _build/latex//it
Running Sphinx v1.2.3
loading translations [it]... done
loading pickled environment... not yet created
building [latex]: all documents
updating environment: 1 added, 0 changed, 0 removed
reading sources... [100%] index
looking for now-outdated files... none found
pickling environment... done
@shimizukawa
shimizukawa / sphinx-translation-procedure.rst
Last active August 29, 2015 14:04
sphinx translation procedure for users (draft)

$ pip install sphinx[intl]

$ sphinx-quickstart
  • wizard: translations
  • wizard: language
  • edit conf.py (optional):
    • add translations
    • set language
@shimizukawa
shimizukawa / pep426-environment-markers.rst
Last active August 29, 2015 14:03
PEP426 environment markers の調査
@shimizukawa
shimizukawa / 201723133-Billing-FAQ.rst
Last active August 16, 2018 02:13
【Slack FAQ 翻訳】 2014/6/23 支払いFAQ - Billing FAQ - Slack Help Center
@shimizukawa
shimizukawa / 202518103-Restricted-Accounts-and-Single-Channel-Guest-FAQ.rst
Last active August 29, 2015 14:02
【Slack FAQ 翻訳】 2014/6/23 制限アカウントとシングルチャンネルゲスト FAQ Restricted Accounts and Single-Channel Guest FAQ
@shimizukawa
shimizukawa / timeit_context.py
Created June 23, 2014 06:58
small implementation for time scaling context : 時間計測するcontext
import time
import contextlib
class TimeIt(object):
def __init__(self):
self._start = 0
self._end = 0
def begin(self):
self._start = time.time()
return self._start