Skip to content

Instantly share code, notes, and snippets.

View data-henrik's full-sized avatar

Henrik Loeser data-henrik

View GitHub Profile
@data-henrik
data-henrik / mywordcloud.py
Last active October 5, 2018 18:13
Python script to generate wordcloud for given background image
# Masked wordcloud
# ================
# Using a mask you can generate wordclouds in arbitrary shapes.
import sys, getopt
from os import path
from PIL import Image
import numpy as np
import random
import matplotlib.pyplot as plt
@data-henrik
data-henrik / IBMCloud-AppID-OIDC-Flask.py
Created June 6, 2018 13:16
Use IBM Cloud App ID with OpenID Connect client in Python Flask app
# for full example visit https://github.com/IBM-Cloud/github-traffic-stats/blob/master/backend/ghstats.py
# as part of this tutorial: https://console.bluemix.net/docs/tutorials/serverless-github-traffic-analytics.html
# import all kinds of modules
# this one is needed for the OIDC client
from flask_pyoidc.flask_pyoidc import OIDCAuthentication
# initialize Flask, etc.
@data-henrik
data-henrik / README.md
Last active August 29, 2015 14:27
Auto-respond to Twitter tweets and archive messages in DB2

Flow to automatically respond to tweets in Twitter. If the tag "archive" is used, then the incoming tweet is stored in the DB2-based sqldb service. A simple Web service is provided to retrieve the archived tweets from DB2.

To work, the table "twitarchive" needs to be created.

create table twitarchive(
id int generated always as identity,
tstamp timestamp,
tweet varchar(200),
username varchar(100)
@data-henrik
data-henrik / README.md
Created October 14, 2014 08:28
Use sipgate.io service to log phone calls in Cloudant and send out SMS via Twilio