Skip to content

Instantly share code, notes, and snippets.

@7ute
7ute / ghost.php
Created February 19, 2026 09:04
PHP Ghost Admin Token Generator
<?php
use Firebase\JWT\JWT;
class Ghost
{
/**
* @param string $admin_api_key The Ghost Admin API Key
* @param int $ttl Token validity in minutes
*/
public static function adminToken($admin_api_key, $ttl = 5)
/* ==UserStyle==
@name youtube.com - 01/12/2022 12:45:43
@namespace github.com/openstyles/stylus
@version 1.0.0
@description Mitigates Youtube Enshittification, and provides a better video list UI (👋 Google, 🤙 if you want tips about what a normal user actually wants…)
@author 7ute
==/UserStyle== */
@-moz-document domain("youtube.com") {
#contents.ytd-rich-grid-renderer {
@7ute
7ute / Dockerfile
Created March 16, 2024 22:28
PNPM + Astro as node middleware + Docker with production and development environment
FROM node:lts-slim AS base
WORKDIR /app
EXPOSE 4321
ENV HOST=0.0.0.0
ENV PORT=4321
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
@7ute
7ute / nginx.conf
Created July 31, 2023 09:04
Redirect and strip query parameters in NGINX
if ($request_uri ~ "([^\?]*)\?unwantedParam=(.*)") {
rewrite ^ "https://www.example.org?" permanent;
}
@7ute
7ute / MY_NAMESPACE_sitemap_provider.php
Created January 26, 2023 10:33
Yoast custom sitemap provider
<?php
/**
* These class and hook allow exposing your data to Yoast, for it to build
* the sitemap, split it correctly in multiple pages every 1000 entries,
* and add it to its index. Here's a list of the placeholders I used :
* - MY_NAMESPACE: your Plugin/theme/custom namespace
*
* - MY_CUSTOM_DATATYPE: The type of data you're exposing in those sitemaps
* - MY_CUSTOM_DATATABLE: Database table hosting your data