Skip to content

Instantly share code, notes, and snippets.

View khalidx's full-sized avatar
💭
Engineering for the ☁️

Khalid Zoabi khalidx

💭
Engineering for the ☁️
View GitHub Profile
@khalidx
khalidx / tickets.md
Last active June 10, 2026 09:14
Thoughts on writing tickets and organizing work.

Tickets

Tip

If you only take away one thing from this document, it should be this:

Write a "press release" before you start any work.

The only thing that should be a ticket is something that is worthy of a press release. Otherwise, it's likely just a subtask of a larger ticket, and should be tracked as such.

This makes it clear to all participants the "story" of what we are trying to accomplish, and the benefits unlocked for our customers. It also makes it easier to understand and to prioritize our work, and to understand platform "features" we've shipped.

@khalidx
khalidx / package-security.md
Last active June 5, 2026 02:25
A thought about the security infrequently downloaded packages.

TLDR: This post highlights the importance of securing dependencies in the software supply chain.

What protects an organization from this behavior:

  1. A developer joins the organization as employee number 523,001
  2. The developer writes code for the organization on some work project
  3. The developer makes their own OSS package, outside of organization work, and publishes it to npm (or another registry)
  4. The developer installs their own npm package, to use on the organization's work project
  5. The package goes on to live undedected for years at the organization
@khalidx
khalidx / vscode-tmux.md
Last active July 2, 2025 19:03
How to use tmux when developing remotely with VSCode.

If you're using SSH with VSCode to develop on a remote server, this config will help you keep your terminal sessions around even if you are disconnected from the server.

This means you can log off and enjoy a coffee, and as long as your server is still up and running, you can connect back at any time and jump back into your terminal as you left it.

Start a session

tmux
@khalidx
khalidx / iam-read-only.md
Last active May 12, 2025 17:13
An AWS CloudFormation Template for creating a read/view-only IAM user with programmatic (CLI) access.

Read/View-Only User for AWS Account Analysis

An AWS CloudFormation Template for creating a read/view-only IAM user with programmatic (CLI) access.

Tip

This is useful for conducting a more complete analysis and inventorying of an AWS account.

The AWS IAM Role created in this CloudFormation Stack is similar to the following:

  • The AWS [ReadOnlyAccess] Managed Policy
@khalidx
khalidx / codespace-url.md
Created May 8, 2025 04:21
How to build the URL that a GitHub Codespace will use for a port.

Tip

In a Codespace, we have access to the CODESPACE_NAME and the GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN environment variables.

We can use these variables to build the corresponding URL that will be used when forwarding a port in GitHub Codespaces.

Here's how we can build the URL for the forwarded port 80:

@khalidx
khalidx / docker-apt-install.md
Created March 26, 2025 05:02
Docker Apt Install
FROM ubuntu:noble

# Install necessary packages
RUN apt update
RUN apt install -y <package-name>
RUN rm -rf /var/lib/apt/lists/*
@khalidx
khalidx / co-founder-matching.md
Created May 17, 2024 19:30
A template to use when meeting with a potential co-founder.

This is a general guideline for your first meeting with a potential co-founder.

Just replace any {variable} with information about you, your guest, or your startup.

Co-Founder Matching Template

Intro Call

Co-Founder Matching Call with {Guest} on {Date}

@khalidx
khalidx / nextjs-nested-matcher.md
Last active April 22, 2024 18:36
Match nested page routes in Next.js middleware.

Description

Next.js doesn't seem to protect routes that use getServerSideProps().

How can you protect endpoints like:

/_next/data/*/*/something.json

Is this a bug? You can get 50% of the way there with middleware, but the middleware doesn't run on /_next/data/ unless you configure it to.

@khalidx
khalidx / npm-script-globstar.md
Last active June 10, 2026 09:17
Fixing the issue with globstar paths (**/*) not working when running an npm script.

🚧 Issue Description

If you've ever run a script like npm run test from your package.json:

{
  "scripts": {
    "test": "node --test src/**/*.test.js"
  }
}
@khalidx
khalidx / new-golang-cli.md
Created November 29, 2023 07:05
Creating a new Go CLI application.

Replace <FirstName>, <LastName>, and <Email> with your information.

mkdir ./cli/ && cd ./cli/
go install github.com/spf13/cobra-cli@latest
cobra-cli init --author "<FirstName> <LastName> <Email>" --license MIT --viper
go mod tidy