This file contains 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
def add_preview_for(*fields): | |
""" | |
This is a decorator for model classes that adds preview methods. | |
So instead of manually adding preview methods: | |
>>> class Student(models.Model): | |
... photo = models.ImageField() | |
... icon = models.ImageField() | |
... |
This file contains 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
function Gauge(placeholderName, configuration) | |
{ | |
this.placeholderName = placeholderName; | |
var self = this; // for internal d3 functions | |
this.configure = function(configuration) | |
{ | |
this.config = configuration; | |
This file contains 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
#!/bin/sh | |
git filter-branch --env-filter ' | |
an="$GIT_AUTHOR_NAME" | |
am="$GIT_AUTHOR_EMAIL" | |
cn="$GIT_COMMITTER_NAME" | |
cm="$GIT_COMMITTER_EMAIL" | |
if [ "$GIT_COMMITTER_EMAIL" = "root@ubuntu.(none)" ] |
This file contains 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
def match(pattern,text): | |
if pattern[0] == '^': | |
return match_here(pattern[1:], text) | |
if match_here(pattern,text): | |
return 1 | |
while text: | |
if match_here(pattern,text): | |
return 1 |