Skip to content

Instantly share code, notes, and snippets.

View fercomunello's full-sized avatar

Fernando Comunello fercomunello

View GitHub Profile
@fercomunello
fercomunello / hx-progres-bar.html
Created November 10, 2023 19:42
HTMX progress bar client-side component
<!-- add hx-indicator="#main-progress-bar" on <body> -->
<div id="main-progress-bar" class="progress-bar">
<div class="progress-indicator"></div>
</div>
@fercomunello
fercomunello / index-partial.html
Last active November 21, 2023 00:45
Demo: Boosting pages with HTMX.
<head>
<title>Index | @htmx.org</title>
</head>
<h1>Home</h1>
<p>Having fun with htmx ^^</p>
@fercomunello
fercomunello / Decode.java
Created November 23, 2023 17:53
OOP way of computing enum sets
import java.util.Optional;
public final class Decode<T> implements Expression<T> {
private final T value;
private final boolean expression;
public Decode(final boolean expression, final T value) {
this.expression = expression;
this.value = value;
@fercomunello
fercomunello / Text.java
Last active November 23, 2023 18:43
An OOP Text implementation (not nullable & always "trimmed")
import java.util.Objects;
public class Text implements CharSequence {
protected final CharSequence origin;
public Text(final String origin) {
this.origin = origin == null ? "" : origin.trim();
}
@fercomunello
fercomunello / convert.sh
Last active January 8, 2024 22:26
Convert FLAC to OPUS
#!/usr/bin/env bash
set -em
cd $(dirname $0)
rm -f *.opus
for i in *.flac
do
opusenc --bitrate 160 "$i" "$(echo $i | sed "s/.flac//g")".opus
mv -v *.opus ../opus
done