Skip to content

Instantly share code, notes, and snippets.

View danie1k's full-sized avatar
Automate! Automate everything!...

Daniel Kuruc danie1k

Automate! Automate everything!...
View GitHub Profile
ponsfrilus /
Last active May 7, 2024 06:51
Bash script to retreive a MyAnimeList (MAL) API access Token
#!/usr/bin/env bash
# Simplify the TOKEN generation for the My Anime List API (MAL API).
# Link to this file:
# Usage:
# export MAL_CLIENT_ID='phiequ3nah4phohqu7aephae5va8eePu' MAL_CLIENT_SECRET='oof1EilohLaimeigi5eithei0Johlai4hud2EiTee8Ien3iRieTouSeiv1phaiti';
# ./ [--refresh]
# Note: these are pwgen generated, they won't work.
innat / FFmpeg | Basic Operation on
Last active February 21, 2024 02:32
Remove hard subtitles from video file || Integrate subtitles into a video file || Generate .srt file from a video file.

Download FFmpeg for Windows


  • Download FFmpeg
  • Extract it and save it to C drive ( choose any location - it's optional )
  • Set environment variable - copy the location of bin folder which is inside the extracted file and set the location on system path variable.
  • Done!
deviantony /
Last active February 20, 2024 15:22
Portainer HTTP API by example


This gist is now deprecated in favor of our official documentation: which contains up to date examples!


Please refer to the link above to get access to our updated API documentation and examples.

ankurk91 /
Last active June 7, 2024 14:31
Signing git commits using GPG (Ubuntu/Mac)

Github : Signing commits using GPG (Ubuntu/Mac) 🔐

  • Do you have an Github account ? If not create one.
  • Install required tools
  • Latest Git Client
  • gpg tools
# Ubuntu
sudo apt-get install gpa seahorse
# MacOS with
subfuzion /
Last active June 12, 2024 15:57
Global gitignore

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file:

  • Create a file called .gitignore in your home directory and add any filepath patterns you want to ignore.
  • Tell git where your global gitignore file is.

Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute .config/git/ignore for .gitignore in your home directory, if you prefer.

methane /
Last active April 20, 2024 00:03
Benchmarking MySQL drivers (Python 3.4)
from __future__ import print_function
import time
def query_10k(cur):
t = time.time()
for _ in range(10000):
cur.execute("SELECT 1,2,3,4,5")
res = cur.fetchall()
assert len(res) == 1
assert res[0] == (1,2,3,4,5)
outadoc / pushover
Last active August 17, 2023 16:10
Pushover Bash Script
if [ $# -eq 0 ]; then
echo "Usage: ./pushover <message> [title]"
pkuczynski /
Last active June 15, 2024 20:30
Read YAML file from Bash script
parse_yaml() {
local prefix=$2
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;
for (i in vname) {if (i > indent) {delete vname[i]}}
tlberglund / git-loglive
Last active January 12, 2024 03:40
Log Live Git Command
while :
git --no-pager log --graph --pretty=oneline --abbrev-commit --decorate --all $*
sleep 1