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 / Main.java
Created Mar 22, 2020
pad-block-deadlock.
View Main.java
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import org.freedesktop.gstreamer.Element;
import org.freedesktop.gstreamer.Gst;
import org.freedesktop.gstreamer.Pad;
import org.freedesktop.gstreamer.Pipeline;
import org.slf4j.Logger;
View hls-transcode.sh
ffmpeg -v warning -nostats -nostdin -y -analyzeduration 3000000 \
-i http://live.ber.c3voc.de:8000/sloop_native_hd.webm \
\
-c:v libx264 -preset:v veryfast -profile:v main -pix_fmt yuv420p -flags +cgop \
-r:v:0 25 -g:v:0 75 -crf:v:0 21 -maxrate:v:0 4M -bufsize:v:0 18M \
-threads:v 0 -aspect 16:9 \
\
-c:a aac -b:a 192k -ar 48000 -ac 1 \
\
-map 0:v:0 -map 0:a:0 \
@MaZderMind
MaZderMind / component-with-callback.ts
Created Feb 19, 2020
Angular Component with Callback
View component-with-callback.ts
export declare type QueryCallbackFunction = (results: string[]) => void;
declare type QueryFunction = (query: string, callback: QueryCallbackFunction) => void;
import {Component, Input} from '@angular/core';
@Component({
selector: 'app-example',
styleUrls: ['./example.component.scss'],
templateUrl: './example.component.html',
})
@MaZderMind
MaZderMind / ConnectionHandler.java
Last active Mar 27, 2020
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() {
}
You can’t perform that action at this time.