Skip to content

Instantly share code, notes, and snippets.

View ruie's full-sized avatar
🛠️

Ruie Dela Peña ruie

🛠️
View GitHub Profile
@ruie
ruie / 01-update-docs.md
Created June 15, 2025 13:08 — forked from badlogic/01-update-docs.md
Yakety Documentation (Ordered) - LLM-optimized docs with concrete file references

Update Documentation

You will generate LLM-optimized documentation with concrete file references and flexible formatting.

Your Task

Create documentation that allows humans and LLMs to:

  • Understand project purpose - what the project does and why
  • Get architecture overview - how the system is organized
  • Build on all platforms - build instructions with file references
@ruie
ruie / cloudflare-purge-cache-service-worker.js
Created June 5, 2025 03:52 — forked from vdbelt/cloudflare-purge-cache-service-worker.js
A CloudFlare service worker that proxies purge cache requests. Example: https://example.com/__purge_cache?zone=XX
addEventListener('fetch', event => {
event.respondWith(purgeCache(event.request))
})
async function purgeCache(request) {
const url = new URL(request.url)
---
description:
globs:
alwaysApply: true
---
At the end of each task, you need to write all changes to ARCHITECTURE.md.
And by write all changes, I mean modify the architecture of the entire app. If you've changed a function - modify its params/output or whatever you changed.
If you've added a new file - add it to the ARCHITECTURE.md.
@ruie
ruie / capture.sh
Created April 20, 2025 17:18 — forked from sixteenmillimeter/capture.sh
Capture a livestream using youtube-dl and ffmpeg.
#!/bin/bash
#################################
# Instructions
#
# First, install ffmpeg and youtube-dl
#
# https://ffmpeg.org/download.html
# https://ytdl-org.github.io/youtube-dl/download.html
#
@ruie
ruie / mdc.mdc
Created March 8, 2025 09:26 — forked from patelnav/mdc.mdc
MDC file to help generate MDC files
---
description: Guidelines and best practices for creating .mdc (Markdown Configuration) files in Cursor, including structure, metadata annotations, and formatting rules
globs: ["**/*.mdc"]
---
# Cursor MDC File Guidelines
@context {
"type": "documentation",
"purpose": "cursor_rules",
@ruie
ruie / index.js
Created September 20, 2024 06:28 — forked from geecko86/index.js
Handmade load balancer for Cloudflare Workers
const europe = ["AMS", "ATH", "BCN", "BEG", "TXL", "BRU", "OTP", "BUD", "KIV", "CPH", "DUB", "DUS", "EDI", "FRA", "GVA", "GOT", "HAM", "HEL", "IST", "KBP", "LIS", "LHR", "LUX", "MAD", "MAN", "MRS", "MXP", "DME", "MUC", "LCA", "OSL", "CDG", "PRG", "KEF", "RIX", "FCO", "LED", "SOF", "ARN", "TLL", "SKG", "VIE", "VNO", "WAW", "ZAG", "ZRH"];
const africa = ["CAI", "CMN", "CPT", "DAR", "JIB", "DUR", "JNB", "LOS", "LAD", "MPM", "MBA", "MRU", "RUN", "KGL"];
const asia = ["BKK", "CEB", "CTU", "MAA", "CMB", "SZX", "FUO", "FOC", "CAN", "HGH", "HAN", "HNY", "SGN", "HKG", "HYD", "ISB", "TNA", "KHI", "KTM", "KUL", "LHE", "NAY", "LYA", "MFM", "MNL", "BOM", "NNG", "DEL", "KIX", "PNH", "TAO", "ICN", "SHA", "SHE", "SJW", "SIN", "SZV", "TPE", "TSN", "NRT", "ULN", "WUH", "WUX", "XIY", "EVN", "CGO", "CSX"];
const latinAmerica = ["ASU", "BOG", "EZE", "CWB", "FOR", "LIM", "MDE", "MEX", "PTY", "POA", "UIO", "GIG", "GRU", "SCL", "CUR"];
const middleEast = ["AMM", "BGW", "GYD", "BEY", "DOH", "DXB", "KWI", "BAH", "MCT", "ZDM", "RUH", "
@ruie
ruie / README.md
Created September 20, 2024 06:26 — forked from jahands/README.md
Count requests for every IP to CountAPI.xyz using Cloudflare Workers

I created this in order to count how many requests each IP is using, without sending personal data to CountAPI.xyz To accomplish this, I used Workers KV to map the IP address to a random UUID, which is used as the identifier on CountAPI.

Here's an example of what's stored in workers KV, with the user's IP as the key:

{
    "userID": "5e64db68-d628-4938-9c01-0968a2f76861",
    "userIP": "1.2.3.4",
    "firstSeenDate": "2020-05-11T02:12:16.377Z",
@ruie
ruie / gist:758f8f6e0032055a15ad8f5ddfb686ae
Last active September 15, 2024 23:44
SST Job Handlers
# job_handler.py
def handler(...args):
EventBus.emit('job.start', { job_id, details, etc })
try:
# Job does work
EventBus.emit('job.progress', { job_id, details, etc }) # replace 'progress' with your preferred noun
# Jobs Done
@ruie
ruie / script.js
Created July 1, 2024 23:43 — forked from luighifeodrippe/script.js
Download a JSON List of twitter bookmarks
/* Enhancements to the Twitter Scraping Script:
This update to the script introduces a more robust mechanism for extracting detailed interaction data from tweets as they are scraped from Twitter. Previously, the script focused on collecting basic content such as the tweet's text. Now, it has been augmented to include a comprehensive extraction of interaction metrics, including replies, reposts, likes, bookmarks, and views, for each tweet.
Key Changes:
1. Improved Data Extraction:
- The script now searches through all elements within a tweet that have an `aria-label` attribute, filtering for labels that contain key interaction terms (replies, reposts, likes, bookmarks, views). This ensures that only relevant `aria-labels` are considered for data extraction.
2. Flexible Interaction Data Parsing:
@ruie
ruie / index.tsx
Created July 1, 2024 23:42 — forked from m5r/index.tsx
bullmq job queue in Remix
import notifierQueue from "~/queues/notifier.server.ts";
export const loader = async () => {
await notifierQueue.add("test", { emailAddress: "mokhtar@remixtape.dev" });
return null;
};