Skip to content

Instantly share code, notes, and snippets.

Avatar
Build failed

Michael Neu michaelneu

Build failed
View GitHub Profile
@michaelneu
michaelneu / xtend11.sh
Created Jun 27, 2014
Use Raspberry Pi as external network-monitor
View xtend11.sh
#!/bin/bash
PI_IP="xxx.xxx.xxx.xxx"
LEFT_OF="VGA1" #"LVDS1"
CLIENT_SCRIPT_NAME="x11-client.sh"
LOCKFILE="/tmp/x11-extended-display-lock.pid"
screen_res='python -c "import Tkinter; r = Tkinter.Tk(); print r.winfo_screenwidth(), r.winfo_screenheight(); r.destroy();"'
d=`ssh pi@$PI_IP "export DISPLAY=:0 && $screen_res"`
case $1 in
@michaelneu
michaelneu / BackgroundWorker.java
Created May 5, 2015
A simple implementation of C#'s BackgroundWorker-class in Java for JavaFX.
View BackgroundWorker.java
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
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
michaelneu / keybase.md
Created Aug 22, 2016
Keybase GitHub Proof
View keybase.md

Keybase proof

I hereby claim:

  • I am michaelneu on github.
  • I am michaelneu (https://keybase.io/michaelneu) on keybase.
  • I have a public key ASCCx7GrQCMSwOCudZ16kqcvRs3YXa_DYbBMSgFfTTk35Ao

To claim this, I am signing this object:

@michaelneu
michaelneu / customized-winston-logger.js
Created Sep 3, 2016
Customized Winston logger with chalk-colored output
View customized-winston-logger.js
var winston = require("winston"),
dateformat = require("dateformat"),
chalk = require("chalk");
module.exports = new (winston.Logger)({
transports: [
new (winston.transports.Console)({
timestamp: function () {
return dateformat(Date.now(), "yyyy-mm-dd HH:MM:ss.l");
},
@michaelneu
michaelneu / Dockerfile
Last active Mar 27, 2021
docker-compose configuration for PHP with NGINX and MySQL, including sendmail, MailDev and phpmyadmin
View Dockerfile
# see https://github.com/cmaessen/docker-php-sendmail for more information
FROM php:5-fpm
RUN apt-get update && apt-get install -q -y ssmtp mailutils && rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install mysql mysqli sysvsem
RUN pecl install xdebug-2.5.5 \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
@michaelneu
michaelneu / Makefile
Last active Mar 23, 2019
Docker configuration to run wildfly, mysql, maven and phpmyadmin in containers
View Makefile
all: war deploy
deploy:
cp project/target/*.war deployments/
clean:
rm deployments/*.war
docker run --rm -v `pwd`/project:/app -v m2:/root/.m2 -w /app maven:alpine mvn clean
war:
@michaelneu
michaelneu / README.md
Last active Mar 22, 2021
A basic, but fast git prompt.
View README.md

bash-basic-git-prompt

This is a considerably faster, but much more basic alternative to bash-git-prompt.

When adding this script to your .bash_profile or .bashrc, it'll display the selected branch of the current folder (if it's a git repo), and whether it's modified (yellow) or contains staged files (cyan).

example

The script makes the assumption, that a .git folder only exists when the directory is a git repo. Also, it checks for the english version of the git status command, so if you're using git in a different locale, make sure to adjust this.

@michaelneu
michaelneu / howto.java
Created Jan 16, 2018
An example integration for OTH Regensburg's software development course (see https://github.com/michaelneu/gorillamail)
View howto.java
// step 1: create your mail
final Mail mail = new Mail();
// step 2: add your credentials
final User user = new User();
user.setEmail("barb@gorillamail.space");
user.setPassword("p4ssword!");
// step 3: set your template
final Template template = new Template();
@michaelneu
michaelneu / Jenkinsfile
Created Aug 10, 2018
docker-compose configuration and Jenkinsfile to run builds in Docker containers
View Jenkinsfile
stage('Build') {
node (label: 'linux') {
checkout scm
docker.image('node:alpine').inside {
sh 'yarn install'
sh 'yarn build'
}
}
}