Skip to content

Instantly share code, notes, and snippets.

@dodolboks
Created December 19, 2015 18:20
Show Gist options
  • Select an option

  • Save dodolboks/07dd1e51c8fe8134a5f5 to your computer and use it in GitHub Desktop.

Select an option

Save dodolboks/07dd1e51c8fe8134a5f5 to your computer and use it in GitHub Desktop.

Revisions

  1. dodolboks renamed this gist Dec 19, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. dodolboks created this gist Dec 19, 2015.
    10 changes: 10 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    from django import template

    register = template.Library()


    @register.filter
    def titlefirst(value):
    import re
    s = re.sub("(^|\s)(\S)", repl_func, value)
    return s