Skip to content

Instantly share code, notes, and snippets.

@mmouih
mmouih / MyService.php
Created January 22, 2024 02:22
AsPeriodicTask usage
<?php
namespace App\Service;
use Symfony\Component\Scheduler\Attribute\AsPeriodicTask;
class MyService
{
#[AsPeriodicTask(schedule: 'watchdog_attribute', frequency: '5 seconds', jitter: 10)]
public function monitoring(): void
@schacon
schacon / better-git-branch.sh
Created January 13, 2024 18:41
Better Git Branch output
#!/bin/bash
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
NO_COLOR='\033[0m'
BLUE='\033[0;34m'
YELLOW='\033[0;33m'
NO_COLOR='\033[0m'
@beerendlauwers
beerendlauwers / OAuthEsmtpTransportFactoryDecorator.php
Last active May 3, 2024 16:56 — forked from dbu/OAuthEsmtpTransportFactoryDecorator.php
(Drupal) Send emails with Symfony Mailer through Outlook / office365 with OAuth
<?php
namespace Drupal\symfony_mailer_office365\Transport;
use Symfony\Component\Mailer\Transport\Dsn;
use Symfony\Component\Mailer\Transport\Smtp\Auth\AuthenticatorInterface;
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport;
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransportFactory;
use Symfony\Component\Mailer\Transport\TransportFactoryInterface;
use Symfony\Component\Mailer\Transport\TransportInterface;
@dbu
dbu / OAuthEsmtpTransportFactoryDecorator.php
Last active April 18, 2024 13:11
Send emails with Symfony Mailer through Outlook / office365 with OAuth
<?php
declare(strict_types=1);
namespace App\Infrastructure\Email;
use Symfony\Component\Mailer\Transport\Dsn;
use Symfony\Component\Mailer\Transport\Smtp\Auth\AuthenticatorInterface;
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport;
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransportFactory;
@jh3y
jh3y / gsap-eases.css
Last active May 15, 2024 08:29
GreenSock eases with CSS linear()
:root {
--none: linear(0, 1);
--power1-in: linear( 0, 0.0039, 0.0156, 0.0352, 0.0625, 0.0977, 0.1407, 0.1914, 0.2499, 0.3164, 0.3906 62.5%, 0.5625, 0.7656, 1 );
--power1-out: linear( 0, 0.2342, 0.4374, 0.6093 37.49%, 0.6835, 0.7499, 0.8086, 0.8593, 0.9023, 0.9375, 0.9648, 0.9844, 0.9961, 1 );
--power1-in-out: linear( 0, 0.0027, 0.0106 7.29%, 0.0425, 0.0957, 0.1701 29.16%, 0.2477, 0.3401 41.23%, 0.5982 55.18%, 0.7044 61.56%, 0.7987, 0.875 75%, 0.9297, 0.9687, 0.9922, 1 );
--power2-in: linear( 0, 0.0014 11.11%, 0.0071 19.24%, 0.0188 26.6%, 0.037 33.33%, 0.0634 39.87%, 0.0978 46.07%, 0.1407 52.02%, 0.1925 57.74%, 0.2559 63.49%, 0.3295 69.07%, 0.4135 74.5%, 0.5083 79.81%, 0.6141 85%, 0.7312 90.09%, 1 );
--power2-out: linear( 0, 0.2688 9.91%, 0.3859 15%, 0.4917 20.19%, 0.5865 25.5%, 0.6705 30.93%, 0.7441 36.51%, 0.8075 42.26%, 0.8593 47.98%, 0.9022 53.93%, 0.9366 60.13%, 0.963 66.67%, 0.9812 73.4%, 0.9929 80.76%, 0.9986 88.89%, 1 );
--power2-in-out: linear( 0, 0.0036 9.62%, 0.0185 16.66
@aaronpeters
aaronpeters / pages-cache-control-no-store.txt
Created August 25, 2023 15:24
HTTP Archive: number of pages with cache-control: no-store
SELECT
_TABLE_SUFFIX AS client,
count(DISTINCT pageid) AS pages,
pages_total,
count(DISTINCT pageid) / pages_total AS pages_pct,
FROM
`httparchive.summary_requests.2021_08_01_*`
JOIN
(SELECT _TABLE_SUFFIX, COUNT(DISTINCT pageid) AS pages_total FROM `httparchive.summary_requests.2021_08_01_*` GROUP BY _TABLE_SUFFIX)
USING (_TABLE_SUFFIX)
@marvinhagemeister
marvinhagemeister / bind-plugin.ts
Last active January 9, 2024 20:31
Preact Signals `bind:value`
import { options } from "preact";
import { Signal } from "@preact/signals";
// Add `bind:value` to JSX types
declare global {
namespace preact.createElement.JSX {
interface HTMLAttributes {
"bind:value"?: Signal<string | string[] | number | undefined>;
}
}
@nielsdos
nielsdos / html5.md
Last active November 27, 2023 11:06
Dockerfile for HTML5 branch

Building the following Dockerfile will give you the latest version of my ext/dom HTML5 branch:

FROM ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive

RUN apt update
RUN apt install -y binutils gcc re2c flex bison libxml2-dev libsqlite3-dev vim git autoconf pkg-config make libonig-dev
...
[alias]
rb = !sh -c 'node ~/bin/recbranch.js'
...
@rena2019
rena2019 / deutschlandticket.md
Last active May 18, 2024 09:55
DeutschlandTicket Anomalien

DeutschlandTicket Anomalien

Einige DeutschlandTickets sind anders als die anderen. Preislich soll es für 49EUR starten und für ganz Deutschland einen bestimmten Featureset mitbringen. Folgende Verkehrsverbunde wollen allerdings Zusatzoptionen anbieten:

Falls Ihr noch weitere kennt: einfach unten als Kommentar oder via Twitter ergaenzen

  • Dresdner Verkehrsbetriebe AG (DVB) @ Verkehrsverbund Oberelbe (VVO) bzw siehe PDF vom VVO
    • Deutschlandticket Plus Mitnahme (+10 EUR)
      Berechtigt zur Mitnahme im Verkehrsverbund Oberelbe (VVO) von einem Hund oder einem Fahrrad ohne zeitliche Einschränkung sowie einem weiteren Erwachsenen und bis zu vier Schülern bis zum 15. Geburtstag von Montag bis Freitag zwischen 18 und 4 Uhr sowie ganztags an Wochenenden und Feiertagen.