Skip to content

Instantly share code, notes, and snippets.

Avatar

MaZderMind MaZderMind

View GitHub Profile
@MaZderMind
MaZderMind / Inzidenz + Impfprogress.js
Created May 21, 2021
Inzidenz + Impfprogress Deutschland – Widget für iOS Scriptable
View Inzidenz + Impfprogress.js
// Licence: Robert Koch-Institut (RKI), dl-de/by-2-0
// Thanks to @rphl (https://github.com/rphl) and @tzschies (https://github.com/tzschies) for their inspiring work on this widget. See https://gist.github.com/rphl/0491c5f9cb345bf831248732374c4ef5 and https://gist.github.com/tzschies/563fab70b37609bc8f2f630d566bcbc9.
function round(n, d) {
const m = Math.pow(10, d);
return Math.round((n + Number.EPSILON) * m) / m;
}
function buildQuery(params) {
@MaZderMind
MaZderMind / datetime_custom_rollover.py
Created Apr 23, 2021
datetime_custom_rollover.py
View datetime_custom_rollover.py
from datetime import datetime, time, date, timedelta
def rollover(dt: datetime, rollover: time) -> date:
given_time = dt.time()
if given_time < rollover:
return dt.date()
else:
return dt.date() + timedelta(days=1)
def test_rollover():
View gist:717858600978c09b651123b1b0989561
<!doctype html>
<html lang="en">
<head>
<style type="text/css">
.box {
background: linear-gradient(180deg, #2a4b65 0%, #0a748a 100%);
width: 1020px;
margin: 0 auto;
position: absolute;
@MaZderMind
MaZderMind / input.scss
Created Oct 6, 2020
Generated by SassMeister.com.
View input.scss
.header-1 {
&:hover {
& .team-project-icon {
transform: scale(1.2);
}
}
}
.header-2 {
&:hover {
@MaZderMind
MaZderMind / meet.css
Last active Nov 16, 2020
User-CSS for clean Google Meets
View meet.css
/* Top Right Menu */
.NzPR9b { display: none }
/* On-Hover-Footer */
.rG0ybd { display: none }
/* Recording-Marker */
.pHsCke { display: none }
/* Speakers Marker */
@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;