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 strict'; | |
var dashboardApp = angular.module('dashboardApp', [ | |
'ngRoute', | |
'dashboardControllers' | |
]); | |
dashboardApp.config(['$routeProvider', | |
function($routeProvider) { | |
$routeProvider.when('/index', { |
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 itertools import combinations | |
my_list = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l'] | |
num_combs = len([i for i in combinations(my_list, r=3)]) | |
print num_combs |
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
# models | |
class Track(models.Model): | |
id = models.IntegerField(primary_key=True) | |
recording = models.IntegerField() | |
tracklist = models.ForeignKey(Tracklist, db_column="tracklist", related_name="tracks") | |
position = models.IntegerField() | |
name = models.CharField(max_length=255, unique=True) | |
artist_credit = models.ForeignKey( | |
ArtistCredit, |
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
@register.filter() | |
def currency(value): | |
symbol = getattr(settings, 'CURRENCY_SYMBOL', '$') | |
thousand_sep = getattr(settings, 'THOUSAND_SEPARATOR', ',') | |
decimal_sep = getattr(settings, 'DECIMAL_SEPARATOR', '.') | |
intstr = str(int(value)) | |
f = lambda x, n, acc=[]: f(x[:-n], n, [(x[-n:])]+acc) if x else acc | |
intpart = thousand_sep.join(f(intstr, 3)) | |
return "%s%s%s%s" % (symbol, intpart, decimal_sep, ("%0.2f" % value)[-2:]) |
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
<input name="" type="text" class="inputbox" value="Search" onblur= | |
"this.value=(this.value=='') ? 'Search' : this.value;" onfocus= | |
"this.value=(this.value=='Search') ? '' : this.value;" /> |
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
#Given a variable, x, that stores | |
#the value of any decimal number, | |
#write Python code that prints out | |
#the nearest whole number to x. | |
#You can assume x is not negative. | |
# x = 3.14159 -> 3 (not 3.0) | |
# x = 27.63 -> 28 (not 28.0) |
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
#Given a variable, x, that stores | |
#the value of any decimal number, | |
#write Python code that prints out | |
#the nearest whole number to x. | |
#You can assume x is not negative. | |
# x = 3.14159 -> 3 (not 3.0) | |
# x = 27.63 -> 28 (not 28.0) |
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
web: python django_project/manage.py collectstatic --noinput; bin/gunicorn_django --workers=3 --bind=0.0.0.0:$PORT django_project/settings.py |
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
NAUGHTY_WORDS = [ | |
"ass", "asswipe", "asshole", "anal", "azz", "bastard", "BDSM", "bitch", "biotch", | |
"beetch", "boob", "b00b", "blowjob", "boxmunching", "bullshita", "butthead", | |
"butthole", "clit", "cock", "cum", "cunnilingus", "cunt", "dick", "dike", "dildo", | |
"dink", "dong", "douche", "dumbass", "dung", "fag", "faggot", "fart", "fop", "fuck", | |
"fuk", "fing", "gangbang", "gay", "go black", "homo", "goddamn", "hoochie", "hooters", | |
"horny", "horney", "jacking", "jackoff", "jerking", "jism", "knockers", "kunt", "lesbo", | |
"manmeat", "manwich", "masturbate", "masterbate", "moron", "muff", "muffdive", "muncher", | |
"nigger", "nympho", "orgy", "pecker", "penus", "penis", "piss", "prick", "pussy", "rectum", | |
"rectal", "scrotum", "schlong", "shit", "slit", "slut", "sob", "tits", "twat", "whore", |
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
NOISE_WORDS = [ | |
"a","about","above","all","along","also","although","am","an","any","are","aren't", | |
"as","at","be","because","been","but","by","can","cannot","could","couldn't", | |
"did","didn't","do","does","doesn't","e.g.","either","etc","etc.","even","ever", | |
"for","from","further","get","gets","got","had","hardly","has","hasn't","having","he", | |
"hence","her","here","hereby","herein","hereof","hereon","hereto","herewith","him", | |
"his","how","however","I","i.e.","if","into","it","it's","its","me","more","most", | |
"mr","my","near","nor","now","of","on","onto","other","our","out","over","really", | |
"said","same","she","should","shouldn't","since","so","some","such","than","that", | |
"the","their","them","then","there","thereby","therefore","therefrom","therein", |
NewerOlder