Skip to content

Instantly share code, notes, and snippets.

View fabiofidanza's full-sized avatar

fabiofidanza

View GitHub Profile
@fabiofidanza
fabiofidanza / invert.txt
Last active July 30, 2024 10:02
Invert coordinates in geoJSON
Search regex
\[[\s\n]+(\-*\d+.\d+),[\s\n]+(\-*\d+.\d+)[\s\n]+\]
( vscode \[[\s\n]+(-*\d+.\d+),[\s\n]+(-*\d+.\d+)[\s\n]+\] )
Replace
[$2,$1]
ffmpeg -i input.mov -filter_complex "fps=5, scale=-1:180" output.gif
@fabiofidanza
fabiofidanza / reverse-table-rows.css
Created April 3, 2024 20:13
Reverse table rows order
table {
transform: scaleY(-1);
}
tr {
transform: scaleY(-1);
}
@fabiofidanza
fabiofidanza / convertera.sh
Last active August 6, 2024 16:29
Convert all wavs in a folder to mp3 + ogg
for f in *.wav; do ffmpeg -i "$f" -c:a libmp3lame -q:a 2 "${f/%wav/mp3}" -c:a libvorbis -q:a 4 "${f/%wav/ogg}"; done
HQ
for f in *.wav; do ffmpeg -i "$f" -c:a libmp3lame -q:a 0 "${f/%wav/mp3}"; done
@fabiofidanza
fabiofidanza / zzimia.js
Last active December 11, 2023 16:26
ZziMia™ — Hide your events title from your Google Calendar when you have to share your availability with other folks
let link = document.createElement('link');
link.href = "https://fonts.googleapis.com/css2?family=Redacted+Script:wght@700&display=swap";
link.rel="stylesheet";
document.body.appendChild(link);
document.querySelectorAll('*[data-eventchip]').forEach( (e) => {
e.style.fontFamily = "Redacted Script";
e.style.fontWeight = "700";
@fabiofidanza
fabiofidanza / Blur calendar
Created November 22, 2023 14:33
Blur Google calendar
document.querySelectorAll('*[data-eventchip]').forEach( (e) => {
e.style.filter="blur(4px)";
})
@media only screen and (max-width: 900px) {
* {
display: none;
}
}
precalculateColorTransition = function(fromHex, toHex, steps=30) {
const fromRGB = [ parseInt(fromHex.substr(0, 2), 16),
parseInt(fromHex.substr(2, 2), 16),
parseInt(fromHex.substr(4, 2), 16)
];
const toRGB = [ parseInt(toHex.substr(0, 2), 16),
parseInt(toHex.substr(2, 2), 16),
parseInt(toHex.substr(4, 2), 16)
.ajax-progress {
position: fixed;
text-align: center;
color: $teal;
padding: 20px 20px 0 20px;
width: auto;
height: auto;
font-weight: 700;
font-size: 5rem;
z-index: 90210;
@fabiofidanza
fabiofidanza / pecetta.css
Last active April 18, 2023 10:00
Cost-example pecetta
.cost-example--value:nth-child(3) {
position: relative;
}
.cost-example--value:nth-child(3)::after {
content: "Il più urgente";
position: absolute;
z-index: 9000;
font-size: 10px;
text-align: center;