Skip to content

Instantly share code, notes, and snippets.


Dominique Bischof dbischof

View GitHub Profile
dbischof / postman-oauth2-refresh-token.js
Last active Nov 14, 2018 — forked from harryi3t/postman-oauth2-refresh-token.js
This gist shows how using the pre-request script in Postman, a new Oauth-2 token can be obtained using the a refresh token
View postman-oauth2-refresh-token.js
** Inspired by:
** Modified from:
** Postman as of Nov 2018 does not support auto-refreshing of Oauth-2 tokens.
** This is an exmaple on how in one can refresh their Oauth-2 tokens just using the pre-request scripts.
** Pre-requisites: You need to have a refresh token. You can use the Postman app to get one.
** Step 1: Create a Postman environment and set the following variables:
** tokenUrl
dbischof /
Created Aug 29, 2017
Projects/forecasts upcoming Stripe subscription payments (grouped by payment day)
import collections, stripe
from datetime import datetime
stripe.api_key = ''
print "Stripe subscription forecast"
last_obj = None
paydays = {}
loop = 0
dbischof / qbo-bulk-class-bookmarklet.js
Last active Jun 11, 2017
Set QBO class fields in bulk
View qbo-bulk-class-bookmarklet.js
javascript: (function () {
var jsCode = document.createElement('script');
jsCode.setAttribute('src', '');
dbischof / tradegecko-new-purchase-order-date.user.js
Last active Mar 25, 2017
Userscript to set stock due date on new TradeGecko purchase orders to current date
View tradegecko-new-purchase-order-date.user.js
// ==UserScript==
// @name TG PO Stock Due Changer
// @description Set stock due date on new TradeGecko purchase orders to current date
// @match*
// @version 0.2
// ==/UserScript==
var targetPage = '/purchase_orders/new';
var currentPage = window.location.pathname;
if (currentPage == targetPage) {
dbischof /
Created Nov 9, 2015
Script to fix Picasa iOS9 date import bug
echo Finding all pictures in the wrong folder
for FOLDER in $(find . -type d -mtime -2 -name "*-*"); do

Keybase proof

I hereby claim:

  • I am dbischof on github.
  • I am dominique ( on keybase.
  • I have a public key whose fingerprint is 9D9E 5F44 B556 808D 4D1D 5A26 58F1 B3D2 5581 C0AC

To claim this, I am signing this object:

dbischof / gist:8060934
Created Dec 20, 2013
Running custom Mezzanine code through Fabric (for more complex/production code use a Django management command).
View gist:8060934
# Two Fabric related items that tripped me up:
# 1. For most complex code, you have to prepend your code string with code=, as in fab python:code="[Your code]".
# Not doing this will result in the following error:
# TypeError: python() got an unexpected keyword argument '[the first few chars of your code...]'
# 2. If you have an = in your code, it must be escaped. Not escaping them will result in the following error:
# ValueError: too many values to unpack
# Here's a short sample:
dbischof / gist:8060782
Created Dec 20, 2013
Send django email from the command line
View gist:8060782
### %> python shell
import settings
from django.core.mail import send_mail
send_mail('This is the subject', 'Here is the message.', settings.EMAIL_HOST_USER, [''], fail_silently=False)
# or
import settings
You can’t perform that action at this time.