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 / 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"
@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-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 / 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 / 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 / const.php
Created October 31, 2018 12:06
Simple PHP script to display images in screenshot location (for Share-X online mirror, for example)
<?php
define("IMAGE_DIR", "*.{jpg,png,jpeg,gif}");
define("ACCESS_TOKEN", "dustinkst");
define("MAX_PER_PAGE", 50);
?>
@zekroTJA
zekroTJA / mySqlAutoBackup.sh
Last active October 28, 2018 18:09
A simple bash script to automatically backup your MySql databases to git repositories.
#!/bin/bash
# © 2018 zekro Development
# contact[at]zekro.de | https://zekro.de
# MIT License
# Copyright (c) 2018 Ringo Hoffmann (zekro Development)
# Permission is hereby granted, free of charge, to any person obtaining a copy
@zekroTJA
zekroTJA / ftp2windowslocation.md
Last active October 28, 2018 09:59
How to connect a FTP share as windows location in explorer.








@zekroTJA
zekroTJA / snowflake.js
Created October 23, 2018 07:36
Simple twitter-like snowflake generator for Node.js
/*
STRONGLY INPIRED BY
snowflake package for Go by bwmarrin
https://github.com/bwmarrin/snowflake
MIT License
Copyright (c) 2018 Ringo Hoffmann (zekro Development)
Permission is hereby granted, free of charge, to any person obtaining a copy
@zekroTJA
zekroTJA / discordOAuth.js
Created October 19, 2018 11:59
A simple class to get a Discord users ID via online oauth authorization via express application
const request = require('request');
const querystring = require('querystring');
/**
*
*/
class DiscordOAuth {
/**
* Create new instance of DiscordOAuth.