Skip to content

Instantly share code, notes, and snippets.

@privatenumber
privatenumber / typescript-v5-to-v6.md
Created February 24, 2026 13:21
TypeScript 5.x to 6.0 Migration Guide

TypeScript 5.x to 6.0 Migration Guide

TypeScript 6.0 is a transition release bridging 5.9 and the forthcoming 7.0 (a native Go port). Most changes are new defaults and deprecations preparing for 7.0. Here is what you need to do:

Most projects need these tsconfig changes:

{
    "compilerOptions": {
        "types": ["node"],           // @types are no longer auto-discovered (see §1.6)
@Squix
Squix / tailwind_penpot_tokens.json
Last active January 31, 2026 01:46
TailwindCSS default theme design tokens for Penpot implementation. There are spacing, border-width, border-radius and sizing tokens.
{
"Global": {
"spacing-01": { "$value": "4px", "$type": "spacing", "$description": "p-1, m-1, ..." },
"spacing-02": { "$value": "8px", "$type": "spacing", "$description": "p-2, m-2, ..." },
"spacing-03": { "$value": "12px", "$type": "spacing", "$description": "p-3, m-3, ..." },
"spacing-04": { "$value": "16px", "$type": "spacing", "$description": "p-4, m-4, ..." },
"spacing-05": { "$value": "20px", "$type": "spacing", "$description": "p-5, m-5, ..." },
"spacing-06": { "$value": "24px", "$type": "spacing", "$description": "p-6, m-6, ..." },
"spacing-07": { "$value": "28px", "$type": "spacing", "$description": "p-7, m-7, ..." },
"spacing-08": { "$value": "32px", "$type": "spacing", "$description": "p-8, m-8, ..." },
@alexanderdavidsen
alexanderdavidsen / fetch-aws-spotprice.bash
Last active May 21, 2025 09:24
Bash script to fetch AWS spot pricing
#!/usr/bin/env bash
# Colors
BLUE='\033[0;34m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m' # No Color
BOLD='\033[1m'
@andreswebs
andreswebs / aws-ec2-ubuntu-desktop.md
Last active April 19, 2024 03:22
Set up a desktop environment accessible via RDP on an AWS EC2 instance running Ubuntu

add a non-root user with sudo permissions

(The username in this example is desktop.)

sudo addgroup --gid 2000 desktop
sudo adduser \
    --gid 2000 \
    --uid 2000 \
    --gecos "" \
@khalidx
khalidx / node-typescript-esm.md
Last active December 26, 2025 00:21
A Node + TypeScript + ts-node + ESM experience that works.

The experience of using Node.JS with TypeScript, ts-node, and ESM is horrible.

There are countless guides of how to integrate them, but none of them seem to work.

Here's what worked for me.

Just add the following files and run npm run dev. You'll be good to go!

package.json

@michal-kazmierczak
michal-kazmierczak / prometheus_metrics_management.json
Last active October 13, 2024 11:02
Prometheus Metrics Management
{
"__inputs": [
{
"name": "default",
"label": "default",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
@invictus-ir
invictus-ir / CloudTrail.csv
Last active October 10, 2025 15:40
An overview of CloudTrail events that are interesting from an Incident Response perspective
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 10 columns, instead of 9 in line 7.
"Initial Access","Execution","Persistence","Privilege Escalation","Defense Evasion","Credential Access","Discovery","Lateral Movement","Exfiltration","Impact"
ConsoleLogin,StartInstance,CreateAccessKey,CreateGroup,StopLogging,GetSecretValue,ListUsers,AssumeRole,CreateSnapShot,PutBucketVersioning
PasswordRecoveryRequested,StartInstances,CreateUser,CreateRole,DeleteTrail,GetPasswordData,ListRoles,SwitchRole,ModifySnapshotAttributes ,RunInstances
,Invoke,CreateNetworkAclEntry,UpdateAccessKey,UpdateTrail,RequestCertificate,ListIdentities,,ModifyImageAttribute,DeleteAccountPublicAccessBlock
,SendCommand,CreateRoute,PutGroupPolicy,PutEventSelectors,UpdateAssumeRolePolicy,ListAccessKeys,,SharedSnapshotCopyInitiated,
,,CreateLoginProfile,PutRolePolicy,DeleteFlowLogs,,ListServiceQuotas,,SharedSnapshotVolumeCreated,
,,AuthorizeSecurityGroupEgress,PutUserPolicy,DeleteDetector,,ListInstanceProfiles,,ModifyDBSnapshotAttribute,
,,AuthorizeSecurityGroupIngress,AddRoleToInstanceProfile,DeleteMembers,,ListBuckets,,PutBucketP
@lithdew
lithdew / main.ts
Last active May 11, 2023 06:31
deno (udp holepunching): basic stun client for fetching public-facing ip:port
// deno run -A --unstable main.ts
export const classToValue = {
request: 0x0000,
indication: 0x0010,
success: 0x0100,
failure: 0x0110,
};
export const methodToValue = {
@kfox
kfox / README.md
Last active September 23, 2025 07:02
TCP echo server for Node.js

TCP echo server for Node.js

Usage

  1. Make sure you have a modern-ish version of Node.js installed.
  2. Type npx https://gist.github.com/kfox/1280c2f0ee8324067dba15300e0f2fd3
  3. Connect to it from a client, e.g. netcat or similar: nc localhost 9000