Skip to content

Instantly share code, notes, and snippets.

Avatar
🤔
fuck it, ship it

Ringo Hoffmann zekroTJA

🤔
fuck it, ship it
View GitHub Profile
View corretto-setup.sh
#!/bin/bash
set -x
set -e
apt install -y software-properties-common
wget -O- https://apt.corretto.aws/corretto.key | sudo apt-key add -
sudo add-apt-repository 'deb https://apt.corretto.aws stable main'
apt update -y
apt install -y java-16-amazon-corretto-jdk
@zekroTJA
zekroTJA / dgrs-oldest-user.py
Last active Aug 4, 2021
Get the oldest user account from a dgrs cache.
View dgrs-oldest-user.py
import redis
import argparse
import json
import datetime
def inject_creation_date(u):
uid = int(u.get('id'))
ts = (uid >> 22) + 1420070400000
u['created_date'] = datetime.datetime.fromtimestamp(
@zekroTJA
zekroTJA / my-most-useful-go-packages.md
Last active May 9, 2021
A list of (in my opinion) the most useful go packages I use for my own projects.
View my-most-useful-go-packages.md
@zekroTJA
zekroTJA / youtubedl-download-all.bash
Created Mar 12, 2021
Small bash script to download a whole YouTube playlist via youtube-dl and convert it to a desired format using ffmpeg.
View youtubedl-download-all.bash
FORMAT="ogg"
[ -z $2 ] || FORMAT=$2
youtube-dl -citx $1
mkdir out
for F in *; do
case "$F" in
(*.bash | *.sh) continue;;
@zekroTJA
zekroTJA / mc-modpack-semver.md
Last active Jul 9, 2020
Semantic Versioning of Minecraft Modpacks
View mc-modpack-semver.md

Semantic Versioning of Minecraft Modpacks

v.1.0.0-rc.2
2020-07-09

Summary

The version number goes after follwoing format.

Simple:    MAJOR.MINOR.PATCH
@zekroTJA
zekroTJA / gitwalker.bash
Created Jun 23, 2020
Script to walk through a git repository commit by commit and count the lines of code.
View gitwalker.bash
#!/bin/bash
REPO_URL=$1
BRANCH=$2
TMP_DIR="./.tmp"
CLOC_EXCLUDED_DIRS="node_modules,vendor"
CLOC_EXCLUDED_LANGS="JSON,Markdown,YAML,SVG,SQL,Dockerfile,make"
OUT_FILE="./results.csv"
View go-chart-debug.Dockerfile
FROM golang:1.13-alpine
WORKDIR /test
RUN apk add curl git
RUN go get -u github.com/wcharczuk/go-chart
RUN curl -Lo test.go https://raw.githubusercontent.com/wcharczuk/go-chart/master/examples/bar_chart/main.go
RUN touch output.png
ENTRYPOINT ["go", "run", "test.go"]
@zekroTJA
zekroTJA / ControlValueExampleComponent.ts
Created Nov 26, 2019
Angular Control Value Accessor Component Example
View ControlValueExampleComponent.ts
/** @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,
@zekroTJA
zekroTJA / randomString.ts
Created Nov 7, 2019
random string generator in TypeScript
View randomString.ts
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));
}
View keybase.md

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: