Skip to content

Instantly share code, notes, and snippets.

View skliarpawlo's full-sized avatar

Pavlo Skliar skliarpawlo

  • Tubular
  • Ukraine, Kiev
View GitHub Profile
@skliarpawlo
skliarpawlo / layout.py
Last active August 29, 2015 14:18
layout of items sequentially taking (slot types:item type) mapping into account
from blog.const import NEWS_TILE_TYPE
from catalog.const import PRODUCTS_TILE_TYPE, FEATURED_PRODUCTS_TILE_TYPE
from index.services.query import get_tiles_qs
PER_PAGE = 6
# list of layouts 'id's
LAYOUTS_PATTERN = [0, 3, 1]
# all tile type should be listed here, used for iterating
@skliarpawlo
skliarpawlo / pep8ify.py
Created February 3, 2015 11:01
pep8ify script
"""
Script auto-formats all files you changed.
pep8ify.py [commit_from, [commit_to]]
- If no parameters passed it formats all files added for commit
- If one parameter passed (it should be link to commit), and it will format all files changed there, like for: commit_from~1..commit_from
- If two parameter passed it should be link to commit, and it will format all files changed there, like for: commit_from..commit_to
If you want to use it for automatically, create file .git/hooks/pre-commit with content: