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 / README.md
Last active November 27, 2018 09:54
Pull data from a [Db2 or SQLAlchemy] database and inject into IBM Watson Discovery collection

From database into Watson Discovery

The code shown is a simple Python example of pulling data from a SQL database supported by SQLAlchemy, and then injecting the data as new JSON document into a collection of Watson Discovery Service on IBM Cloud.

@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 / 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