Skip to content

Instantly share code, notes, and snippets.

Todo 2014-07-04

  • 18:00 回家
  • 休息

Todo 2014-07-05

  • 0:00 看世界杯
import os
import logging
import logging.config
from logging import FileHandler
log_file = os.path.join(os.path.dirname(__file__), 'test.log')
brief_formatter = logging.Formatter('%(asctime)s:%(levelname)s:%(message)s')
file_handler = FileHandler(log_file)
module.exports = function(grunt) {
"use strict";
// Project configuration.
grunt.initConfig({
clean: {
dist: ['dist/js', 'dist/css', 'dist/img'],
},
import os
import sys
from tornado.options import options, define, parse_command_line
import django.core.handlers.wsgi
import tornado.httpserver
import tornado.ioloop
import tornado.web
import tornado.wsgi
<uwsgi>
<socket>:8077</socket>
<chdir>$PROJECT_ROOT</chdir>
<module>django_wsgi</module>
<processes>4</processes>
<daemonize>uwsgi.log</daemonize>
</uwsgi>
#!/usr/bin/env python
from django.core.management import execute_manager
from django.core.management import find_commands
from django.core.handlers.wsgi import WSGIHandler
import os
import imp
import sys
from os.path import abspath, dirname, join
#!/usr/bin/python
import hotshot.stats
import sys
stats = hotshot.stats.load(sys.argv[1])
#stats.strip_dirs()
stats.sort_stats('time', 'calls')
stats.print_stats(20)
import hotshot
import os
import time
import settings
import tempfile
try:
PROFILE_LOG_BASE = settings.PROFILE_LOG_BASE
except:
PROFILE_LOG_BASE = tempfile.gettempdir()
@zackshen
zackshen / gist:6882965
Created October 8, 2013 10:55
build vim with python support
./configure --with-features=huge --enable-rubyinterp --enable-pythoninterp --enable-perlinterp --enable-cscope --enable-luainterp --with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu/