Skip to content

Instantly share code, notes, and snippets.

View drupol's full-sized avatar

Pol Dellaiera drupol

View GitHub Profile
@drupol
drupol / drupal.nix
Last active May 26, 2023 16:22
drupal.nix
{ stdenvNoCC, fetchFromGitHub, php, unzip, _7zz }:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "drupal";
version = "10.0.9";
nativeBuildInputs = [
unzip
_7zz
];
@drupol
drupol / default.nix
Created April 20, 2023 19:59
PHPUnit with new PHP Hooks
{ stdenv, lib, fetchFromGitHub, php }:
stdenv.mkDerivation (finalAttrs:
let
src = fetchFromGitHub {
owner = "sebastianbergmann";
repo = "phpunit";
rev = finalAttrs.version;
hash = "sha256-VcQRSss2dssfkJ+iUb5qT+FJ10GHiFDzySigcmuVI+8=";
};
@drupol
drupol / university.typ
Created April 17, 2023 19:15
university.typ
#import "../../slides.typ": *
#import "../../themes/university.typ": *
#show: slides.with(
authors: "Andreas Kröpelin",
short-authors: "A. Kröpelin",
title: [`typst-slides`: Easily creating slides in Typst ],
subtitle: "An overview over all the features",
short-title: "Slides template demo",
date: "April 2023",
@drupol
drupol / default.nix
Created April 7, 2023 17:18
phpactor/default.nix
{ lib, stdenvNoCC, fetchFromGitHub, php }:
let
version = "2023.01.21";
src = fetchFromGitHub {
owner = "phpactor";
repo = "phpactor";
rev = version;
hash = "sha256-jWZgBEaffjQ5wCStSEe+eIi7BJt6XAQFEjmq5wvW5V8=";
@drupol
drupol / SessionMiddleware.php
Last active April 6, 2023 18:24
Request for comments - Into making a generic service - version 5
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
@drupol
drupol / StoragelessManager.php
Last active April 5, 2023 11:14
Request for comments - Into making a generic service (version 4)
<?php
declare(strict_types=1);
namespace PSR7Sessions\Storageless\Service;
use Closure;
use Dflydev\FigCookies\Cookie;
use Dflydev\FigCookies\Cookies;
use Dflydev\FigCookies\FigResponseCookies;
@drupol
drupol / StoragelessManager.php
Created April 4, 2023 12:52
Request for comments - Into making a generic service - version 3
<?php
declare(strict_types=1);
namespace PSR7Sessions\Storageless\Service;
use Dflydev\FigCookies\Cookie;
use Dflydev\FigCookies\Cookies;
use Dflydev\FigCookies\FigRequestCookies;
use Dflydev\FigCookies\FigResponseCookies;
@drupol
drupol / StoragelessManager.php
Created April 4, 2023 12:13
Request for comments - Into making a generic service - version 2
<?php
declare(strict_types=1);
namespace PSR7Sessions\Storageless\Service;
use Dflydev\FigCookies\Cookie;
use Dflydev\FigCookies\Cookies;
use Dflydev\FigCookies\FigResponseCookies;
use Dflydev\FigCookies\Modifier\SameSite;
@drupol
drupol / StoragelessManager.php
Last active April 4, 2023 09:51
Request for comment - Into making a generic service
<?php
declare(strict_types=1);
namespace PSR7Sessions\Storageless\Service;
use Dflydev\FigCookies\Cookie;
use Dflydev\FigCookies\Cookies;
use Dflydev\FigCookies\FigRequestCookies;
use Dflydev\FigCookies\FigResponseCookies;
{ modulesPath, pkgs, lib, config, ... }:
let
db_name = "<name>";
db_user = "<user>";
in
{
services.postgresql =
{
enable = true;
package = pkgs.postgresql_13;