Skip to content

Instantly share code, notes, and snippets.

View zekroTJA's full-sized avatar
🚀
Fuck it, ship it!

Ringo Hoffmann zekroTJA

🚀
Fuck it, ship it!
View GitHub Profile
@zekroTJA
zekroTJA / ffmpeg_video_tutorial.md
Last active December 30, 2018 16:45
How to edit your videos with ffmpeg

Using ffmepg to 'cut' your videos

The advantage over using a "classical" cutting program

If you record your videos with OBS, you can record them in the format of mp4, which is actually container format, which includes video, audio (and other stuff like subtitles for example) in a container file. With ffmpeg, you are able to extract and work with those streams in the containers. That means, you can extract and edit streams directly from and inside the container without rendering the whole video file, which saves a huge ammount of time and resources.

Install ffmpeg

Go to ffmpeg.org and download the latest build for your system. If you are using linux, you can also install it by your package manager of course. If you decided to download the binaries, place them somewhere you want (on Windows C:/Program Files/ffmpeg/ for example) and define the location of the "bin" folder in the ffmpeg folder in your path variables.

@zekroTJA
zekroTJA / gitToDiscordWebhook.bash
Created January 18, 2019 16:05
update hook for git to push embed message to Discord webhook (with Gavatar Avatar support)
#!/bin/bash
# --- SETTINGS
webhookUrl="WEBHOOK_URL"
# ------------
refname=$1
oldrev=$2
newrev=$3
@zekroTJA
zekroTJA / go-os-arch.md
Created March 11, 2019 13:43 — forked from asukakenji/0-go-os-arch.md
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.8.3 darwin/amd64.

A list of valid GOOS values

(Bold = supported by go out of the box, ie. without the help of a C compiler, etc.)

  • android
  • darwin
@zekroTJA
zekroTJA / Makefile
Last active April 2, 2019 07:00
Makefile for Go Applications
# TEMPLATE MAKEFILE FOR GO APPLICATIONS
#
# This Makefile is capable of:
# - defautl go commands like build, run,
# test and golint
# - cross compiling (see make help)
# - automatic versioning using git tag
# and ldflags
#
# Covered by MIT License
@zekroTJA
zekroTJA / go-project-setup.sh
Created April 19, 2019 17:09
Setup script for go projects
#!/bin/bash
DIRS=(
"assets"
"build"
"cmd"
"config"
"docs"
"internal"
"pkg"
{"lastUpload":"2020-03-31T11:31:46.511Z","extensionVersion":"v3.4.3"}
@zekroTJA
zekroTJA / docker-compose.yml
Last active August 21, 2019 13:54
Docker compose and NGINX configuration for setting up GitLab with kerberos as AD authentication
version: '3'
services:
# We will use an enginx layer to simply encrypt the
# HTTP traffic with SSL using a self singed certificate.
nginx:
image: 'nginx:latest'
ports:
- '80:80'

Keybase proof

I hereby claim:

  • I am zekrotja on github.
  • I am zekrodev (https://keybase.io/zekrodev) on keybase.
  • I have a public key ASBW8pQDJzn4mLcExivvHMaaqm4rUpEn-lVXhNS6mmhJ-Ao

To claim this, I am signing this object:

@zekroTJA
zekroTJA / randomString.ts
Created November 7, 2019 14:22
random string generator in TypeScript
export function randomString(n: number, charset?: string): string {
let res = '';
let chars =
charset || 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
let charLen = chars.length;
for (var i = 0; i < n; i++) {
res += chars.charAt(Math.floor(Math.random() * charLen));
}
@zekroTJA
zekroTJA / ControlValueExampleComponent.ts
Created November 26, 2019 08:47
Angular Control Value Accessor Component Example
/** @format */
import { Component, forwardRef } from '@angular/core';
import { NG_VALUE_ACCESSOR, ControlValueAccessor } from '@angular/forms';
export const CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR: any = {
provide: NG_VALUE_ACCESSOR,
// tslint:disable-next-line: no-use-before-declare
useExisting: forwardRef(() => EntryInputComponent),
multi: true,