Skip to content

Instantly share code, notes, and snippets.

View gist:c63c54fd56fac50c6a91e1d70bed4a3d
* what it's like to not be technical in the industry
* what you do in tech that people forget is needed
* the most interesting thing you've worked on recently
* what your day-to-day is like
* must-have gifs for every techie
* horrible code from the past that shows I'm much better now
* the best music for hacking
* mistakes you've made that make you groan
* how you've made it at well-known companies
* self-care in the tech bubble
MichelleGlauser / gist:997f16f1e29cc004d8ff
Last active August 29, 2015 14:22
Zana Stripe Subscribe Form
View gist:997f16f1e29cc004d8ff
{% extends "djstripe/base.html" %}
{% load static djstripe_tags %}
{% block title %}Zana Edge Subscription{% endblock title %}
{% block content %}
<!-- Modal for server update -->
<div class="modal fade" id="in-progress">
<div class="modal-dialog">
<div class="modal-content">
View gist:c4a1962eaa11fcb541b2
class StripeCouponView(generic.View):
def get(self, request):
# coupon = stripe.Coupon.retrieve("ZANAFAMILY")
# print coupon
# log.debug(request.GET)
# # Saves the characters after "=" as coupon_code
# coupon_code = request.GET.get('coupon', '')
if "coupon" in request.GET:
coupon_code = request.GET['coupon']
View gist:fcdb53b6ccdad0c0bc48
def subscribe(self, plan, quantity=1, trial_days=None,
charge_immediately=True, prorate=djstripe_settings.PRORATION_POLICY, discount_code=None):
cu = self.stripe_customer
Trial_days corresponds to the value specified by the selected plan
for the key trial_period_days.
if ("trial_period_days" in djstripe_settings.PAYMENTS_PLANS[plan]):
MichelleGlauser / gist:8f40c75e5cd7a199ff55
Created June 5, 2015 19:46
Django StripeCouponView
View gist:8f40c75e5cd7a199ff55
# Stripe coupons!
class StripeCouponView(generic.View):
def get(self, request):
coupon_code = request.GET.get('coupon', '')
api_url = '' + coupon_code
r = requests.get(api_url, auth=(settings.STRIPE_SECRET_KEY, ''))
MichelleGlauser / gist:c0225076561f7e5d9946
Created May 9, 2014 00:12
Error after quitting local server
View gist:c0225076561f7e5d9946
^CTraceback (most recent call last):
File "/Users/michelleglauser/.virtualenvs/venv/bin/envdir", line 8, in <module>
load_entry_point('envdir==0.6.1', 'console_scripts', 'envdir')()
File "/Users/michelleglauser/.virtualenvs/venv/lib/python2.7/site-packages/envdir/", line 14, in run
go(, *args)
File "/Users/michelleglauser/.virtualenvs/venv/lib/python2.7/site-packages/envdir/", line 12, in go
caller(args[0], *args[1:])
File "/Users/michelleglauser/.virtualenvs/venv/lib/python2.7/site-packages/envdir/", line 123, in run
File "/Users/michelleglauser/.virtualenvs/venv/lib/python2.7/site-packages/envdir/", line 131, in terminate
View gist:fc4dacfa7ba615babbb3
if ENVIRONMENT == 'dev':
DEBUG = True
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'chishenma',
'HOST': 'localhost',
'PORT': '5432',
View gist:a974b41fce0fbfba0fb5
2014-05-06T01:31:19.612972+00:00 app[web.1]: 2014-05-06 01:31:19 [2] [INFO] Shutting down: Master
2014-05-06T01:31:19.607959+00:00 app[web.1]: 2014-05-06 01:31:19 [2] [INFO] Handling signal: term
2014-05-06T01:31:24.431329+00:00 app[web.1]: 2014-05-06 01:31:24 [2] [INFO] Starting gunicorn 18.0
2014-05-06T01:31:24.432145+00:00 app[web.1]: 2014-05-06 01:31:24 [2] [INFO] Listening at: (2)
2014-05-06T01:31:24.432246+00:00 app[web.1]: 2014-05-06 01:31:24 [2] [INFO] Using worker: sync
2014-05-06T01:31:24.438350+00:00 app[web.1]: 2014-05-06 01:31:24 [7] [INFO] Booting worker with pid: 7
2014-05-06T01:31:23.549291+00:00 heroku[web.1]: Starting process with command `gunicorn chishenma_project.wsgi`
2014-05-06T01:31:24.686011+00:00 heroku[web.1]: State changed from starting to up
2014-05-06T01:31:26.678788+00:00 heroku[router]: at=info method=GET path=/ request_id=42e0c5b7-4bfd-48f9-bd42-aff99dd42c9f fwd="" dyno=web.1 connect=2ms service=169ms status=500 by
View gist:23c97574b9e7af36dbc9
2014-05-06T00:14:54.508614+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ request_id=2a72e262-0620-40ce-953a-e84b0cb2ac59 fwd="" dyno= connect= service= status=503 bytes=
2014-05-06T00:14:55.934188+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico request_id=0d747351-85df-4774-a50a-eebf8e70c6de fwd="" dyno= connect= service= status=503 bytes=
2014-05-06T00:21:31.196635+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ request_id=dd3aea10-1782-4005-84a1-9f8473488843 fwd="" dyno= connect= service= status=503 bytes=
2014-05-06T00:21:32.473284+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico request_id=8d1d5d5d-a1f2-43c1-8165-00a9874e640e fwd="" dyno= connect= service= status=503 bytes=
MichelleGlauser / gist:6151714
Created August 4, 2013 20:02
BookFairy Django web app Procfile
View gist:6151714
web: python runserver 0:$PORT collectstatic --noinput; bin/gunicorn_django --workers=4 --bind=$PORT proj/