Skip to content

Instantly share code, notes, and snippets.

View javiertejero's full-sized avatar

Javier Tejero javiertejero

  • TravelPerk
  • Barcelona, Spain
View GitHub Profile

Markdown and reStructuredText

GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.

class ReloaderEventHandler(FileSystemEventHandler):
"""
Listen for changes to modules within the Django project
On change, reload the module in the Python Shell
Custom logic required to reload django models.py modules
Due to the singleton AppCache, which caches model references.
For those models files, we must clear and repopulate the AppCache
"""
def __init__(self, *args, **kwargs):
#
# templatetags/kwacros.py - Support for macros in Django templates
#
# Based on snippet by
# Author: Michal Ludvig <michal@logix.cz>
# http://www.logix.cz/michal
#
# modified for args and kwargs by Skylar Saveland http://skyl.org
#
@javiertejero
javiertejero / hl.py
Created October 29, 2012 09:32 — forked from dshafik/hl.py
CLI syntax highlighter
#!/usr/bin/env python
"""
GistID: 3972600
(this lives in the cloud at github gist:3972600/hl.py)
Highlight stdin using pygments and output to stdout
Auto-detects the input language.
Will not colorize if piped into something else.