Skip to content

Instantly share code, notes, and snippets.

View drupol's full-sized avatar

Pol Dellaiera drupol

View GitHub Profile
@drupol
drupol / phpdocumentor-repro-issue.sh
Last active January 13, 2025 14:11
phpdocumentor-repro-issue.sh
#!/usr/bin/env bash
# Dependencies:
#
# 1. Create a nix shell with: `nix shell nixpkgs#phpPackages.composer nixpkgs#gitMinimal nixpkgs#diffoscopeMinimal`
# 2. Run this script
composer --version
if [[ ! -d "phpdocumentor" ]]; then
@drupol
drupol / either.py
Created January 8, 2025 19:45
My initial view of what a Either and Maybe monads would look like in Python
from typing import Callable, Generic, TypeVar, final
A = TypeVar("A", covariant=True)
B = TypeVar("B", covariant=True)
C = TypeVar("C", covariant=True)
@final
class Either(Generic[A, B]):
class Left:
@drupol
drupol / overlay.nix
Last active June 26, 2024 03:17
OpenBlas overlay
(self: super: {
openblas = super.openblas.overrideAttrs (oldAttrs: {
makeFlags = oldAttrs.makeFlags ++ [
"DEBUG=1"
];
});
})
@drupol
drupol / .devcontainer.json
Created April 10, 2024 11:26
.devcontainer.json
{
"image": "mcr.microsoft.com/devcontainers/base:alpine",
"features": {
"ghcr.io/devcontainers/features/nix:1": {
"extraNixConfig": "experimental-features = nix-command flakes"
}
},
"onCreateCommand": "nix run home-manager/master -- init --switch && rm -rf ~/.config/git/config && nix shell nixpkgs#git -c nix run home-manager/master -- switch --flake git+https://code.europa.eu/ecphp/devs-profile#light --impure",
"customizations": {
"vscode": {
@drupol
drupol / postgres.nix
Created April 2, 2024 12:24
postgres.nix
{ lib
, dockerTools
, writeText
, writeShellScriptBin
, postgresql
, bash
, coreutils
, nss_wrapper
}:
@drupol
drupol / flake.nix
Created March 22, 2024 10:36
flake.nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
systems.url = "github:nix-systems/default";
};
outputs = inputs @ { self, flake-parts, ... }: flake-parts.lib.mkFlake { inherit inputs; } {
systems = import inputs.systems;
perSystem = { config, self', inputs', pkgs, system, lib, ... }: let
@drupol
drupol / typst-preview.log
Created March 18, 2024 15:41
typst-preview.log
typst-preview> Compiling typst-ts-compiler v0.4.2-rc9
typst-preview> Compiling await-tree v0.1.2
typst-preview> Compiling futures v0.3.30
typst-preview> warning: [email protected]: could not find repository at '/build/source'; class=Repository (6); code=NotFound (-3)
typst-preview> warning: [email protected]: VERGEN_GIT_DESCRIBE set to default
typst-preview> warning: [email protected]: VERGEN_GIT_SHA set to default
typst-preview> Compiling open v5.1.2
typst-preview> Compiling tokio-tungstenite v0.21.0
typst-preview> error: couldn't read src/index.html: No such file or directory (os error 2)
typst-preview> --> src/lib.rs:116:20
@drupol
drupol / guix.scm
Created March 18, 2024 12:42
guix.scm
(use-modules (guix)
(guix build-system gnu))
(define-public datetime
(package
(name "datetime")
(version "1.0")
(source (local-file "./src" #:recursive? #t))
(build-system gnu-build-system)
(arguments
@drupol
drupol / CITATION.cff
Created March 12, 2024 08:07
CITATION.cff
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!
cff-version: 1.2.0
title: Reproducible Builds
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
@drupol
drupol / php-ec.patch
Created February 18, 2024 09:57
php-ec.patch
diff --git i/ext/standard/css.c w/ext/standard/css.c
index 9009d95291..bb4a95c3c8 100644
--- i/ext/standard/css.c
+++ w/ext/standard/css.c
@@ -32,8 +32,8 @@ PHPAPI ZEND_COLD void php_info_print_css(void) /* {{{ */
PUTS("h1 {font-size: 150%;}\n");
PUTS("h2 {font-size: 125%;}\n");
PUTS(".p {text-align: left;}\n");
- PUTS(".e {background-color: #ccf; width: 300px; font-weight: bold;}\n");
- PUTS(".h {background-color: #99c; font-weight: bold;}\n");