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
// Python style | |
function Class() { | |
var self = this; | |
this.__init__ = function(x, y){ | |
self.x = x; | |
self.y = y; | |
}; | |
this.__str__ = function(){ | |
log('<' + self.x + self.y + '>'); |
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 clean_data(self): | |
filetype = self.cleaned_data['data'].content_type | |
if not filetype == 'application/pdf': | |
raise forms.ValidationError( | |
'"{}" is not a valid file. Please upload a valid .PDF.') | |
else: | |
return self.cleaned_data['data'] |
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
var d3 = function(){ | |
var self = this; | |
this.foo = function() { | |
return this; | |
}; | |
this.range = function(max) { | |
var x = []; | |
for(var i = 0 ; i < max; i++) { | |
x.push(i); | |
} |
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
/* Bootstrap overrides */ | |
.bg-primary, | |
.bg-success, | |
.bg-info, | |
.bg-warning, | |
.bg-danger { | |
padding: 1em; | |
} |
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
class ... | |
class Meta: | |
_textarea = forms.Textarea(attrs={'cols': 40, 'rows': 5}) | |
model = models.MyModel | |
widgets = { | |
'field1': _textarea, | |
'field2': _textarea, | |
'field3': _textarea, | |
'field4': _textarea, | |
} |
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
from pyquery import PyQuery as pq | |
import json | |
base_url = 'http://www.logolounge.com/article/' | |
years = ['2003trends', '2004trends', '2005trends', '2006trends', | |
'2007trends', '2008trends', 'minortrendanimotion', | |
'2009trends', '2010trends', '2011trends', | |
'2012logotrends', '2013logotrends', '2014logotrends'] |
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
// use @hack to specify all selectors that should be removed at a later point in time! | |
// @hack | |
#shitty-overqualified-id { | |
font-size: 12.em; | |
} | |
// @hack | |
#another-overqualified-id { | |
padding: 1.3m; | |
} |
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
from django.db import models | |
DJANGO_FIELDS = ( | |
(str(field).upper(), field) | |
for field in dir(models) if field.endswith('Field') | |
) |
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
window.pyfuncs = pyfuncs || {}; | |
pyfuncs.string.ascii_lowercase = function() { | |
return 'abcdefghijklmnopqrstuvwxyz'; | |
}; | |
pyfuncs.string.ascii_uppercase = function() { | |
return pyfuncs.string.ascii_lowercase().toUpperCase(); | |
}; |
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
"([a-zA-Z][0-9],|.)+" |