Skip to content

Instantly share code, notes, and snippets.

View git-blame-stats.py
#!/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'):
View postgis install
#!/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
View gist:842597
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)
View gist:842599
from hotshot import Profile
import os.path
import sys
def main():
from scss.parser import Stylecheet
p = Stylecheet()
p.loads("""
@mixin font {
font: {
View gist:1001973
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)
View __init__.py
# Import here tests from project apps
# Main tests
# ----------
from main.tests.base import *
# Order process
from main.tests.order import *
View wsgi.py
#!/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()
View .vimrc
" ------------------------------
" .vimrc klen <horneds@gmail.com>
source ~/.vim/rc.vim
View rc.vim
filetype off
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
syntax enable
" Enable filetypes feature
filetype plugin indent on
" SETTINGS
set colorcolumn=80
View gist:3525126
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 +
You can’t perform that action at this time.