Skip to content

Instantly share code, notes, and snippets.

View Andrew-Chen-Wang's full-sized avatar
🐢
herro

Andrew Chen Wang Andrew-Chen-Wang

🐢
herro
View GitHub Profile
@Andrew-Chen-Wang
Andrew-Chen-Wang / README.md
Last active September 19, 2025 07:13
Downsides of Pulumi

Currently, I'm working with Pulumi; here's a list of downsides.

  • One thing that I noticed is a problem compared to a static configuration file like Terraform is that the destruction of resources is not in order. For instance, if I wanted to get rid of AWS Route53 records but some already existed, Pulumi would first create rather than destroy. In Route53, a single record type can only be defined once per name/host. This became a problem where I had to manually destroy the records first.
  • Support is lacking due to a lack of a community
  • Things don't work sometimes, and it's hard to debug (I'm basically facing the same issues as https://aws.plainenglish.io/why-we-abandoned-pulumi-after-3-months-and-went-back-to-terraform-03539d1859c1)

Terraform comparison:

@Andrew-Chen-Wang
Andrew-Chen-Wang / private_fork.md
Created September 11, 2025 05:34 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare [email protected]:usi-systems/easytrace.git

abandoned
able
absolute
adorable
adventurous
academic
acceptable
acclaimed
accomplished
accurate
@Andrew-Chen-Wang
Andrew-Chen-Wang / uuid8_excluding_day_precision.py
Created April 13, 2025 18:47
UUIDv7 variant with v8 with a timestamp that excludes the day
import uuid
import random
from datetime import datetime, UTC
def encode_time_fields(dt: datetime) -> int:
year = dt.year
month = dt.month
hour = dt.hour
minute = dt.minute
millisecond = dt.microsecond // 1000
@Andrew-Chen-Wang
Andrew-Chen-Wang / pagination.ts
Last active January 7, 2025 22:28
Kysely Cursor Paginator
import { SelectQueryBuilder } from "kysely";
import { DB } from "db";
/*
// From kysely-codegen
export type Generated<T> = T extends ColumnType<infer S, infer I, infer U>
? ColumnType<S, I | undefined, U>
: ColumnType<T, T | undefined, T>;
export type Int8 = ColumnType<string, bigint | number | string, bigint | number | string>;
@Andrew-Chen-Wang
Andrew-Chen-Wang / README.md
Created December 29, 2024 21:51 — forked from mbleigh/README.md
Firebase Hosting Fetch All Files

Fetch All Files from Firebase Hosting

This script fetches all of the files from the currently deployed version of a Firebase Hosting site. You must be signed in via the Firebase CLI and have "Site Viewer" permission on the site in question to be able to properly run the script.

Running via NPX

npx https://gist.github.com/mbleigh/9c8680cf319ace2f506f57380da66e7d <site_name>
@Andrew-Chen-Wang
Andrew-Chen-Wang / openai.py
Last active December 3, 2024 15:30
Parallel calling OpenAI with rate limit handling
"""
Created by: @Andrew-Chen-Wang
Parallel calling OpenAI with rate limit handling.
Required packages:
- openai
- tenacity (optional if you remove the decorators. Useful for 500 errors)
Usage:
You must call with with_raw_response to get rate limit headers like:
@Andrew-Chen-Wang
Andrew-Chen-Wang / remove_attrs.py
Created January 27, 2024 06:48 — forked from revotu/remove_attrs.py
remove all HTML attributes with BeautifulSoup except some tags(<a> <img>...)
from bs4 import BeautifulSoup
# remove all attributes
def _remove_all_attrs(soup):
for tag in soup.find_all(True):
tag.attrs = {}
return soup
# remove all attributes except some tags
def _remove_all_attrs_except(soup):
@Andrew-Chen-Wang
Andrew-Chen-Wang / Listmonk-tutorial.md
Created January 22, 2024 21:11 — forked from MaximilianKohler/Listmonk-tutorial.md
Complete Listmonk setup guide. Step-by-step tutorial for installation and all basic functions. Amazon EC2 & SES

Listmonk setup and usage guide

When I first set up Listmonk it was to use with Amazon SES. At the time Amazon would give you free 62,000 emails/mo if you sent them from an EC2 instance. So EC2 was the best server to use. In mid 2023 Amazon ended that, so now you can use whatever server you like, which makes things much easier. It shouldn't be too hard to convert these directions to another server host of your choice.

I used Hetzner with another build, and once my free EC2 year ended the AWS t2.micro cost me $14/mo. Hetzner has better specs and costs me $5/mo, so I added an nginx vhost and moved listmonk to the same server. Here's a $20 credit for Hetzner.

There is also the possibility to use the 1-click installers for their featured hosts: https://listmonk.app/ - listed under "Hosting providers". I'm not familiar with any of them but there are lots of new guides

@Andrew-Chen-Wang
Andrew-Chen-Wang / Debug React with Breakpoints with JetBrain IDE.md
Created September 12, 2023 07:52
Debugging React with Breakpoints using PyCharm/WebStorm/JetBrain IDE

How To: Debug React with Breakpoints with JetBrain IDE

Overview

Tired of writing console.log when debugging React? Want to use a debugger with breakpoints, stopping React and taking the time to analyze variables?

Welcome to adding a debugger for frontend development:)

Pre-requisite