Skip to content

Instantly share code, notes, and snippets.

@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