Skip to content

Instantly share code, notes, and snippets.

View Thundzz's full-sized avatar
💾
Stop thinking too much and DO stuff

Thundzz Thundzz

💾
Stop thinking too much and DO stuff
View GitHub Profile
@Thundzz
Thundzz / jq_filter_build_array_and_object.sh
Created May 14, 2025 20:42
jq example with array filtering, array comprehension and object comprehension
curl -s "https://api.example.com/v1/configurations?date=2025-04-25" | jq -c '[.[] | select(.itemType == 5) | { (.itemId | tostring): .itemName }]'
@Thundzz
Thundzz / example_process_substitution.txt
Created April 23, 2025 22:36
Example process substitution in the output direction
echo "Hello, world!" | tee >(sed 's/Hello/Hi/' > hi.txt) >(tr 'a-z' 'A-Z' > upper.txt) >(cat > file.txt)
@Thundzz
Thundzz / floaty_doubly.c
Last active March 15, 2025 16:53
A simple C program that prints the sum of 0.1 and 0.2 as floats and double to display the inaccuracy associated with these types
#include <stdio.h>
/**
* Expected output:
* floaty : 0.30000001192092895507812500000000
* doubly : 0.30000000447034835815429687500000
* floaty : 2833116928.000000
* doubly : 2833116923.303232
*
* Python program using the decimal type:
@Thundzz
Thundzz / extract_and_rotate_pdf.sh
Created October 26, 2023 10:06
Extract and rotate a page from a pdf using pdftk
#!/bin/bash
# page number and rotation
pdftk $input cat 5south output $output
@Thundzz
Thundzz / reencode.sh
Last active February 1, 2025 21:45
A small bash script utilizing ffmpeg to re-encode a video file so that the video stream is widely compatible
#!/bin/bash
source="$1"
output="${source%.*}_reencoded.${source##*.}"
ffmpeg -i "$source" -c:v h264_amf -rc cqp -q:v 23 -pix_fmt yuv420p -map 0 -c:a aac -c:s copy "$output"
@Thundzz
Thundzz / yt_mp3_download.sh
Created May 1, 2021 14:37
youtube-dl mp3
youtube-dl --extract-audio --audio-format mp3 -o "%(title)s.%(ext)s" https://www.youtube.com/watch?v=Ybnpn4dTHxw
#!/bin/bash
HOST="42.42.42.42:9000"
for file in file1 file2
do
if [[ -f $file ]]; then
echo "$file was already at least partially downloaded"
else
echo "Downloading $file"
Movie Id Movie name Release year Author id
1 The Matrix 1999 1
2 The Matrix Reloaded 2003 1
3 The Matrix Revolutions 2003 1
Author id name country
1 The Wachowskis USA
@Thundzz
Thundzz / medium_parquet_article_denormalized.csv
Last active April 2, 2020 12:47
tables for medium article
Movie Id Movie name Release year Author name Author country
1 The Matrix 1999 The Wachowskis USA
2 The Matrix Reloaded 2003 The Wachowskis USA
3 The Matrix Revolutions 2003 The Wachowskis USA