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
{% load url from future %} | |
{% load bootstrap_tags %} | |
<div class="subscribe-form"> | |
<h2>Purchase a Subscription</h2> | |
<p class="lead">Provide your payment details to start your subscription today.</p> | |
{% if error %} | |
<div class="alert alert-error">{{ error }}</div> | |
{% endif %} | |
<form action="{% url 'payments:payments_ajax_subscribe' %}" class="form ajax" data-stripe-key="{{ STRIPE_PUBLIC_KEY }}" data-replace-closest=".subscribe-form" method="POST"> |
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
#Task | |
class ApiCall(BaseTask): | |
def run(self, mode, **kwargs): | |
try: | |
modeDict = {'<mode>': "<url>"} | |
try: | |
url = modeDict[mode] |
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
#Error Email | |
Task app.management.tasks.api_calls.ApiCall with id b670e373-1274-472e-8771-ba2d5d0aa1d0 raised exception: | |
'SoftTimeLimitExceeded()' | |
Task was called with args: [] kwargs: {'mode': '<mode>', 'api_context': <app.management.tasks.api_calls.ApiContext object at 0x2bba190>}. | |
The contents of the full traceback was: | |
Traceback (most recent call last): |
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
(Pdb) match.entities | |
<smoke.model.collection.entities.Collection object at 0x7fc502b6dc58> | |
(Pdb) dir(match.entities) | |
['__class__', '__contains__', '__delattr__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__len__', '__new__', '__pyx_vtable__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'by_cls', 'by_ehandle', 'by_index', 'delete', 'get', 'put'] | |
(Pdb) for a, b in match.entities.by_ehandle.iteritems(): print a, b, b.cls, b.index, b.serial, b.pvs, b.state | |
2018920 <smoke.model.entity.Entity object at 0x390db48> 8 1640 985 1 <smoke.model.entity.State object at 0x390f1c0> | |
2057833 <smoke.model.entity.Entity object at 0x390dbd8> 8 1641 1004 1 <smoke.model.entity.State object at 0x390f1e8> | |
1287786 <smoke.model.entity.Entity object at 0x390dc68> 8 1642 628 1 <smoke.model.entity.State object at 0x390f210> |
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
#script.py | |
from heroes.mommy_recipes import make_hero | |
make_hero(steam_id=1) | |
# mommy_recipes.py | |
from model_mommy.recipe import Recipe, seq, foreign_key | |
from model_mommy import mommy |
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
setwd("~/Downloads") | |
df.lily = read.csv('lily.csv') | |
summary(df.lily) | |
str(df.lily) | |
colnames(df.lily) | |
df.lily$cat = '' | |
df.lily[df.lily$Falling.Asleep.Time==0,]$cat='Put To Sleep' | |
df.lily[df.lily$Falling.Asleep.Time!=0,]$cat='Self To Sleep' |
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
ben@Watt:~$ python | |
Python 2.7.5+ (default, Feb 27 2014, 19:37:08) | |
[GCC 4.8.1] on linux2 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> with open('foobar.txt', 'r') as f: | |
... data = f.read() | |
... | |
>>> data | |
'\n\n# I can totally write C, and just have elected not to here! (Not really.)\n' | |
>>> with open('foobar.txt', 'w') as f: |
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
### Keybase proof | |
I hereby claim: | |
* I am bwarren2 on github. | |
* I am tenukiben (https://keybase.io/tenukiben) on keybase. | |
* I have a public key whose fingerprint is 3886 1DBA 8A9A BA47 AF0D D3EA 2CD8 D7E5 84DF 385E | |
To claim this, I am signing this object: |
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
Synchronizing apps without migrations: | |
Creating tables... | |
Running deferred SQL... | |
Installing custom SQL... | |
Running migrations: | |
No migrations to apply. | |
Traceback (most recent call last): | |
File "proj/manage.py", line 10, in <module> | |
execute_from_command_line(sys.argv) | |
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line |
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 proj/manage.py migrate --fake-initial | |
/app/.heroku/python/lib/python2.7/site-packages/kombu/utils/__init__.py:407: UserWarning: Module argparse was already imported from /app/.heroku/python/lib/python2.7/argparse.pyc, but /app/.heroku/python/lib/python2.7/site-packages is being added to sys.path | |
from pkg_resources import iter_entry_points | |
Operations to perform: | |
Synchronize unmigrated apps: messages, mptt, rest_framework, tagging, health, bootstrapform, storages, corsheaders, staticfiles, pipeline, django_forms_bootstrap, utils, payments | |
Apply all migrations: <my apps>, sessions, sites, admin, auth, teams, contenttypes | |
Synchronizing apps without migrations: | |
Creating tables... | |
Running deferred SQL... | |
Installing custom SQL... |
OlderNewer