Skip to content

Instantly share code, notes, and snippets.

@hackermondev
hackermondev / writeup.md
Last active December 26, 2025 10:15
How we pwned X (Twitter), Vercel, Cursor, Discord, and hundreds of companies through a supply-chain attack

hi, i'm daniel. i'm a 16-year-old high school senior. in my free time, i hack billion dollar companies and build cool stuff.

about a month ago, a couple of friends and I found serious critical vulnerabilities on Mintlify, an AI documentation platform used by some of the top companies in the world.

i found a critical cross-site scripting vulnerability that, if abused, would let an attacker to inject malicious scripts into the documentation of numerous companies and steal credentials from users with a single link open.

(go read my friends' writeups (after this one))
how to hack discord, vercel, and more with one easy trick (eva)
Redacted by Counsel: A supply chain postmortem (MDL)

@schickling
schickling / gist-content.md
Created August 28, 2025 10:42
Git Repository Lines of Code History Analyzer - Monthly LOC tracking with cloc and terminal visualization

Git Repository Lines of Code History Analyzer

A TypeScript script that analyzes the lines of code (LOC) growth of a Git repository month by month using cloc's git-aware functionality.

Features

  • 📈 Monthly LOC tracking over any time period
  • 🎯 Git-aware analysis - no need to checkout commits
  • 🚀 Language breakdown - see which languages grow over time
  • 📊 Terminal visualization with ASCII bar charts
tags level
best-practices
typescript
boolean
warn

Enforce Explicit Value Comparisons

Detects shorthand value usage patterns (implicit truthiness/falsiness checking) in JavaScript/TypeScript code. This rule helps identify places where explicit comparisons might be preferred for clarity and type safety. Common cases include checking for undefined/null, empty strings, zero values, and boolean states.

@Chronos2500
Chronos2500 / AllowsSwipeBack.Swift
Created May 16, 2025 17:59
This should be declared only once in the root view of the NavigationStack.
import SwiftUI
extension View {
/// Allows swipe back when navigation bar is hidden.
/// This modifier should be applied to a view that resides within a NavigationStack.
/// - Returns: A view that allows swipe back when navigation bar is hidden.
public func allowsSwipeBackWhenNavBarHidden() -> some View {
modifier( AllowsSwipeBackWhenNavBarHiddenModifier() )
}
}
@AnandChowdhary
AnandChowdhary / generate-changelog.ts
Last active July 18, 2025 10:11
Changelog automation
import slugify from "@sindresorhus/slugify";
import { execSync } from "child_process";
import dotenv from "dotenv";
import fs from "fs";
import { DateTime } from "luxon";
import { OpenAI } from "openai";
import path from "path";
import prettier from "prettier";
import { env } from "process";
@jlia0
jlia0 / agent loop
Last active December 28, 2025 16:47
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
import SwiftUI
//自作パッケージの切り出しなので変数名がめちゃくちゃです
//詳しくはこれの実装を見てください https://github.com/Chronos2500/CustomNavigationTitle
struct ContentView: View {
var body: some View {
NavigationStack{
ScrollView {
Color.blue.frame(height: 200)
@morajabi
morajabi / FPSCounter.swift
Created December 29, 2024 19:16
An FPS Counter for macOS apps built for inline.chat
import AppKit
import Charts
import CoreVideo
import SwiftUI
struct FPSMeasurement: Identifiable, Equatable {
let id: Int
let fps: Int
static func == (lhs: FPSMeasurement, rhs: FPSMeasurement) -> Bool {
@dena-sohrabi
dena-sohrabi / AppDatabase.swift
Created October 16, 2024 12:27
Encrypted Database (GRDB + SQLCipher)
import Foundation
import GRDB
// MARK: - DB main class
public final class AppDatabase: Sendable {
public let dbWriter: any DatabaseWriter
public init(_ dbWriter: any GRDB.DatabaseWriter) throws {
self.dbWriter = dbWriter
@morajabi
morajabi / FormState.swift
Last active October 16, 2024 12:28
Form state management in Swift UI
import SwiftUI
struct FormStateData {
var loading: Bool
var error: String?
var succeeded: Bool?
}
// A helper for easier state management for simple forms
class FormState: ObservableObject {