Skip to content

Instantly share code, notes, and snippets.

@adrienne
adrienne / mullenweg-wpe.md
Last active February 27, 2025 14:56
The Mullenweg/WPE Thing
@palewire
palewire / README.md
Last active January 2, 2025 23:37
How to push tagged Docker releases to Google Artifact Registry with a GitHub Action

How to push tagged Docker releases to Google Artifact Registry with a GitHub Action

Here's how I configured a GitHub Action so that a new version issued by GitHub's release interface will build a Dockerfile, tag it with the version number and upload it to Google Artifact Registry.

Before you attempt the steps below, you need the following:

  • A GitHub repository that contains a working Dockerfile
  • The Google Cloud SDK tool gcloud installed and authenticated

Create a Workload Identity Federation

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}
@hermanbanken
hermanbanken / kustomize_vars.md
Created November 22, 2020 13:11
Kustomize Vars example

This was initially posted in an kubernetes-sigs/kustomize issue.

We are using Kustomize's vars feature. Initially we didn't understand how to use it for our purpose, but it is a 100% fit. One example is our Ingress resource, which looks like this:

# file: base/ingress.yaml
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: services
@izzyleung
izzyleung / README.md
Last active September 25, 2024 16:49
Run TeamCity agents in your Kubernetes cluster

How to run TeamCity agents in your Kubernetes cluster

For typical CI/CD tasks that don't require Docker daemon access, use the agent.yml pod sepc.

For CI/CD jobs that need Docker daemon to build Docker images, use the privileged-agent.yml pod spec.

Notes

Make sure you are running TeamCity server version >= 2020.1 or have the Kubernetes support plugin installed.

Taking inspiration from tailwindcss and this idea, here is a specification for how to achieve it.

What is it

With TailwindCSS you have an amazing default design system, but it is not ideal. It lacks:

  • Validation of classnames: It does not validate the classnames you insert
  • Composition: It does not allow you to effectively compose together classnames into new classnames and it can not dynamically do so at runtime effectively
  • Defining by variables: Even though it is nice to write TailwindCSS inline with your elements, you can not define classes as variables, because the TailwindCSS extension does not understand it

This solution solves all of this with an even better experience of setup and consumption!

@Baldinof
Baldinof / .dockerignore
Last active February 13, 2024 22:52
Single PHP FPM container with Caddy
/vendor
/docker
/Dockerfile
@donaldpipowitch
donaldpipowitch / README.md
Last active January 29, 2025 18:07
Use GitLab Pages to deploy a Storybook per branch

It's quite straightforward to use GitLab Pages to deploy a Storybook instance per branch (and remove it whenever the branch will be removed). And yeah, it's irony to document this in a GitHub Gist 😅

You just need a .gitlab-ci.yml like this one:

stages:
  - setup
  - build-and-test
  - deployment
  - pages
@maxboeck
maxboeck / donottrack.js
Last active November 6, 2023 10:00
Check "Do Not Track" Client Hint
const allowsTracking = () => {
const dnt =
window.doNotTrack ||
navigator.doNotTrack ||
navigator.msDoNotTrack
if (dnt === 1 || dnt === '1' || dnt === 'yes') {
return false
}
if ('msTrackingProtectionEnabled' in window.external) {
return !window.external.msTrackingProtectionEnabled()
@MWDelaney
MWDelaney / facetwp.php
Last active March 12, 2019 17:38
Rewrite the HTML output of radio buttons into a Bootstrap dropdown
<?php
// Adjust FacetWP "Radio" HTML output to be friendlier with our theme
add_filter('facetwp_facet_html', function ($output, $params) {
// Check that this facet is a "radio" type facet before proceeding.
if ('radio' == $params['facet']['type']) {
// Initialize our variables
$output = '';