Skip to content

Instantly share code, notes, and snippets.

View sergeynikiforov's full-sized avatar

Sergei Nikiforov sergeynikiforov

View GitHub Profile
@sergeynikiforov
sergeynikiforov / cloudinaryResponsive.py
Last active November 28, 2015 16:35
Function to construct HTML5 <picture> elt. (Django 1.8, Python 2.7, Cloudinary)
import sys
from django.utils.html import format_html
from django.utils.safestring import mark_safe
import cloudinary
def pictureElement(publicID, sizes, srcset, alt):
"""
constructs HTML5 <picture> element with passed
sizes, srcset and alt parameters from Cloudinary publicID image
@sergeynikiforov
sergeynikiforov / prepare-commit-msg
Created August 22, 2016 06:37
git hook to automatically prepend commit message with '<branch_name>: '
#!/bin/sh
#
# Automatically prepends commit message with a branch name.
#
NAME=$(git branch | grep '*' | sed 's/* //')
echo -n "$NAME"': '| cat - "$1" > /tmp/out && mv /tmp/out "$1"
# Set CLICOLOR if you want Ansi Colors in iTerm2
export CLICOLOR=1
# Set colors to match iTerm2 Terminal Colors
export TERM=xterm-256color
# Customize terminal prompt
# export PS1="\u \W $ "
# virtualenv prompt