Skip to content

Instantly share code, notes, and snippets.

View CatChen's full-sized avatar

Cat Chen CatChen

View GitHub Profile
let originalTitle = document.title;
setInterval(() => {
const overriddenTitle = document.querySelector('.page-header .profile-image-text .title-2-emphasis')?.innerText;
if (overriddenTitle && !originalTitle) {
originalTitle = document.title;
document.title = overriddenTitle;
}
if (!overriddenTitle && originalTitle) {
document.title = originalTitle;
originalTitle = undefined;
@CatChen
CatChen / gist:01091248e173903e7afbff849ab0b174
Created January 26, 2025 18:55
6-Recipe Dynamic Factory
0eNrtHdtu47rxVwS9dE+PHFgSKUsB9gCLLVoUaHEWiYE+nF0YskzHQmTJR5fs+izyAf2LvvTH+iWdIamLbdm6+LLZrF+SCUXODOfG4ZBSvqrTIGOr2A9T9farOmOJF/ur1I9C9VZ9H4Uh81IljqZRuoriVEkjJV0wJcmmSepiL/gzjrKHhfIQMxYqn/2Y3aia6ntRmKi3v31VE/8hdAPEHbpLBkjdJGHLaeCHD4Ol6y38kA1M9RmGhDP2Rb3Vn7XqoHS9wkFPfpxm0KLlWESPgVUZaXQa6YbrFIg/VBCYz580lYWpn/pMMM//WE/CbDllMfBWIikEAIhXUeILiX1VcQbU0NS1eutY1jOytIXEKJDMmOfPWDzwouXUD900imuQWSOJbHRDgdUZCNgTz3XABGJO4yiYTNnCffIBAdchRzuBZzOOKsHW6l8ws7kfJ+mktbTuUUwJQyTtB31Qn1GiUZausnTbGpoJPn8C8amrwF3DZLYMc+0Fvqd4QeQ9ggW6YKJZmCjzOFoqQzTSDwNdrZG9WZBB+0zdMG0Qvn1DN8RfJ+9EKCTZhGGyuUVrIO0gZfF2a6MINPV3eAATgMYwipe8EzC8cmPO8K36ljdk6LzccXJX0Jp10w25PRyCPvZr5IMyY3Pw5YTHh9T3HhNlytLPGBQEyQT1kq1mbsoUsGF/xYS+PDfwsoD70k2dzkg7pxsNDzkd7ar4Ya740fD0ipesoKSXDJ4Pht204Tibut7Bp3fDZ9sVfGYNPqMbvtGogo/U4DO74QOdlvhoDT7SDR+lFXxWDT7aDR8h4BkbGunl8HcdffKwR95teKRwBCWag28uoc3NfTBkbMZdM2YrBoF0yuZRzISjwvK4z1UV98H16x22FGjMfs9YggL1FvC7zs/0ws/0vX7m+bGX+elkGc3YJJpPohWLXbkGasXTYoGbsNCdBmym3s4h6jBAKvmYFFrZ46+4WhV9YcKTaTaf8wFpnLG6uDIq5uoCvic2WMXRk1jU983Y2JhxDU67TBD
@CatChen
CatChen / browserlist.yml
Created July 7, 2023 05:37
GitHub Actions Workflow for Updating browserlist db
name: Update browserslist
on:
schedule:
- cron: '0 0 1 */3 *'
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
@CatChen
CatChen / mailchimp-popup-on-click-event.html
Last active September 17, 2019 07:11
MailChimp Popup on Click Event
<script type="text/javascript" src="//downloads.mailchimp.com/js/signup-forms/popup/unique-methods/embed.js" data-dojo-config="usePlainJson: true, isDebug: false"></script>
<script type="text/javascript">
function displayDialog() {
document.cookie = "MCPopupClosed=; path=/; expires=Thu, 01 Jan 1970 00:00:00 UTC";
document.cookie = "MCPopupSubscribed=; path=/; expires=Thu, 01 Jan 1970 00:00:00 UTC";
window.dojoRequire(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us18.list-manage.com","uuid":"a7af3978c0ebeaff2b102af2f","lid":"68a7bcc816","uniqueMethods":true}) });
}
</script>
<script type="text/javascript">
if (document.querySelectorAll) {
set theRecipients to {{name:"Cat Chen", email:"catchen@catchen.me"}, {name:"Roli Chen", email:"roli@chen.cat"}, {name:"Elle Chen", email:"elle@chen.cat"}}
set theAttachment to (choose file with prompt "Select file for attachment...")
tell application "Mail"
repeat with theRecipient in theRecipients
set theMessage to make new outgoing message with properties {visible:true, subject:"Email with File Attachment", content:"Hi " & name of theRecipient & "," & linefeed & linefeed & "Check out the attachment in this email!" & linefeed & linefeed}
tell theMessage
make new to recipient at end of to recipients with properties {name:name of theRecipient, address:email of theRecipient}
make new attachment at end of last character of content with properties ¬
{file name:theAttachment}
end tell
@CatChen
CatChen / debug.jade
Created August 24, 2018 11:47
Jade debug partial for printing out any compile time data
// Usage:
// != partial('debug', { data: anything })
if environment !== 'production'
script
| console.log(!{JSON.stringify(data)});

Keybase proof

I hereby claim:

  • I am catchen on github.
  • I am catchen (https://keybase.io/catchen) on keybase.
  • I have a public key whose fingerprint is 3F72 245D 1270 2FB4 ACFE DFC1 7CF3 C8DB D257 32AD

To claim this, I am signing this object: