This file contains hidden or 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
# DANGERZONE!! This is globally overriding default python behavior. Caveat emptor | |
# FAKE_DATE=1999-01-01 python | |
# >>> import datetime_hack, datetime | |
# >>> datetime.date.today() | |
# 1999-01-01 | |
import datetime | |
import os |
This file contains hidden or 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
for i in range(1,100): | |
if not i%15: | |
print "fizzbuzz" | |
elif not i%3: | |
print "fizz" | |
elif not i%5: | |
print "buzz" |
This file contains hidden or 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() { | |
function _t(func) { | |
return function() { | |
return func(window.moment(new Date(this))); | |
} | |
} | |
String.prototype.date = _t( | |
function date(moment) { return moment.format("YYYY-MM-DD") } | |
) | |
String.prototype.verbose_date = _t(function (m){ |
This file contains hidden or 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
/* | |
Removes the minimum leading whitespace for each line in a pre > code tag. | |
Also optionally escapes html if you include the "nuke-html" class | |
When writing HTML snippets for slides or blogs, it's a pain to have to do this: | |
</div> <!-- original indentation level --> | |
<pre><code class="html"><ul class="demo"> | |
<li>No order here</li> | |
<li>Or here</li> | |
<li>Or here</li> |
This file contains hidden or 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 json, datetime, math, os | |
model_names = ['Subscription'] | |
for model_name in model_names: | |
with open("%s.json"%model_name,'r') as f: | |
subscriptions = json.loads(f.read()) | |
fields = {} | |
max_lengths = {} | |
nulls = {} |
This file contains hidden or 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 do_later () { | |
var args = arguments, | |
callback, | |
timeout; | |
if(args.length < 2) { | |
throw new Error("Function do_later requires at least two arguments, " + args.length + " given"); | |
} |
This file contains hidden or 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 DiabloAccountProductForm(forms.ModelForm): | |
product_name = forms.CharField(max_length=255) | |
sku = forms.CharField(max_length=255) | |
region = forms.ModelChoiceField(Region.objects.all()) | |
account_name = forms.CharField(max_length=64) | |
code = forms.IntegerField() | |
def __init__(self,*args,**kwargs): | |
initial = kwargs.pop('initial',{}) | |
instance = kwargs.get('instance',None) | |
product = getattr(instance,'product',Product()) |
This file contains hidden or 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
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta charset="UTF-8"> | |
<title>WaterColored Portfolio | A free CSS Template | made in PV.M Garage</title> | |
<meta name="description" content="Watercolored is a free css template released under Creative Common License by PV.M Garage"> | |
<meta name="keywords" content="watercolored, web, design, xhtml, css, photoshop"> | |
<meta name="author" content="Piervincenzo Madeo"> | |
<meta name="keywords" content="watercolored, web, design, xhtml, css, photoshop"> | |
<meta name="author" content="Piervincenzo Madeo"> | |
<link href="http://www.pvmgarage.com/downloads/watercolored_portfolio/style.css" rel="stylesheet" type="text/css"> | |
<style type="text/css"></style> |
NewerOlder