This file contains hidden or 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
# This command helps you to create pyenv virtualenv and activate that after creation. | |
# NOTE: I checked this works on zsh | |
vec() { | |
PWD=`pwd` | |
DNAME=`basename $PWD` | |
pyenv virtualenv 3.7.3 $DNAME | |
pyenv local $DNAME | |
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
#!/bin/sh | |
curl https://bootstrap.pypa.io/ez_setup.py -o /tmp/ez_setup.py | |
# install easy_install | |
python /tmp/ez_setup.py | |
# install pip | |
easy_install pip |
This file contains hidden or 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 -*- | |
# orelang: http://qiita.com/shuetsu@github/items/ac21e597265d6bb906dc | |
# dependency: click | |
import os | |
import os.path | |
import sys | |
import json | |
import click |
This file contains hidden or 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 bottle | |
from wsgiref import simple_server | |
b = bottle.Bottle() | |
def test(): | |
path = bottle.request.path | |
urlargs = bottle.request.url_args | |
query_string = bottle.request.query_string | |
url = bottle.request.url | |
return 'your path = %s, urlargs=%s, qs=%s, url=%s' % (path, urlargs, query_string, url) |
This file contains hidden or 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 logging | |
import sys | |
def main(): | |
logger = logging.getLogger(__name__) | |
logger.setLevel(logging.DEBUG) | |
handler = logging.FileHandler('/tmp/aaa.log', mode='ab', encoding='utf-8') | |
formatter = logging.Formatter('[%(levelname)s] %(message)s (%(filename)s:%(lineno)s)') |
This file contains hidden or 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 logging | |
import sys | |
def main(): | |
logger = logging.getLogger(__name__) | |
logger.setLevel(logging.DEBUG) | |
handler = logging.StreamHandler(sys.stdout) | |
formatter = logging.Formatter('[%(levelname)s] %(message)s (%(filename)s:%(lineno)s)') |
This file contains hidden or 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 time | |
# pip install click plyvel simplejson | |
import click | |
import plyvel | |
import simplejson as json | |
@click.command() |
This file contains hidden or 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 numpy as np | |
import random | |
import time | |
from contextlib import contextmanager | |
data = [] | |
for i in xrange(300000): | |
data.append(random.randint(1, 100000000)) |
This file contains hidden or 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 time | |
import hashlib | |
import os | |
from contextlib import contextmanager | |
import shutil | |
import plyvel | |
from sqlitedict import SqliteDict |
NewerOlder