Skip to content

Instantly share code, notes, and snippets.

View alekstrust's full-sized avatar

Javier Távara alekstrust

View GitHub Profile
@alekstrust
alekstrust / default.vcl_PREFACE.md
Created March 17, 2020 14:08 — forked from fevangelou/default.vcl_PREFACE.md
The perfect Varnish configuration for Joomla, WordPress & other CMS based websites

The perfect Varnish configuration for Joomla, WordPress & other CMS based websites

IMPORTANT: Read this before implementing one of the configuration files below (for either Varnish 3.x or 4.x+).

USE: Replace the contents of the main Varnish configuration file located in /etc/varnish/default.vcl (root server access required - obviously) with the contents of the configuration you'll use (depending on your Varnish version) from the 2 examples provided below.

IMPORTANT: The following setup assumes a 3 minute (180 sec) cache time. You can safely increase this to 5 mins for less busier sites or drop it to 1 min or even 30s for high traffic sites.

This configuration requires an HTTP Header and a user cookie to identify if a user is logged in a site, in order to bypass caching overall (see how it's done in the Joomla section). If your CMS provides a way to add these 2 requirements, then you can use this configuration to speed up your site or entire server. You can even exclude the domains you don't want to cach

@alekstrust
alekstrust / tailwind-colors.scss
Last active September 9, 2021 15:05
Sass colors from Tailwind 2.2
$color-blueGray-50: #F8FAFC;
$color-blueGray-100: #F1F5F9;
$color-blueGray-200: #E2E8F0;
$color-blueGray-300: #CBD5E1;
$color-blueGray-400: #94A3B8;
$color-blueGray-500: #64748B;
$color-blueGray-600: #475569;
$color-blueGray-700: #334155;
$color-blueGray-800: #1E293B;
$color-blueGray-900: #0F172A;

Conventional Commit Messages starline

See how a minor change to your commit message style can make a difference.

Tip

Take a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs

Commit Message Formats

Default

@alekstrust
alekstrust / gist:14c420dbb2478ec7dc70f35cb04fdd0f
Created November 21, 2025 21:14
Add Authentik IdP groups to Cognito JWT
export const handler = function(event, context) {
// Log the incoming user attributes for debugging
console.debug(event);
// Extract the custom:idpgroups claim
const externalUserGroupsString = event.request.userAttributes['custom:idpgroups'];
// Parse the stringified array
const externalUserGroups = JSON.parse(externalUserGroupsString);
console.debug("External user groups:", externalUserGroups);