Skip to content

Instantly share code, notes, and snippets.

@pax
pax / YT-playlist2CSV.js
Created June 4, 2026 10:22
Bookmarklet: YouTube playlist to CSV
javascript:(function(){const items=document.querySelectorAll('ytd-playlist-panel-video-renderer, ytd-playlist-video-renderer');if(items.length===0){alert('No playlist videos found. Make sure the panel is visible.');return;}let pTitle='youtube_playlist';const pt1=document.querySelector('.title.ytd-playlist-panel-renderer');const pt2=document.querySelector('ytd-playlist-header-renderer yt-formatted-string, ytd-playlist-header-renderer h1');if(pt1&&pt1.textContent)pTitle=pt1.textContent.trim();else if(pt2&&pt2.textContent)pTitle=pt2.textContent.trim();else pTitle=document.title.replace(' - YouTube','');let safeName=pTitle.replace(/[\/\\?%*:|"<>]/g,%27_%27).substring(0,50)+%27.yt-plist.csv%27;let csv=%27Index,Titlu,Canal,Durata,URL\n%27;items.forEach((item,index)=>{let title=%27Fără titlu%27,channel=%27%27,time=%27%27,url=%27%27;const tEl=item.querySelector(%27#video-title');if(tEl)title=tEl.textContent.trim().replace(/"/g,'""');const cEl=item.querySelector('#byline');if(cEl)channel=cEl.textContent.trim().replace
@pax
pax / video-editing.txt
Created December 25, 2024 14:43
video editing
# creates timelapse from a series of images
ffmpeg -framerate 24 -pattern_type glob -i "folder/path/*.jpg" -c:v libx264 -pix_fmt yuv420p timelapse-3.mp4
# stitches vertically 2 videos
ffmpeg -i video1.mp4 -i video2.mp4 -filter_complex "[0:v:0][1:v:0]vstack=inputs=2" -shortest -c:v libx264 output.mp4
@pax
pax / img-morphing.sh
Last active December 25, 2024 14:39
adds 2 frames with blended opacity in between each 2 jpg images in a folder
#!/bin/bash
# adds 2 frames with blended opacity in between each 2 jpg images in a folder
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <input_directory>"
exit 1
fi
input_dir="$1"
@pax
pax / style.css
Created February 28, 2024 13:00
Creates a Table of Contents with relative links to H* elements found inside target element or the whole document
.hx-0{margin-top:1.25ex;border-bottom:1pxdotted#999;font-size:1.2em;}
.hx-1{padding-left:.25ex;margin-left:.25ex;margin-top:1ex;font-size:1.1em;border-bottom:1pxdotted#DDD;}
.hx-2{padding-left:.75ex;margin-left:.5ex;margin-top:.5ex;border-left:1pxsolid#EEE;}
.hx-3{padding-left:1ex;margin-left:1ex;margin-top:.25ex;border-left:1pxsolid#EEE;}
.hx-0+.hx-0{margin-top:.25ex;}
.hx-2+.hx-2{margin-top:.5ex;}
.hx-1+.hx-1{margin-top:1ex;}
.hx-1:before {content: '\2022\00A0 '; color: #DCC;}
.hx-2:before {content: '\00A0\203A\00A0\00A0 '; color: #DCC;}
@pax
pax / resize_images.sh
Created January 27, 2024 21:23
batch resize and optimize images
#!/bin/bash
# Check if an argument is provided
if [ "$#" -ne 1 ]; then
echo "Usage: $0 /path/to/image/directory"
exit 1
fi
# Define the maximum width, height, and quality
MAX_WIDTH=1920
@pax
pax / vidcompress.sh
Created January 27, 2024 18:14
Batch compress and resize videos (mov, mp3, mp4)
#!/bin/bash
# Parameters
CRF_VALUE=28 # Quality level for video compression (lower is higher quality)
FRAME_RATE=24 # Frame rate for video files
AUDIO_BITRATE=96k # Audio bitrate for MP3 files
RESIZE_PERCENT=75 # Resize percent (e.g., 75 for 75% of original size)
MIN_WIDTH=2800 # Minimum width in pixels to apply resizing
# Target directory (use current directory if not specified)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pax
pax / CSV wrangling.md
Last active May 20, 2026 12:20
Tools & cli snippets for handling large csv files

tags: cheatsheet, csv, json, dev

Largeish data wrangling (csv, json)

  • Desktop apps
  • Web Apps
  • CLI Tools
  • CLI Snippets
@pax
pax / html-colors-cheatsheet.html
Created February 6, 2016 21:33
HTML colos cheatsheet
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="icon" type="image/png" href="/favicon.png">
<title>&#9673; HTML color names</title>
<style>
body {font: 12px Arial, Helvetica, sans-serif; }
.js-color {width: 2.5em; height: 2.5em; border-radius: 50%}
h4 {font-weight: normal; margin: 0} li {vertical-align: middle;}
@pax
pax / emoji.html
Created February 6, 2016 21:31
emoji cheatsheet
<html>
<head>
<meta charset="UTF-8">
<title>&#9733; Emoji cheat-sheet</title>
<style>
html {
font-family: sans-serif;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;