Skip to content

Instantly share code, notes, and snippets.

View takuan-osho's full-sized avatar
🏠
Working from home

SHIMIZU Taku takuan-osho

🏠
Working from home
View GitHub Profile
<span style="font-weight:bold; font-size:110%;">■Sphinx を用いて、 reST の文章を Blogger の原稿に変換する</span>
<a href="http://atnd.org/events/3015">BPStudy #30</a> にてSphinx講座があったので、早速それを生かしてreSTでBlogger向けの原稿を作ってみることにします。
<span style="font-weight:bold; font-size:110%;">■見出しのテスト</span>
Hello world!
foo bar
@hnagato
hnagato / DefaultKeyBinding.dict
Last active February 19, 2018 09:28
Cocoaのキーバインドをよりemacsに近づける
/* ~/Library/KeyBindings/DefaultKeyBinding.dict */
{
/* Auto-Paring */
// "(" = ( "insertText:", "()", "moveBackward:" );
// "{" = ( "insertText:", "{}", "moveBackward:" );
// "[" = ( "insertText:", "[]", "moveBackward:" );
"~f" = "moveWordForward:"; /* M-f */
"~b" = "moveWordBackward:"; /* M-b */
"~<" = "moveToBeginningOfDocument:"; /* M-< */
@omarish
omarish / csv2json.py
Created November 11, 2010 00:52
Easily convert a CSV file to JSON.
#!/usr/bin/env python
import csv
try: import simplejson as json
except: import json
from optparse import OptionParser
def main():
usage = "usage: csv2json: %prog [options] arg"
parser = OptionParser()
parser.add_option("-i","--input",dest="input",help="input csv file")
# Add correct content-type for fonts
AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType font/x-woff .woff
AddType image/svg+xml .svg
# Compress compressible fonts
AddOutputFilterByType DEFLATE font/ttf font/otf image/svg+xml
@laiso
laiso / hatenaoauth_example.py
Last active August 10, 2022 13:29
Pythonではてなの OAuth 対応 API を利用する
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
フレームワークとして Flask(http://flask.pocoo.org/) を、OAuth ライブラリとして oauth2(http://pypi.python.org/pypi/oauth2/) を利用したサンプルプログラムです。
下のコードを保存して (oauth_consumer.py とします)、YOUR_CONSUMER_KEY, YOUR_CONSUMER_SECRET となっている部分を自分の consumer_key, consumer_secret で置き換えます。
$ python oauth_consumer.py
... で起動してから http://localhost:5000 に Web ブラウザでアクセスして下さい。
@chrishamant
chrishamant / guestbook.go
Created July 11, 2011 13:30
Go Lang app engine sample
// Copyright 2011 Google Inc. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
package guestbook
import (
"http"
"io"
"os"
@bemasher
bemasher / Castle.xml
Created September 18, 2011 03:46
Example of parsing xml in golang.
<?xml version="1.0" encoding="UTF-8" ?>
<Data>
<Series>
<id>83462</id>
<Actors>|Nathan Fillion|Stana Katic|Molly C. Quinn|Jon Huertas|Seamus Dever|Tamala Jones|Susan Sullivan|Ruben Santiago-Hudson|Monet Mazur|</Actors>
<Airs_DayOfWeek>Monday</Airs_DayOfWeek>
<Airs_Time>10:00 PM</Airs_Time>
<ContentRating>TV-PG</ContentRating>
<FirstAired>2009-03-09</FirstAired>
<Genre>|Drama|</Genre>
@kk6
kk6 / read_ff_cookies.py
Created October 23, 2011 17:29
http://goo.gl/aw41c を見てなんとなく書いてみるなど。
#-*- coding:utf-8 -*-
# Python 3.2 でのみ動作確認済み
# Python 2.7 で実行するとDatabaseError になりました。
import sqlite3
# 適宜cookies.sqliteファイルまでのpathを編集
COOKIES = r"cookies.sqlite"
@troter
troter / mercurial-introduction.rst
Created October 30, 2011 09:51
SCMBC #2 Mercurial入門セッション資料(のたたき台) move to https://bitbucket.org/troter/scmbc-2011.11-mercurial-introsession

Mercurial 入門セッション資料

この資料について

  • SCMBC #2 Mercurial 入門セッション資料(のたたき台)です。
  • TODO たとえ話募集中

(おまけ)分散バージョン管理全般の利点

@shimizukawa
shimizukawa / pythonstartup.py
Created November 8, 2011 14:39
PYTHONSTARTUP
# -*- encoding: utf-8 -*-
try:
import pyreadline.rlmain
#pyreadline.rlmain.config_path=r"c:\xxx\pyreadlineconfig.ini"
import readline,atexit
import pyreadline.unicode_helper
#
#
#Normally the codepage for pyreadline is set to be sys.stdout.encoding
#if you need to change this uncomment the following line