Skip to content

Instantly share code, notes, and snippets.

@skitazaki
skitazaki / tsv2excel.py
Created February 3, 2014 08:50
Bind multiple TSV files into Excel workbook.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Bind multiple TSV files into Excel workbook.
Requires "xlwt" for Python 2.x, or "xlwt-future" for Python 3.x series.
"""
import os
import sys
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>東京ポリゴン</title>
<meta name="description" content="">
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@skitazaki
skitazaki / urlopen-py3.py
Created November 17, 2014 14:01
See [encoding - Python 3, let json object accept bytes or let urlopen output strings - Stack Overflow](http://stackoverflow.com/questions/6862770/python-3-let-json-object-accept-bytes-or-let-urlopen-output-strings)
#!/usr/bin/env python3
# See:
# encoding - Python 3, let json object accept bytes or let urlopen output strings - Stack Overflow
# http://stackoverflow.com/questions/6862770/python-3-let-json-object-accept-bytes-or-let-urlopen-output-strings
import json
import urllib.request
REMOTE_URL = 'http://data.okfn.org/data/cpi/datapackage.json'
res = urllib.request.urlopen(REMOTE_URL)
@skitazaki
skitazaki / csv-blank-counter.go
Last active August 29, 2015 14:12
Read CSV file and report blank counts of each field.
package main
import (
"bufio"
"encoding/csv"
"fmt"
log "github.com/Sirupsen/logrus"
"github.com/docopt/docopt-go"
"golang.org/x/text/encoding/japanese"
"golang.org/x/text/transform"
@skitazaki
skitazaki / layout.html
Created April 11, 2012 13:08
Sphinx template using Twitter Bootstrap
{#
default/layout.html
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
Sphinx layout template for the default theme.
:copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
#}
{% extends "basic/layout.html" %}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@skitazaki
skitazaki / svnlog.py
Created August 22, 2012 15:47
Dump Subversion log and diff
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""%prog [options] svn-repository [svn-repository [ ... ]]
"""
import argparse
import codecs
import datetime
@skitazaki
skitazaki / amd-memo.rst
Last active December 10, 2015 19:58 — forked from anonymous/amd-memo.rst

AMD (Asynchronous Module Definition) のメモ

従来からの JavaScript の書き方だと「定義」するときにグルーバル環境を汚染してしまう課題があった。 window.Hoge みたいに書いてしまう問題。 回避策はたくさんあるけど、人によって書き方が異なると「使う」ときに大変。 特に複数のライブラリが依存し合うスクリプトの場合、読み込み順序に気を配る必要がある。 こうした "Definition" と "Dependency References" の課題を解決する方法のひとつとして AMD (Asynchronous Module Definition) がある。

@skitazaki
skitazaki / dbschema2rest.py
Created July 9, 2013 02:26
Dump database table schema as reST text.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Dump database table schema as reST text.
This script requires configuration file which include title text and database
connection string.
Example configuration file is defined below in JSON ::