This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Mark external links that have the rel="external" | |
attribute set with a FontAwesome icon. */ | |
a[rel~="external"]:after { | |
content: "\f08e"; | |
display: inline-block; | |
font-family: FontAwesome; | |
font-size: 80%; | |
font-style: normal; | |
font-weight: normal; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""Demonstrate a possible bug in SQLAlchemy. | |
Setting the `echo` argument of sqlalchemy.create_engine() crashes some versions | |
of SQLAlchemy. Tested with Python 2.7.6. See results for SQLAlchemy versions | |
below. | |
Setting ENGINE_ECHO to True or False (depending on your SQLAlchemy version) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# colored stream handler for python logging framework (use the ColorStreamHandler class). | |
# based on: | |
# http://stackoverflow.com/questions/384076/how-can-i-color-python-logging-output/1336640#1336640 | |
# Copyright (c) 2014 Markus Pointner | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- How to eliminate the following sub queries? | |
INSERT INTO photos_tags (photo_id, tag_id) VALUES (?, (SELECT id FROM tags WHERE name=?)); | |
-- Becomes: | |
INSERT INTO photos_tags (photo_id, tag_id) SELECT ?, id FROM tags WHERE name=?; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import codecs | |
import subprocess | |
from fdfgen import forge_fdf | |
from django.template import Template, loader | |
from django.template.loader import find_template, LoaderOrigin | |
class PdfTemplateError(Exception): |