Skip to content

Instantly share code, notes, and snippets.

View 0thernet's full-sized avatar
🌀
𓊍

Ben Guo 0thernet

🌀
𓊍
View GitHub Profile
@0thernet
0thernet / plan.md
Last active February 4, 2026 16:50
planning prompt

When asked to write a plan, examine the existing plan file for any existing material (it may contain an outline or notes from the user, or a previous revision of the plan). Use the existing material as the foundation for your proposal.

Describe the specific code changes required concisely, with minimal surrounding prose. Design the code changes so that they can be implemented incrementally. Do not break up the changes too much: there should generally be two or three phases of work that logically go together, and can be stacked on each other.

Any new or changed interfaces in your planned code should be well-typed, self-documenting, and self-consistent with surrounding code. If there are existing naming conventions, follow them. If you're creating a new file that contains a single method, the filename should match the method name (following our kebab-case convention in ts/tsx and snake_case in py). Method, parameter, and field names should be terse-but-descriptive, idiomatic to the language, and consistent wi

@0thernet
0thernet / sysprompts.txt
Last active August 4, 2025 15:32
ai coding prompts, jul 2025
# system prompt (always applied)
<who_you_are>
You are a superintelligent autonomous AGENT.
You are assisting a USER in the context of a CONVERSATION represented as a chronological series of EVENTS.
You have been trained on a vast amount of data from the entire history of human activity on the internet up to this date. You have a deep capacity to find answers to many subjects inside your training data.
Your training data knowledge cutoff date is 2024-01-01.
You are a relentless truth-seeker. If you are not sure about file content or factual information pertaining to the USER's request (for example, if it requires information PAST your training data knowledge cutoff date, or the information is not available in the EVENTs of the CONVERSATION), you MUST use your tools to gather the relevant information: do NOT guess or make up an answer.
</who_you_are>
@0thernet
0thernet / python.mdc
Created April 23, 2025 19:13
python cursorrule
---
description:
globs: *.py
alwaysApply: false
---
# Writing modern Python: style guide
## For-else statements
If you ever need to check if a for loop completes without a break, for-else statements are a great way to accomplish this without using a temporary variable.
from playwright.sync_api import sync_playwright
from bs4 import BeautifulSoup
import json
from urllib.parse import quote
def scrape_github_folders():
with sync_playwright() as p:
browser = p.chromium.launch()
page = browser.new_page()
//
// PFTrendsViewModel.m
// SUM
//
// Created by Ben Guo on 11/26/14.
// Copyright (c) 2014 Project Florida. All rights reserved.
//
#import "PFTestUtilities.h"
#import "PFTrendsViewModel.h"
// before
func formattedAddress() -> String {
let lines:NSMutableArray = NSMutableArray(capacity: 4)
let zipStateCityArgs:NSMutableArray = NSMutableArray(capacity: 3)
let zip = self.stringValueForKeyPath("address_zip")
let city = self.stringValueForKeyPath("address_city")
let state = self.stringValueForKeyPath("address_state")
for arg in [zip, city, state] {
@0thernet
0thernet / enumFrom.swift
Last active August 29, 2015 14:24
enumFrom
protocol StringDecodable {
init?(string: String)
}
extension Dictionary where Key: JSONKey, Value: AnyObject {
/// Converts a string to an enum value
func enumFrom<T: StringDecodable>(key: Key, _ enumType: T.Type) -> T? {
if let s = self[key] as? String {
return enumType.init(string: s)
}
import Cocoa
protocol Pet {
var name : String { get }
func renamed(newName: String) -> Self
}
struct Fish : Pet {
let name : String
func renamed(newName: String) -> Fish {
@0thernet
0thernet / Spotify.xml
Created April 10, 2015 03:51
/Applications/Spotify.app/Contents/Resources/Spotify.sdef
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dictionary SYSTEM "file://localhost/System/Library/DTDs/sdef.dtd">
<dictionary title="Dictionary">
<suite name="Spotify Suite" code="spfy" description="Spotify specific classes.">
<enumeration name="ePlS" code="ePlS">
<enumerator name="stopped" code="kPSS">
<cocoa integer-value="0"/>
</enumerator>
<enumerator name="playing" code="kPSP">
<cocoa integer-value="1"/>