Skip to content

Instantly share code, notes, and snippets.

@debrouwere
debrouwere / passport.html
Created June 13, 2014 14:58
Express 4 + PassportJS
<form action="/login" method="post">
<div>
<label>Username:</label>
<input type="text" name="username" />
</div>
<div>
<label>Password:</label>
<input type="password" name="password" />
</div>
<div>
@debrouwere
debrouwere / auth.py
Created August 16, 2014 08:56
Access Google Analytics data with rauth in Python
import os
import json
from flask import Flask, request, redirect, jsonify
from rauth import OAuth2Service
GOOGLE_AUTH_URI = 'https://accounts.google.com/o/oauth2/auth'
GOOGLE_REVOKE_URI = 'https://accounts.google.com/o/oauth2/revoke'
GOOGLE_TOKEN_URI = 'https://accounts.google.com/o/oauth2/token'
GOOGLE_ANALYTICS_API_ENDPOINT = 'https://www.googleapis.com/analytics/v3/'
@debrouwere
debrouwere / competitors.py
Created January 30, 2015 14:28
social media competitive analysis
import os
import tortilla
import tweepy
import facepy
from apiclient import discovery
import pandas as pd
twitter_credentials = tweepy.AppAuthHandler(
os.environ['TWITTER_CONSUMER_KEY'],
os.environ['TWITTER_CONSUMER_SECRET'],
@debrouwere
debrouwere / service.service
Created February 5, 2015 19:25
Etcd snapshot
ExecStartPre=etcdctl ls /mydir \
| cut -d / -f 3 \
| xargs -I {} echo 'echo {}=$(etcdctl get /mydir/{})' \
| bash > mydir.env
EnvironmentFile=/home/core/mydir.env
@debrouwere
debrouwere / keybase.md
Created August 31, 2016 20:02
keybase proof

Keybase proof

I hereby claim:

  • I am debrouwere on github.
  • I am debrouwere (https://keybase.io/debrouwere) on keybase.
  • I have a public key ASBkoTHjCxZfLes7DxvFDjr3qZIch9-cX1f3MWI0Ayp5fQo

To claim this, I am signing this object:

import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from scipy.optimize import fmin
from scipy.stats import *
from scipy.stats.distributions import beta, binom
from snakify import snakify