Skip to content

Instantly share code, notes, and snippets.

View cborgolte's full-sized avatar

Christoph Borgolte cborgolte

View GitHub Profile
@cborgolte
cborgolte / browser
Created October 31, 2012 11:56 — forked from defunkt/browser
pipe html to a browser (linux/gnome version)
#!/bin/sh -e
#
# Usage: browser
# pipe html to a browser
# e.g.
# $ echo '<h1>hi mom!</h1>' | browser
# $ ron -5 man/rip.5.ron | browser
if [ -t 0 ]; then
if [ -n "$1" ]; then
@cborgolte
cborgolte / include_as.py
Created August 11, 2012 14:00
include_as tag for Django templates. Renderd string will be saved in a variable.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
include_as.py - extended include tag for django templates.
Provides the 'as' option when including a template inside a template.
If this option is used, the rendered content is saved to the variable given
after the 'as' statement.
@cborgolte
cborgolte / blocktrans.py
Created May 11, 2012 14:54
Put parts of my django templates in {% blocktrans %}-blocks.
#!/usr/bin/env python
"""
Quick and dirty script I use from within vim to put parts of my django templates in {% blocktrans %}-blocks.
Usage:
Visually mark the code inside vim and then pipe it to this script (:!blocktrans.py)
"""