Skip to content

Instantly share code, notes, and snippets.

View Joao-Peterson's full-sized avatar
💭
Procastinating...

Peterson Scheffer Joao-Peterson

💭
Procastinating...
View GitHub Profile
@Nick-Gabe
Nick-Gabe / cat.js
Last active June 30, 2025 18:28
cat zap zap web
setInterval(() => {
i=atob('aHR0cHM6Ly9pMS5zbmRjZG4uY29tL2FydHdvcmtzLWxHdXU5bnRES0FSeTZ6YjAtMldMUUxBLXQ1MDB4NTAwLmpwZw==');
Array.from(document.querySelectorAll(`img:not([src="${i}"])`))
.forEach(image => image.src = i);
Array.from(document.querySelectorAll('svg'))
.forEach(svg=>svg.outerHTML=`<img src="${i}" style="height:${svg.clientHeight}px;width:${svg.clientWidth}px"></img>`)
},100);
@svavassori
svavassori / powerbi_extractor.py
Last active September 2, 2025 15:12
PowerBi Extractor in Python
import sys
import csv
import json
# Converts the JSON output of a PowerBI query to a CSV file
def extract(input_file, output_file):
input_json = read_json(input_file)
data = input_json["results"][0]["result"]["data"]
dm0 = data["dsr"]["DS"][0]["PH"][0]["DM0"]
@jamesmacwhite
jamesmacwhite / ffmpeg_mkv_mp4_conversion.md
Last active December 29, 2025 13:19
Easy way to convert MKV to MP4 with ffmpeg

Converting mkv to mp4 with ffmpeg

Essentially just copy the existing video and audio stream as is into a new container, no funny business!

The easiest way to "convert" MKV to MP4, is to copy the existing video and audio streams and place them into a new container. This avoids any encoding task and hence no quality will be lost, it is also a fairly quick process and requires very little CPU power. The main factor is disk read/write speed.

With ffmpeg this can be achieved with -c copy. Older examples may use -vcodec copy -acodec copy which does the same thing.

These examples assume ffmpeg is in your PATH. If not just substitute with the full path to your ffmpeg binary.

Single file conversion example

@joostrijneveld
joostrijneveld / gpg2qrcodes.sh
Created May 20, 2014 19:43
Producing printable QR codes for persistent storage of GPG private keys
# Heavily depends on:
# libqrencode (fukuchi.org/works/qrencode/)
# paperkey (jabberwocky.com/software/paperkey/)
# zbar (zbar.sourceforge.net)
# Producing the QR codes:
# Split over 4 codes to ensure the data per image is not too large.
gpg --export-secret-key KEYIDGOESHERE | paperkey --output-type raw | base64 > temp
split temp -n 4 IMG
for f in IMG*; do cat $f | qrencode -o $f.png; done