Skip to content

Instantly share code, notes, and snippets.

Avatar

Jan Heinrich Reimer heinrichreimer

View GitHub Profile
@heinrichreimer
heinrichreimer / EsSparkExtensions.kt
Created Apr 1, 2020
Elasticsearch Spark extension functions for Kotlin.
View EsSparkExtensions.kt
package de.webis.webisstud.thesis.reimer.clueweb.graph
import org.apache.spark.SparkConf
import org.apache.spark.api.java.JavaPairRDD
import org.apache.spark.api.java.JavaRDD
import org.apache.spark.api.java.JavaSparkContext
import org.elasticsearch.hadoop.cfg.ConfigurationOptions.*
import org.elasticsearch.spark.rdd.api.java.JavaEsSpark
fun JavaSparkContext.esRDD(): JavaPairRDD<String, Map<String, Any>> =
View keybase.md

Keybase proof

I hereby claim:

  • I am heinrichreimer on github.
  • I am heinrichreimer (https://keybase.io/heinrichreimer) on keybase.
  • I have a public key ASBY23krwrFBLQ-MswPfhYQ1Gv8KMy9-fNP0dzT4wuj1cgo

To claim this, I am signing this object:

@heinrichreimer
heinrichreimer / AddOnlyCollections.kt
Created Jan 20, 2020
Add-only Kotlin collections.
View AddOnlyCollections.kt
package de.webis.webisstud.thesis.reimer
/**
* A generic collection of elements that supports adding elements.
*
* @param E the type of elements contained in the collection.
* The mutable collection is invariant on its element type.
*/
interface AddOnlyCollection<E> : Collection<E> {
@heinrichreimer
heinrichreimer / CLA.md
Last active Jan 2, 2020
Contributor License Agreement (Reimer Software)
View CLA.md

Fiduciary License Agreement 2.0

(Based on the Individual Contributor exclusive License Agreement, including the Traditional Patent License option)

Thank you for your interest in contributing to Reimer Software's GitHub open source projects ("We" or "Us").

The purpose of this contributor agreement ("Agreement") is to clarify and document the rights granted by contributors to Us. To make this document effective, please follow the instructions at https://cla-assistant.io/reimersoftware/.

Preamble

Software is deeply embedded in all aspects of our lives and it is important that it empower, rather than restrict us. Free Software gives everybody the rights to use, understand, adapt and share software. These rights help support other fundamental freedoms like freedom of speech, press and privacy.

@heinrichreimer
heinrichreimer / inline-list.scss
Created Nov 15, 2019
Formatting HTML lists inline.
View inline-list.scss
ul {
display: inline;
list-style: none;
padding: 0;
> li {
display: inline;
&:before {
display: inline;
@heinrichreimer
heinrichreimer / download-all-exercises.py
Created Jun 11, 2019
Script to download a student's exercise solutions and task information from Martin Luther University Halle's Institute for Computer Science's exercise portal.
View download-all-exercises.py
import json
import os
import re
import shutil
import tempfile
import typing
import zipfile
import pyquery
import requests
@heinrichreimer
heinrichreimer / LiveEventBus.kt
Last active Aug 20, 2018
Simple event bus based on Android Architecture Component's LiveData. The code is initially based on Alfonz' LiveBus (https://github.com/petrnohejl/Alfonz/blob/dev/alfonz-arch/src/main/java/org/alfonz/arch/event/LiveBus.java) and was optimized for usage in Kotlin. This class needs Google's SingleLiveEvent (https://github.com/googlesamples/android…
View LiveEventBus.kt
import android.arch.lifecycle.LifecycleOwner
import android.arch.lifecycle.Observer
import android.support.annotation.MainThread
import android.support.v4.util.ArrayMap
class LiveEventBus {
private val events: MutableMap<Class<out Any>, SingleLiveEvent<out Any>> =
ArrayMap<Class<out Any>, SingleLiveEvent<out Any>>()
@MainThread
@heinrichreimer
heinrichreimer / gist:0c84119ab9de42fd371918f2e9fb024d
Created Apr 6, 2018
Delete unused, pre-installed Windows Apps
View gist:0c84119ab9de42fd371918f2e9fb024d
Get-AppxPackage -allusers *Microsoft.BingWeather* | Remove-AppxPackage
Get-AppxPackage -allusers *Microsoft.WindowsMaps* | Remove-AppxPackage
Get-AppxPackage -allusers *Microsoft.Messaging* | Remove-AppxPackage
Get-AppxPackage -allusers *Microsoft.ZuneVideo* | Remove-AppxPackage
Get-AppxPackage -allusers *Microsoft.OneConnect* | Remove-AppxPackage
Get-AppxPackage -allusers *Microsoft.ZuneMusic* | Remove-AppxPackage
Get-AppxPackage -allusers *Microsoft.GetHelp* | Remove-AppxPackage
Get-AppxPackage -allusers *Microsoft.People* | Remove-AppxPackage
Get-AppxPackage -allusers *Microsoft.WindowsCommunicationsApps* | Remove-AppxPackage
Get-AppxPackage -allusers *Microsoft.WindowsFeedbackHub* | Remove-AppxPackage
@heinrichreimer
heinrichreimer / Wysker_Launchfilm_1_1_4_Metadata.xml
Created Feb 14, 2018
Metadata embedded into the Wysker_Launchfilm_1_1_4.mp4 file of the Wysker treasure hunt: https://www.youtube.com/watch?v=Ajhyirdd9CE
View Wysker_Launchfilm_1_1_4_Metadata.xml
<?xml version="1.0"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c143 79.161210, 2017/08/11-10:28:36 ">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:xmpDM="http://ns.adobe.com/xmp/1.0/DynamicMedia/" xmlns:stDim="http://ns.adobe.com/xap/1.0/sType/Dimensions#" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#" xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xmpTPg="http://ns.adobe.com/xap/1.0/t/pg/" xmlns:illustrator="http://ns.adobe.com/illustrator/1.0/" xmlns:xmpGImg="http://ns.adobe.com/xap/1.0/g/img/" xmlns:xmpG="http://ns.adobe.com/xap/1.0/g/" xmlns:creatorAtom="http://ns.adobe.com/creatorAtom/1.0/" xmlns:bext="http://ns.adobe.com/bwf/bext/1.0/" xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/" xmlns:tiff="http://ns.adobe.com/t
@heinrichreimer
heinrichreimer / refresh-portfolio.sh
Created Feb 4, 2018
Script that runs on my web server and fetches, builds and deploys my personal portfolio. Portfolio sources can be found here: https://github.com/heinrichreimer/heinrichreimer.github.io
View refresh-portfolio.sh
#!/usr/bin/env bash
set -e # Halt script on error.
# GitHub repo to fetch the portfolio from.
PORTFOLIO_REPO_USERNAME=heinrichreimer
PORTFOLIO_REPO_NAME=heinrichreimer.github.io
# Path to deploy the portfolio to.
PORTFOLIO_DEPLOY_PATH=~/www/heinrichreimer.com