Skip to content

Instantly share code, notes, and snippets.

@jlia0
jlia0 / agent loop
Last active April 25, 2025 02:21
Manus tools and prompts
You are Manus, an AI agent created by the Manus team.
You excel at the following tasks:
1. Information gathering, fact-checking, and documentation
2. Data processing, analysis, and visualization
3. Writing multi-chapter articles and in-depth research reports
4. Creating websites, applications, and tools
5. Using programming to solve various problems beyond development
6. Various tasks that can be accomplished using computers and the internet
@t3dotgg
t3dotgg / try-catch.ts
Last active April 25, 2025 02:13
Theo's preferred way of handling try/catch in TypeScript
// Types for the result object with discriminated union
type Success<T> = {
data: T;
error: null;
};
type Failure<E> = {
data: null;
error: E;
};
@JamesSedlacek
JamesSedlacek / View+OpenUrl.swift
Last active April 19, 2025 21:50
This file provides a safe way to open URLs in SwiftUI applications.
//
// View+OpenUrl.swift
//
// Created by James Sedlacek on 11/26/24.
//
/// This file provides a safe way to open URLs in SwiftUI applications.
/// It adds a view modifier that handles URL opening with user confirmation
/// and multiple opening options (browser, in-app, or copy to clipboard).
///
@hackermondev
hackermondev / zendesk.md
Last active April 24, 2025 04:34
1 bug, $50,000+ in bounties, how Zendesk intentionally left a backdoor in hundreds of Fortune 500 companies

hi, i'm daniel. i'm a 15-year-old with some programming experience and i do a little bug hunting in my free time. here's the insane story of how I found a single bug that affected over half of all Fortune 500 companies:

say hello to zendesk

If you've spent some time online, you’ve probably come across Zendesk.

Zendesk is a customer service tool used by some of the world’s top companies. It’s easy to set up: you link it to your company’s support email (like [email protected]), and Zendesk starts managing incoming emails and creating tickets. You can handle these tickets yourself or have a support team do it for you. Zendesk is a billion-dollar company, trusted by big names like Cloudflare.

Personally, I’ve always found it surprising that these massive companies, worth billions, rely on third-party tools like Zendesk instead of building their own in-house ticketing systems.

your weakest link

@VikParuchuri
VikParuchuri / algo.md
Created October 13, 2023 16:19
Sample textbooks

1. Algorithm Design and Analysis

One important aspect of algorithm design is problem-solving strategies. This involves breaking down a complex problem into smaller, more manageable subproblems. By solving these subproblems, we can then combine their solutions to solve the original problem. This approach is known as the divide-and-conquer method.

Another important aspect of algorithm design is understanding the time and space complexity of an algorithm. Time complexity refers to the amount of time an algorithm takes to run, while space complexity refers to the amount of memory an algorithm requires. By analyzing the time and space complexity of an algorithm, we can determine its efficiency and scalability.

For example, let's consider the problem of finding the largest number in a list. One possible algorithm is to iterate through the list and keep track of the largest number encountered so far. This algorithm has a time complexity of O(n), where n is the size of the list. This means that the algorithm's

@veekaybee
veekaybee / normcore-llm.md
Last active April 24, 2025 23:55
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@LunaticMuch
LunaticMuch / userjwtJose.js
Created February 4, 2023 12:11
Token generation with jose
import {SignJWT, jwtVerify, type JWTPayload} from 'jose';
export async function sign(payload: Token, secret: string): Promise<string> {
const iat = Math.floor(Date.now() / 1000);
const exp = iat + 60* 60; // one hour
return new SignJWT({...payload})
.setProtectedHeader({alg: 'HS256', typ: 'JWT'})
.setExpirationTime(exp)
.setIssuedAt(iat)
@breadthe
breadthe / sd.sh
Created September 2, 2022 17:56
Stable Diffusion prompt script
#!/bin/bash
echo -n "Enter a prompt: "
read prompt
echo -n "Steps (default 10): "
read steps
if [[ -z "$steps" ]]; then
steps=10
@evilpete
evilpete / gen_url_nfc.py
Last active January 9, 2024 03:06
Script to Generate Flipper NFC "save" file encoded with URL
Relocated to https://github.com/evilpete/flipper_toolbox
"""
Generates NFC with URL address data and outputs Flipper NFC "save" file
this is a 5 min hack, No Guarantees
python3 gen_url_nfc.py https://youtu.be/dQw4w9WgXcQ "Rick Roll". > rickroll.nfc
requires ndeflib
"""
@xiaopc
xiaopc / gaWorker.js
Last active November 12, 2024 14:52
Google Analytics 4 Proxy with Cloudflare Workers
// 2023.4.23 更新,修复 gtag.js 加了个回车导致失效的问题
// 2023.3.2 更新,修复上报到 region*.google-analytics.com 未被代理的问题
addEventListener('fetch', (event) => {
// 这里可以加 filter
return event.respondWith(handleRequest(event));
});
// worker 应用的路由地址,末尾不加 '/'
const DOMAIN = 'https://example.workers.dev/routerpath';