Skip to content

Instantly share code, notes, and snippets.

View klen's full-sized avatar

Kirill Klenov klen

View GitHub Profile
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import os
import sys
import re
def main(additional=''):
re_author = re.compile(r'^.*?\((.*?)\s*\d{4}-\d{2}-\d{2}.*')
authors = {}
for filename in os.popen('git ls-tree --name-only -r HEAD'):
#!/bin/sh
POSTGISCONTRIB_PATH=`pg_config --sharedir`/contrib
POSTGIS=$(find $POSTGISCONTRIB_PATH -name 'postgis.sql')
POSTGIS_COMMENTS=$(find $POSTGISCONTRIB_PATH -name 'postgis_comments.sql')
POSTGIS_SPATIAL=$(find $POSTGISCONTRIB_PATH -name 'spatial_ref_sys.sql')
if [ -z "$POSTGIS" ] || [ -z "$POSTGIS_SPATIAL" ]; then
echo " * Not found postgis contrib files."
exit 1
@klen
klen / gist:842597
Created February 24, 2011 18:18
Profiler log
Ordered by: internal time
ncalls tottime percall cumtime percall filename:lineno(function)
3698/4 0.033 0.000 0.078 0.019 /usr/local/lib/python2.6/dist-packages/pyparsing.py:926(_parseNoCache)
814/4 0.009 0.000 0.019 0.005 /usr/local/lib/python2.6/dist-packages/pyparsing.py:2342(streamline)
477/16 0.008 0.000 0.077 0.005 /usr/local/lib/python2.6/dist-packages/pyparsing.py:2531(parseImpl)
107/56 0.007 0.000 0.020 0.000 /usr/lib/python2.6/sre_parse.py:385(_parse)
905/105 0.007 0.000 0.074 0.001 /usr/local/lib/python2.6/dist-packages/pyparsing.py:2406(parseImpl)
872/5 0.005 0.000 0.019 0.004 /usr/local/lib/python2.6/dist-packages/pyparsing.py:2704(streamline)
2955 0.005 0.000 0.005 0.000 /usr/local/lib/python2.6/dist-packages/pyparsing.py:1442(streamline)
from hotshot import Profile
import os.path
import sys
def main():
from scss.parser import Stylecheet
p = Stylecheet()
p.loads("""
@mixin font {
font: {
from django.db import models
class Entry(models.Model):
title = models.CharField()
active = models.BooleanField()
def __init__(self, *args, **kwargs):
super(Entry, self).__init__(*args, **kwargs)
# Import here tests from project apps
# Main tests
# ----------
from main.tests.base import *
# Order process
from main.tests.order import *
#!/usr/bin/env python
import os
from django.core.handlers.wsgi import WSGIHandler
# Celery settings:
os.environ['CELERY_LOADER'] = 'django'
os.environ['DJANGO_SETTINGS_MODULE'] = os.environ.get('DJANGO_SETTINGS_MODULE', 'settings.dev')
application = WSGIHandler()
@klen
klen / .vimrc
Created October 12, 2011 17:36
" ------------------------------
" .vimrc klen <[email protected]>
source ~/.vim/rc.vim
@klen
klen / rc.vim
Created October 24, 2011 10:23
filetype off
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
syntax enable
" Enable filetypes feature
filetype plugin indent on
" SETTINGS
set colorcolumn=80
30.08 13:53:59 root INFO #177619 <A: Казанский вокзал> CanceledByUser
30.08 13:53:59 root INFO Published
30.08 13:53:59 root INFO Rule: #523 Правило вхождения в интервал времени [#1556 +Такси Адмирал: Комфорт (день) (Standard) (09:00—20:59) [geo]] True
30.08 13:53:59 root INFO Rule: #525 Правило вхождения в интервал времени [#1557 +Такси Адмирал: Комфорт (ночь) (Standard) (21:00—08:59) [geo]] False
30.08 13:53:59 root INFO Rule: #35 Правило минимального времени подачи [#1274 +Globus Taxi: Комфорт (день) (Standard) (07:00—21:59) [geo]] False
30.08 13:53:59 root INFO Rule: #34 Правило минимального времени подачи [#1273 +Globus Taxi: Комфорт (ночь) (Standard) (22:00—06:59) [geo]] False
30.08 13:53:59 root INFO Rule: #31 Правило минимального времени подачи [#1090 +Globus Taxi: Аэропорт (комфорт\встреча) (Standard) (00:00—23:59) [geo]] False
30.08 13:53:59 root INFO Rule: #32 Правило минимального времени подачи [#1091 +