Skip to content

Instantly share code, notes, and snippets.

View aidenybai's full-sized avatar

Aiden Bai aidenybai

View GitHub Profile
@MinSomai
MinSomai / scalable-scraping-puppeteer-cluster.js
Last active February 23, 2025 15:49
scalable scraping with puppeteer-cluster.
// Code structure
// app.js
// router.js
// controller.js
// service.js
// implementation
// This is hosted in aws Fargate. And this is the rough worst case calculation on the resource usage.
// Fargate configuration:
@asportnoy
asportnoy / q.fish
Last active May 9, 2023 20:02
GitHub Copilot CLI for Fish Shell
# Requires the GitHub Copilot CLI from GitHub Next
# https://www.npmjs.com/package/@githubnext/github-copilot-cli#installation-and-setup
# This needs to be set up as a function in your fish config. You can use `funced -s q` to do this.
# Options:
# q -g --git: Use github-copilot-cli git-assist
# q -h --gh: Use github-copilot-cli gh-assist
# Defaults to using what-the-shell (general command assist) if neither option is provided
# Completions for your Fish config:
@b0gdanw
b0gdanw / Disable-Ventura-Bloatware.sh
Last active April 25, 2025 22:12
Disable Ventura Bloatware
#!/bin/zsh
# Credit: Original idea and script disable.sh by pwnsdx https://gist.github.com/pwnsdx/d87b034c4c0210b988040ad2f85a68d3
# Disabling unwanted services on macOS Big Sur (11), macOS Monterey (12) and macOS Ventura (13)
# Disabling SIP is required ("csrutil disable" from Terminal in Recovery)
# Modifications are written in /private/var/db/com.apple.xpc.launchd/ disabled.plist, disabled.501.plist
# To revert, delete /private/var/db/com.apple.xpc.launchd/ disabled.plist and disabled.501.plist and reboot; sudo rm -r /private/var/db/com.apple.xpc.launchd/*
# user
@yaroslav
yaroslav / nuke-google-keystone.sh
Created December 14, 2020 11:06
Nuke Google Keystone without removing Google Chrome
sudo rm -R ~/Library/Google/GoogleSoftwareUpdate/
sudo touch ~/Library/Google/GoogleSoftwareUpdate
sudo chmod 444 ~/Library/Google/GoogleSoftwareUpdate
sudo rm ~/Library/LaunchAgents/com.google.keystone.agent.plist
sudo rm ~/Library/LaunchAgents/com.google.keystone.xpcservice.plist
sudo rm ~/Library/Preferences/com.google.Keystone.Agent.plist
sudo rm -R ~/Library/Caches/com.google.Keystone*
# reboot.
# use brew cask to install and update google-chrome.
@faressoft
faressoft / dom_performance_reflow_repaint.md
Last active May 8, 2025 01:33
DOM Performance (Reflow & Repaint) (Summary)

DOM Performance

Rendering

  • How the browser renders the document
    • Receives the data (bytes) from the server.
    • Parses and converts into tokens (<, TagName, Attribute, AttributeValue, >).
    • Turns tokens into nodes.
    • Turns nodes into the DOM tree.
  • Builds CSSOM tree from the css rules.
@Rich-Harris
Rich-Harris / service-workers.md
Last active May 3, 2025 12:49
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.