Skip to content

Instantly share code, notes, and snippets.

View trikko's full-sized avatar

Andrea Fontana trikko

View GitHub Profile
@trikko
trikko / dlang_static.md
Created November 2, 2024 14:09
Build dlang fully static executable

Docker with Alpine+MUSL

FROM alpine:latest
RUN apk add gcc musl-dev ldc dub llvm-libunwind-static openssl-libs-static gzip upx

On dub.json

"dflags": ["--nodefaultlib", "-static"],
"subConfigurations": {

Analisi completa del raffreddamento con evaporazione: Vetro vs Ceramica

1. Dati iniziali e proprietà dei materiali

1.1 Dati iniziali

  • Dimensioni della tazza: 5 cm x 5 cm x 5 cm (volume = 125 cm³)
  • Temperatura iniziale dell'acqua: 100°C
  • Temperatura ambiente: 20°C
  • Massa iniziale dell'acqua: 125 g
  • Pressione atmosferica: 101.325 kPa
@trikko
trikko / uuidv7.d
Created July 10, 2024 16:01
UUIDv7 in dlang
import std;
void main() {
// Test
foreach (i; 0 .. 8) {
auto uuid = UUIDv7();
info("UUID: ", uuid);
}
}
@trikko
trikko / Dockerfile
Created January 30, 2023 17:44
Serverino + Docker
FROM alpine:latest
RUN apk update && apk upgrade
RUN apk add dmd dub cmake gcc make musl-dev
RUN ln -fs /usr/share/zoneinfo/Europe/Rome /etc/localtime
RUN apk add tzdata
RUN adduser -D -S www-data
WORKDIR /source
@trikko
trikko / raylib-video.c
Last active August 4, 2024 12:40
How to render a video with raylib and gstreamer
#include "raylib.h"
#include <gst/gst.h>
#include <gst/app/gstappsink.h>
GstElement* createPipeline(const char* filename)
{
GError *error;
gchar *pipelineString = g_strdup_printf ("filesrc location=%s ! tee name=t ! queue ! decodebin ! videoconvert ! appsink name=output caps=video/x-raw,format=RGBA,pixel-aspect-ratio=1/1 t. ! queue ! decodebin ! audioconvert ! audioresample ! autoaudiosink", filename);
GstElement *pipeline = gst_parse_launch (pipelineString, &error);