Skip to content

Instantly share code, notes, and snippets.

View tobiaswx's full-sized avatar
💭
I may be slow to respond.

Tobias tobiaswx

💭
I may be slow to respond.
  • Germany / Austria
  • 00:45 (UTC +02:00)
View GitHub Profile
@emilyst
emilyst / 99-usb-cdrom.rules
Last active March 21, 2024 20:37
Description for getting MakeMKV working on Synology with DSM 7 using jlesage/makemkv via Docker Compose
SUBSYSTEMS=="usb", ATTRS{idVendor}=="", ATTRS{idProduct}=="", GROUP="cdrom", MODE="0666"
@gullyn
gullyn / flappy.html
Last active May 4, 2024 15:35
Flappy bird in 205 bytes (improved!)
<body onload=z=c.getContext`2d`,setInterval(`c.width=W=150,Y<W&&P<Y&Y<P+E|9<p?z.fillText(S++${Y=`,9,9|z.fillRect(p`}*0,Y-=--M${Y+Y},P+E,9,W),P))):p=M=Y=S=6,p=p-6||(P=S%E,W)`,E=49) onclick=M=9><canvas id=c>
@qoomon
qoomon / conventional_commit_messages.md
Last active June 1, 2024 14:46
Conventional Commit Messages

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs

Commit Message Formats

Default

@domnikl
domnikl / primes.kts
Last active December 30, 2021 11:25
Kotlin Prime number sequence
fun primes(): Sequence<Long> {
var i = 0L
return sequence {
generateSequence { i++ }
.filter { n -> n > 1 && ((2 until n).none { i -> n % i == 0L }) }
.forEach { yield(it) }
}
}

Raspberry Pi Audio Visualiser

To play music at home, I use a Raspberry Pi and Shairport-sync to receive an Airplay stream and output via a pair of USB speakers.

I wanted to sample the audio stream, display an audio visualiser on the Display-o-Tron LCD display. Additionally I wanted to display the track info, which can be read from the metadata.

Using a bit of python magic, we can tie it all together...! Watch it all in action:

Raspberry Pi Visualiser

@dvlden
dvlden / ffmpeg.md
Last active May 14, 2024 14:25
Convert video files to MP4 through FFMPEG

This is my personal list of functions that I wrote for converting mov files to mp4!

Command Flags

Flag Options Description
-codec:a libfaac, libfdk_aac, libvorbis Audio Codec
-quality best, good, realtime Video Quality
-b:a 128k, 192k, 256k, 320k Audio Bitrate
-codec:v mpeg4, libx264, libvpx-vp9 Video Codec
@adrianoluis
adrianoluis / StringUtil.kt
Created August 10, 2017 19:33
Simple class to slugify text in Kotlin.
import java.text.Normalizer
object StringUtil {
fun slugify(word: String, replacement: String = "-") = Normalizer
.normalize(word, Normalizer.Form.NFD)
.replace("[^\\p{ASCII}]".toRegex(), "")
.replace("[^a-zA-Z0-9\\s]+".toRegex(), "").trim()
.replace("\\s+".toRegex(), replacement)
.toLowerCase()
@lmammino
lmammino / RandomWebToken.java
Last active October 20, 2021 18:35
A sample Java class that generates a URL safe random token
import java.security.SecureRandom;
import java.util.Base64;
import java.util.Base64.Encoder;
public class RandomWebToken
{
public static void main(String[] args)
{
SecureRandom random = new SecureRandom();
byte bytes[] = new byte[128];
@parmentf
parmentf / GitCommitEmoji.md
Last active June 1, 2024 05:39
Git Commit message Emoji
@icaoberg
icaoberg / rename.sh
Created July 16, 2013 04:30
[BASH] Rename all files in the current folder using a universally unique identifier (UUID)
#!/bin/bash
for FILE in *
do
if [ -f "$FILE" ];then
ID=`uuidgen`
EXTENSION=${FILE#*.}
mv -v "$FILE" "$ID"."$EXTENSION"
fi
done