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
phone_char_mappings = { | |
'A': '2', 'B': '2', 'C': '2', | |
'D': '3', 'E': '3', 'F': '3', | |
'G': '4', 'H': '4', 'I': '4', | |
'J': '5', 'K': '5', 'L': '5', | |
'M': '6', 'N': '6', 'O': '6', | |
'P': '7', 'R': '7', 'S': '7', | |
'T': '8', 'U': '8', 'V': '8', | |
'W': '9', 'X': '9', 'Y': '9', | |
'1': '1', '2': '2', '3': '3', |
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
import os | |
"""OS X only""" | |
def sing(): | |
for i in range(0, 99): | |
num = 99 - i | |
os.system("say %s bottles of beer on the wall, %s bottles of beer, if one of those bottles should happen to fall, %s bottles of beer on the wall" % (num, num, num-1)) | |
if __name__ == '__main__': |
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", |
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
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
#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
<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
@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
# 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, |
OlderNewer