Skip to content

Instantly share code, notes, and snippets.

import re
wkt_regex = re.compile(r'^(SRID=(?P<srid>\-?\d+);)?'
r'(?P<wkt>'
r'(?P<type>POINT|LINESTRING|LINEARRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON|GEOMETRYCOLLECTION)'
r'[ACEGIMLONPSRUTYZ\d,\.\-\(\) ]+)$',
re.I)
with open('test.wkt', 'r') as fd:
wkt=fd.read().strip('\n').strip(' ')
import soundcloud
import sys
from pprint import pprint
from gmusicapi import Mobileclient
import re
track_regex = r"(\d+)*\s*[-_]\s*(.+)\s*[-_]\s*(.+)\s*[-_]\s*(.+){,1}"
REG = re.compile(track_regex)
api = Mobileclient()
@dopuskh3
dopuskh3 / git-commit-validator.py
Last active August 29, 2015 14:07
git commit validator
#!/usr/bin/env python
from nltk.corpus import verbnet
import sys
class CommitException(Exception):
def __init__(self, msg, line, start, end, fatal=False):
Exception.__init__(self,msg)
self._line = line
self._start = start

Perfect vim/git setup for clean commit messages

Install vim-git plugin (dopuskh3/vim-git add fancy color for commit message title) but the official plugin is fine too.

If you use Vundle:

Bundle "dopuskh3/vim-git"
./make-distribution.sh --tgz -Pyarn -Dhadoop.version=2.6.0-cdh5.4.3
./make-distribution.sh --tgz -Pyarn -Dhadoop.version=2.0.0-cdh4.3.2
#!/usr/bin/env python
from nltk.corpus import verbnet
import sys
class CommitException(Exception):
def __init__(self, msg, line, start, end, fatal=False):
Exception.__init__(self,msg)
self._line = line
self._start = start
#!/usr/bin/env python
"""
Usage:
add this to your setup.py:
...
cmdclass={'bundle': BundleInstall},
...
Will add a bundle setup.py command that create a bundle archive in dist directory by running