Skip to content

Instantly share code, notes, and snippets.

View jasonflorentino's full-sized avatar
✌️

Jason Florentino jasonflorentino

✌️
View GitHub Profile
@jasonflorentino
jasonflorentino / shrink-vid
Created October 27, 2025 21:26
Small file size video
ffmpeg -i input.mov \
-vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" \
-vcodec libx264 -crf 28 -preset fast \
-an -movflags +faststart -y \
output.mp4
/**
* Transform JSON file of an array of objects
* into a CSV file.
*
* From:
* [
* {"key1":"hello","key2":"world"},
* {"key1":"foo","key2":"bar"}
* ]
* To:
@jasonflorentino
jasonflorentino / readerMode.js
Last active July 3, 2023 02:31
quick styles to make a document nicer to read
(function readerMode() {
let sheet = new CSSStyleSheet();
sheet.insertRule(`body,ol,li,p,em,tr,td {
max-width: 1200px;
margin-left: auto;
margin-right: auto;
background: #222;
color: #fff !important;
font-size: 22px;
line-height: 36px;
@jasonflorentino
jasonflorentino / live-average.js
Created September 18, 2022 15:18
Do it live in your js console -- get the average of numbers you put in the array
[1,2,3,4,5,6,7,8,9,10]
.reduce((z,v,i,a)=>[z[0]+a[i],a.length],[0])
.reduce((z,v,i,a)=>a[0]/a[1],1);
// 5.5
Need to login to GoDaddy / cPanel
Need to login to WordPress
Main instructions: https://isotropic.co/free-ssl-on-godaddy-wordpress/#step-one-install-ssl-zen
But instead of just adding each piece of the cert in cPanel,
do this instead:
In cPanel > SSL/TLS
Under INSTALL AND MANAGE SSL FOR YOUR SITE (HTTPS)
@jasonflorentino
jasonflorentino / better-dark-page.js
Created August 10, 2022 02:15
make a web page go dark mode
// Paste this into the browser console for instant dark mode.
// DISCLAIMER: Don't paste code into the browser console! ;p
(function instantDarkMode() {
let sheet = new CSSStyleSheet();
sheet.insertRule('html { filter: invert(1); }');
sheet.insertRule('body img { filter: invert(1); }');
document.adoptedStyleSheets.push(sheet);
})()
@jasonflorentino
jasonflorentino / darken-web-page.js
Last active February 22, 2022 03:40
darken a webpage
// USAGE:
// Copy + paste this code into
// the browser's JavaScript console.
//
// DISCLAIMER:
// Don't paste random code into
// the browser's JavaScript console!
//
// NOTE:
// This will ruin a bunch of existing styles so