This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from pymongo import MongoClient | |
from datetime import datetime | |
import time | |
limit = 100000 | |
print('insert count {0}'.format(limit)) | |
class Timer(object): | |
def __init__(self, verbose=False): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import time | |
class Timer(object): | |
def __init__(self, verbose=False): | |
self.verbose = verbose | |
def __enter__(self): | |
self.start = time.time() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo ln -s /usr/include/luajit-2.0 /usr/include/lua | |
sudo ln -s /usr/lib/x86_64-linux-gnu/libluajit-5.1.so /usr/lib/libluajit.so | |
sudo ln -s /usr/bin/luajit-2.0.0-beta9 /usr/bin/lua | |
./configure --with-features=huge --enable-multibyte --enable-luainterp --with-luajit --enable-pythoninterp --with-python-config-dir=/usr/local/lib/python2.7/config --enable-rubyinterp --enable-perlinterp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install luajit | |
let $LUA_DLL="/usr/local/Cellar/luajit/2.0.2/lib/libluajit-5.1.dylib" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, time | |
sys.setrecursionlimit(10) | |
def gen1(): | |
count = 0 | |
while True: | |
count = count + 1 | |
print count | |
if count > 10: | |
return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pip freeze | |
Django==1.5 | |
Jinja2==2.6 | |
MySQL-python==1.2.4 | |
South==0.7.6 | |
distribute==0.6.31 | |
django-jinja==0.11 | |
django-object-tools==0.0.7 | |
django-south-admin==0.0.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gntp.notifier | |
import pumblr | |
growl = gntp.notifier.GrowlNotifier( | |
applicationName = "My Application Name", | |
notifications = ["New Messages"], | |
defaultNotifications = ["New Messages"], | |
) | |
growl.register() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
ウェブで拾った便利な関数たち | |
""" | |
import os, sys, time | |
from django.core.validators import email_re | |
try: | |
from PIL import Image | |
except ImportError: | |
raise ImportError, 'Unable to import PIL module.' |
NewerOlder