Skip to content

Instantly share code, notes, and snippets.

View thiskevinwang's full-sized avatar

Kevin Wang thiskevinwang

View GitHub Profile
@thiskevinwang
thiskevinwang / instructions.md
Created January 31, 2026 16:19
Codex CLI v0.93.0 Instructions

You are Codex, based on GPT-5. You are running as a coding agent in the Codex CLI on a user's computer.

General

  • When searching for text or files, prefer using rg or rg --files respectively because rg is much faster than alternatives like grep. (If the rg command is not found, then use alternatives.)

Editing constraints

  • Default to ASCII when editing or creating files. Only introduce non-ASCII or other Unicode characters when there is a clear justification and the file already uses them.
  • Add succinct code comments that explain what is going on if code is not self-explanatory. You should not add comments like "Assigns the value to the variable", but a brief comment might be useful ahead of a complex code block that the user would otherwise have to spend time parsing out. Usage of these comments should be rare.
@thiskevinwang
thiskevinwang / ._README.md
Last active July 12, 2024 17:15
cognito_test

Description

A .ts script to output information about a Cognito user pool. This uses the V3 JS client to call describe-user-pool

This is simply one means, amongst many, to fetch user pool info.

Setup

user@~: $ mkdir cognito_test
@thiskevinwang
thiskevinwang / main_test.go
Created November 17, 2023 13:45
go-bench
// benchmarking two flavors of logging
//
// run with `go test -benchmem -bench=.`
//
// Example output:
// ----------------------------------------------------------
// goos: darwin
// goarch: arm64
// pkg: go-benchmarks
// BenchmarkLogPlain-10 3548698 332.0 ns/op 64 B/op 2 allocs/op
@thiskevinwang
thiskevinwang / boost.js
Last active October 2, 2023 21:20
Arc Boost — Click to copy GitHub PR title as richtext link to Clipboard
function copyToClip(str) {
function listener(e) {
e.clipboardData.setData("text/html", str);
e.clipboardData.setData("text/plain", str);
e.preventDefault();
}
document.addEventListener("copy", listener);
document.execCommand("copy");
document.removeEventListener("copy", listener);
};
@thiskevinwang
thiskevinwang / Prompt.md
Last active September 29, 2023 00:17
$100 Password hack challenge

Sep 28, 2023 - $100 Password hack challenge

What is this?

Here is a simulated scenario where you are a hacker and you have gained access to a passwords database. For simplicity, there are only 2 rows.

...the bounty...

I (@thiskevinwang) will venmo $100 USD to the first person who can provide the password behind either of these two rows.

@thiskevinwang
thiskevinwang / lambda-node-code-that-streams.ts
Created May 17, 2023 13:09
lambda-node-code-that-streams
import util from "util";
import stream from "stream";
const { Readable } = stream;
const pipeline = util.promisify(stream.pipeline);
import { S3Client, GetObjectCommand } from "@aws-sdk/client-s3";
export const handler = awslambda.streamifyResponse(
async (event, responseStream, context) => {
const s3 = new S3Client({ region: "us-east-1" });
@thiskevinwang
thiskevinwang / test.js
Last active April 11, 2023 20:04
Semver Package
// run on runkit: https://runkit.com/embed/igg9vk09v684
const semver = require('semver')
semver.clean("v1.5.0-alpha20230405") // "1.5.0-alpha20230405"
semver.prerelease('v1.5.0-alpha20230405') // ["alpha20230405"]
semver.prerelease('v1.5.0-beta.1') // ["beta", 1]
semver.prerelease('v1.5.0-rc.1') // ["rc", 1]
semver.prerelease('v1.5.0-rc1') // ["rc1"]
@thiskevinwang
thiskevinwang / delete_github_environments.sh
Created April 1, 2023 13:12
Delete GitHub environments
#!bin/sh
# This script fetches GitHub environments and delets them
# - requires the `gh` CLI
# - requires `jq`
envs=$(gh api repos/{owner}/{repo}/environments --paginate | jq -r ".environments[].name")
for env in $envs
do
[ec2-user@ip-172-31-89-170]~% sudo yum repolist
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
repo id repo name status
!amzn2-core/2/aarch64 Amazon Linux 2 core repository 20,542
amzn2extra-docker/2/aarch64 Amazon Extras repo for docker 66
amzn2extra-kernel-5.10/2/aarch64 Amazon Extras repo for kernel-5.10 213
hashicorp/aarch64 Hashicorp Stable - aarch64 274
repolist: 21,095