Skip to content

Instantly share code, notes, and snippets.

View PanosJee's full-sized avatar

Panos Papadopoulos PanosJee

View GitHub Profile
@philfreo
philfreo / stripe_rev.py
Last active December 17, 2015 03:28
Calculate how much active/current subscription revenue you have for all your Stripe customers, considering discounts, trials, etc.
from __future__ import division
import collections
from texttable import Texttable
by_status = collections.defaultdict(list)
per_page = 100
offset = 0
while True:
@PanosJee
PanosJee / default.js
Created November 27, 2012 15:46
WinJS bugsense initialization
// Create the app
var app = WinJS.Application;
// Initialize bugsense
var bugsense = new Bugsense( {
apiKey: 'YOUR_API_KEY',
context: app
} );
// If you want to display a popup (against MS guidelines) add the message option
@christian-oudard
christian-oudard / gfm.py
Created June 29, 2010 18:51
Github Flavored Markdown in Python
import re
from hashlib import md5
def gfm(text):
# Extract pre blocks.
extractions = {}
def pre_extraction_callback(matchobj):
digest = md5(matchobj.group(0)).hexdigest()
extractions[digest] = matchobj.group(0)
return "{gfm-extraction-%s}" % digest