Skip to content

Instantly share code, notes, and snippets.

View tomoh1r's full-sized avatar
💭
I may be slow to respond.

NAKAMURA, Tomohiro tomoh1r

💭
I may be slow to respond.
View GitHub Profile
@tomoh1r
tomoh1r / gist:1342308
Created November 6, 2011 01:10
easy_install -U all みたいな
easy_install -U `python -c "for dist in [dist for dist in __import__('pkg_resources').working_set if dist.project_name != 'Python']: print dist.project_name"`
@tomoh1r
tomoh1r / gist:1560221
Created January 4, 2012 14:14
PHP5.4RC4 ビルド用のシェルスクリプト
#!/bin/sh
# このページより PHP のオプションを参考にいたしました。
# http://blog.madapaja.net/2011/12/php54-symfony2.html
# 下記のページより、ビルド用シェルスクリプトの着想を得ました。
# http://okwave.jp/qa/q566511.html
# 改めて御礼いたします。
cd php-5.4.0RC4
make clean
./configure \
--prefix=/path/to/php-5.4.0RC4 \
@tomoh1r
tomoh1r / error.log
Created January 4, 2012 15:31
PHP5.4RC4でSilexを動かしたときのエラー
Fatal error: Call to undefined method Symfony\Component\ClassLoader\UniversalClassLoader::registerNamespaces() in phar:///path/to/silex/silex.phar/autoload.php on line 10
@tomoh1r
tomoh1r / DeleteUTF8Bom.vbs
Created January 14, 2012 15:43
UTF-8 の BOM を削除する VBScript
Option Explicit
' ==================================================================================
' UTF-8 のファイルのBOMを削除するVBScript
' ファイルをドラッグ&ドロップして利用する。
' 2012/01/14 Nakamura, Tomohiro
' This Software is under CC0
' ADODB の為、要Excel
' ==================================================================================
Dim adTypeBinary, adTypeText, adSaveCreateOverWrite
@tomoh1r
tomoh1r / requirements.txt
Created March 8, 2012 07:51
gae for python 用 requirements.txt
PIL
MySQL-python
Jinja2
@tomoh1r
tomoh1r / test_flake8.py
Created June 17, 2012 16:23
flake8 をテストで利用する場合のサンプルを作ってみた。あってんのかなー
# -*- coding: utf-8 -*-
'''以下のようなディレクトリ構成を想定する。
├── src
│    ├── fizzbuzz
│       ├── __init__.py
│        └── main.py
└── test
    ├── __init__.py
   ├── test_flake8.py - このテストファイル
  └── test_main.py - main.py 用テスト
@tomoh1r
tomoh1r / hoge.py
Created August 4, 2012 03:38
__init__ のテスト
class Hoge(object):
def __init__(self, *args, **kwargs):
super(type(self), self).__init__()
@tomoh1r
tomoh1r / test_prototype.js
Created December 15, 2012 13:55
親の値を変えてあげれば子の値に伝播するテスト
'use strict';
var Hoge = Object.create(null);
Hoge.x = 10;
var h = Object.create(Hoge);
console.log(h.x);
// => 10
Hoge.x = 20;
console.log(h.x);
// => 20
@tomoh1r
tomoh1r / test_prototype.js
Created December 15, 2012 13:59
親の値を変えてあげれば、複数であったとしても、子の値に伝播するテスト
'use strict';
var Hoge = Object.create(null);
Hoge.x = 10;
var h = Object.create(Hoge);
var f = Object.create(Hoge);
console.log(h.x);
// => 10
console.log(f.x);
// => 10
@tomoh1r
tomoh1r / test_inherit.py
Created December 15, 2012 14:04
インスタンスについて、親クラスの変数の値を変えたらどうなるか、インスタンス自身の値を変えたらどうなるかテスト
# coding: utf-8
class Hoge(object):
x = 100
hoge = Hoge()
print(hoge.x)
# => 100