Skip to content

Instantly share code, notes, and snippets.

View imankulov's full-sized avatar

Roman Imankulov imankulov

View GitHub Profile
@janogarcia
janogarcia / email_coding_guidelines.md
Last active March 13, 2024 12:13
Email Coding Guidelines
@janogarcia
janogarcia / css_coding_guidelines.md
Last active February 13, 2022 03:13
CSS Coding Guidelines
@jsykora
jsykora / xml_tags.py
Created January 25, 2012 15:00
Django XML Line breaks template filter
from django.template import Library
from django.template.defaultfilters import stringfilter
from django.utils.safestring import mark_safe, SafeData
from django.utils.html import escape
from django.utils.text import normalize_newlines
register = Library()
@register.filter()
@stringfilter
@NetAngels
NetAngels / runner.py
Created June 24, 2011 04:21
Extremely fast Django test runner
# -*- coding: utf-8 -*-
"""
Extremely fast Django test runner, based on the idea that your database schema
and fixtures are changed much more seldom that your code and tests. All you
need is to make sure that your "quickstart.sqlite" database file is always up
to date.
BEWARE: Don't run this test runner on production server. It assumes that you
use only one database configured as "default", and its db engine is SQLite.
Otherwise your tests can eat your data!
#!/bin/bash
# To run do:
# wget https://gist.github.com/raw/850359/ea02e22f021b7ebf2f602811461677ab4a3f2a9e/bootstrap.sh && chmod +x bootstrap.sh && ./bootstrap.sh && source ~/.profile
#
# Based on Amazon EC2 AMI ID ami-ccf405a5 Ubuntu Server 10.10
# This script will:
# * install/config apache2
# * install mod_wsgi
# * install/config nginx
"""
jQuery templates use constructs like:
{{if condition}} print something{{/if}}
This, of course, completely screws up Django templates,
because Django thinks {{ and }} mean something.
Wrap {% verbatim %} and {% endverbatim %} around those
blocks of jQuery templates and this will try its best