Skip to content

Instantly share code, notes, and snippets.

@stephenlacy
stephenlacy / p4-fusion-macos-arm64.md
Created February 6, 2025 22:35
Running p4-fusion on macos arm64
git clone https://github.com/salesforce/p4-fusion
cd p4-fusion

brew install openssl cmake
wget https://cdist2.perforce.com/perforce/r24.1/bin.macosx12arm64/p4api-openssl3.tgz

mkdir -p vendor/helix-core-api/mac/

tar -xvzf p4api-openssl3.tgz --strip-components=1 -C vendor/helix-core-api/mac/
@stephenlacy
stephenlacy / how to make a new db in posgres.sql
Created January 16, 2025 22:25
because I need to google this each time...
-- Create the database
CREATE DATABASE your_database_name;
-- Create the user with a password
CREATE USER your_username WITH PASSWORD 'your_password';
-- Grant all current and future permissions on the database to the user
GRANT ALL PRIVILEGES ON DATABASE your_database_name TO your_username;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO your_username;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO your_username;
@stephenlacy
stephenlacy / README.md
Created November 12, 2024 22:42
Remove Reddit votes from /user/<username>/downvoted/ and /user/<username>/upvoted/

Remove Reddit upvotes and downvotes

  • Navigate to /user/<username>/downvoted/ or /user/<username>/upvoted/
  • Scroll the entire page loading posts in view.
  • Open your browser developer console.
  • Enter the script and run.
  • Reload the page and scroll to the bottom to load more.
@stephenlacy
stephenlacy / sync-git.sh
Created September 16, 2024 20:28
Sync a massive git repo from local to remote
TARGET_BRANCH='upstream/release'
BATCH_SIZE=10000
range=HEAD
git fetch $REMOTE $TARGET_BRANCH
# check if the branch exists on the remote
if git show-ref --quiet --verify refs/remotes/$REMOTE/$TARGET_BRANCH; then
# if so, only push the commits that are not on the remote already
@stephenlacy
stephenlacy / schema.ts
Created July 1, 2024 23:13
Using TypeIDs with Drizzle
export const apiKeys = mysqlTable(
"api_keys",
{
id: typeId("api_keys").primaryKey(),
organizationId: typeId("organizations", "organization_id").notNull(),
name: varchar("name", { length: 256 }),
prefix: varchar("prefix", { length: 256 }),
}
);

Keybase proof

I hereby claim:

  • I am stevelacy on github.
  • I am stevelacy (https://keybase.io/stevelacy) on keybase.
  • I have a public key ASCRiLTDs3sE_fZgD3q0CA_FvfdYLSiG8HoOSj1lMKa1Fgo

To claim this, I am signing this object: