Skip to content

Instantly share code, notes, and snippets.

Peter MaZderMind

Block or report user

Report or block MaZderMind

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@MaZderMind
MaZderMind / ConnectionHandler.java
Last active Apr 21, 2019
Example of a Nonblokcing Socket-Server with java.nio which reads Input Line-by-Line.
View ConnectionHandler.java
package de.mazdermind;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.channels.ClosedChannelException;
import java.nio.channels.SocketChannel;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
@MaZderMind
MaZderMind / java-nio-nonblocking-socket.java
Created Apr 21, 2019
Example of a Nonblokcing Socket-Server with java.nio
View java-nio-nonblocking-socket.java
package de.mazdermind;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
import java.util.Iterator;
View cpp_scope_guards.cpp
#include <iostream>
// https://github.com/ricab/scope_guard
#include "scope_guard.hpp"
int main (int argc, char** argv)
{
std::cout << "enter main" << std::endl;
std::cout << "open something" << std::endl;
View RTP-PTP-Testquelle.py
#!/usr/bin/env python3
import logging
import sys
import gi
gi.require_version('Gst', '1.0')
gi.require_version('GstNet', '1.0')
from gi.repository import Gst, GstNet, GObject
View ptp.py
import sys
import gi
gi.require_version('Gst', '1.0')
gi.require_version('GstNet', '1.0')
from gi.repository import Gst, GstNet
ptp_domain = 0
ptp_interfaces = ['enp0s25']
@MaZderMind
MaZderMind / carlmix.py
Created Nov 28, 2018
quick and dirty gstreamer videomixer, switching between 1 of 20 sources
View carlmix.py
#!/usr/bin/env python3
import logging
import random
import signal
import sys
import gi
gi.require_version('Gst', '1.0')
gi.require_version('GstNet', '1.0')
@MaZderMind
MaZderMind / AnnotationUtil.java
Last active Jul 23, 2018
A Variant of the AuthenticationPrincipalArgumentResolver which injects an AuthenticationPrincipal merged into the correct EntityManager
View AnnotationUtil.java
package net.seibertmedia.team-rocket.someproject.configuration.mergedAuthenticationPrincipal;
import java.lang.annotation.Annotation;
import org.springframework.core.MethodParameter;
import org.springframework.core.annotation.AnnotationUtils;
public class AnnotationUtil {
private AnnotationUtil() {
}
View backup-github-locally.sh
#!/bin/bash
set -xe
source /bulk/data/Drittsysteme/_env.sh
DIR="$BASEDIR/github"
NAMES_TMP=/tmp/github-repo-names.tmp
NAMES=/tmp/github-repo-names
PAGE=1
rm -f $NAMES
while true;
View jia-ticket-status-inline.css
.ghx-issue-content {
position: relative;
}
.ghx-plan-extra-fields.ghx-row {
height: 0;
margin: 0
}
.ghx-plan-extra-fields .ghx-extra-field {
position: absolute;
top: 6px;
View 18-videos-hd.sh
#!/bin/sh
gst-launch-1.0 \
videotestsrc pattern=ball foreground-color=0x00ff0000 ! video/x-raw,width=1920,height=1080,framerate=30/1,format=UYVY ! queue ! comp1. \
videotestsrc pattern=ball foreground-color=0x00ffff00 ! video/x-raw,width=1920,height=1080,framerate=30/1,format=UYVY ! queue ! comp1. \
videotestsrc pattern=ball foreground-color=0x0000ff00 ! video/x-raw,width=1920,height=1080,framerate=30/1,format=UYVY ! queue ! comp1. \
\
videotestsrc pattern=ball foreground-color=0x0000ffff ! video/x-raw,width=1920,height=1080,framerate=30/1,format=UYVY ! queue ! comp1. \
videotestsrc pattern=ball foreground-color=0x000000ff ! video/x-raw,width=1920,height=1080,framerate=30/1,format=UYVY ! queue ! comp1. \
videotestsrc pattern=ball foreground-color=0x00ff00ff ! video/x-raw,width=1920,height=1080,framerate=30/1,format=UYVY ! queue ! comp1. \
\
You can’t perform that action at this time.