Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| <?php | |
| require 'path-to-Stripe.php'; | |
| if ($_POST) { | |
| Stripe::setApiKey("YOUR-API-KEY"); | |
| $error = ''; | |
| $success = ''; | |
| try { | |
| if (!isset($_POST['stripeToken'])) | |
| throw new Exception("The Stripe Token was not generated correctly"); |
| /* Gmail style scrollbar */ | |
| ::-webkit-scrollbar { | |
| width: 12px | |
| } | |
| ::-webkit-scrollbar-thumb { | |
| border-width: 1px 1px 1px 2px | |
| } | |
| ::-webkit-scrollbar-track { | |
| border-width: 0 | |
| } |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| #!/usr/bin/env python | |
| import simplejson | |
| import logging | |
| import random | |
| import re | |
| import datetime | |
| import string | |
| import time | |
| import sys | |
| import urllib |
| # | |
| # Slightly tighter CORS config for nginx | |
| # | |
| # A modification of https://gist.github.com/1064640/ to include a white-list of URLs | |
| # | |
| # Despite the W3C guidance suggesting that a list of origins can be passed as part of | |
| # Access-Control-Allow-Origin headers, several browsers (well, at least Firefox) | |
| # don't seem to play nicely with this. | |
| # |
| data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script> |