Skip to content

Instantly share code, notes, and snippets.

Build failed

Michael Neu michaelneu

Build failed
View GitHub Profile
michaelneu /
Created May 5, 2015
A simple implementation of C#'s BackgroundWorker-class in Java for JavaFX.
import javafx.application.Platform;
* A simple replacement for the C# BackgroundWorker-class for JavaFX
* @author minedev
public abstract class BackgroundWorker {
private Thread thread;
private boolean workerStarted;
michaelneu / Debouncer.ts
Created Aug 11, 2016
Typescript implementation of a debouncer using rxjs Observable
View Debouncer.ts
import { Observable } from "rxjs/Observable";
import { Observer } from "rxjs/Observer";
import "rxjs/add/operator/debounceTime";
* Class representing a debouncer to delay incoming events.
export default class Debouncer<T> {
private observer: Observer<T>;
michaelneu /
Created Aug 22, 2016
Keybase GitHub Proof

Keybase proof

I hereby claim:

  • I am michaelneu on github.
  • I am michaelneu ( on keybase.
  • I have a public key ASCCx7GrQCMSwOCudZ16kqcvRs3YXa_DYbBMSgFfTTk35Ao

To claim this, I am signing this object:

michaelneu /
Created Jan 16, 2018
An example integration for OTH Regensburg's software development course (see
// step 1: create your mail
final Mail mail = new Mail();
// step 2: add your credentials
final User user = new User();
// step 3: set your template
final Template template = new Template();
michaelneu /
Last active Nov 9, 2018
Create a map for IP addresses

Use this file to geocode IPs from logfiles and draw them on a map.

How to use it

This script requires geocoder to be installed, so setup a virtualenv:

$ virtualenv --python=python3 venv
michaelneu /
Created Dec 28, 2018
Control the fan in ASUS laptops via ACPI
#!/usr/bin/env python2
import sys
import os
def call_acpi(command):
with open('/proc/acpi/call', 'w') as acpi_call:
# Response
def set_speed(pwm, speed):
speed = max(0, min(100, speed))
speed = 2.55 * speed
speed = int(speed)
with open("/sys/class/hwmon/hwmon1/pwm" + str(pwm), "w") as f:
michaelneu /
Last active Jan 3, 2019
Scrape all images from hide the pain harold
#!/usr/bin/env python3
import urllib.request
import os
import re
import sys
from concurrent.futures import ProcessPoolExecutor as PoolExecutor, as_completed
from PIL import Image
image_page_link_pattern = re.compile(r"src=\"https:\/\/thumbs\.dreamstime\.com\/t\/([^\"]+)")
michaelneu / drag-n-drop-hook.ts
Created Jan 5, 2019
TypeScript React hook for drag'n'drop on elements
View drag-n-drop-hook.ts
import { useState } from "react";
export const useDragAndDrop = <T extends HTMLElement>() => {
const [isDragging, setIsDragging] = useState(false);
const [innerOffsetX, setInnerOffsetX] = useState(0);
const [innerOffsetY, setInnerOffsetY] = useState(0);
const start = (event: React.MouseEvent<T, MouseEvent>) => {
const element = as T;
const { left, top } = element.getBoundingClientRect();
michaelneu / button.js
Last active Jan 9, 2019
Color context sensitive styled-components HoC
View button.js
import styled from "styled-components";
export const withButtonStyle = (component) => styled(component)`
position: relative;
display: block;
width: 100%;
padding: 0.5rem 2rem;
color: currentColor;