Skip to content

Instantly share code, notes, and snippets.

View steipete's full-sized avatar

Peter Steinberger steipete

View GitHub Profile
goal: address PR comments
- get PR comments
```bash
# Find PR for current branch
gh pr list --head $(git branch --show-current) | cat
# Get inline comments (most important)
gh api repos/:owner/:repo/pulls/PR_NUMBER/comments --jq '.[] | {author: .user.login, body: .body, path: .path, line: .line}' | cat
@steipete
steipete / windsurf-auto-continue.js
Last active May 14, 2025 12:37
Windsurf Auto Continue press button JS. Windsurf Menu Help -> Toggle Developer Tools -> Paste into Console.
// Windsurf Auto Press Continue v13.2 (with added logging)
(() => {
const SCRIPT_NAME = 'Windsurf Auto Press Continue v13.2 (logged)'; // Updated name for clarity
let intervalId = null, lastClick = 0;
// --- Config ---
const BTN_SELECTORS = 'span[class*="bg-ide-button-secondary-background"]';
const BTN_TEXT_STARTS_WITH = 'continue';
const SIDEBAR_SELECTOR = null;
const COOLDOWN_MS = 3000;
@stephancasas
stephancasas / UnsafeCGWindowListCreateImage.swift
Created March 10, 2025 23:26
Warning-free bindings for the legacy CoreGraphics screenshot/window-capture functions.
//
// UnsafeCGWindowListCreateImage.swift
//
// Created by Stephan Casas on 3/10/25.
//
import Foundation
import CoreGraphics
func UnsafeCGWindowListCreateImage(
@available(iOS 15.0, *)
public struct RichTextEditor : SwiftUICore.View {
public init(text: SwiftUICore.Binding<Foundation.AttributedString>)
@_Concurrency.MainActor @preconcurrency public var body: some SwiftUICore.View {
get
}
@available(iOS 15.0, *)
public typealias Body = @_opaqueReturnTypeOf("$s7SwiftUI14RichTextEditorV4bodyQrvp", 0) __
}
@available(*, unavailable)
@Maharshi-Pandya
Maharshi-Pandya / contemplative-llms.txt
Last active June 4, 2025 06:19
"Contemplative reasoning" response style for LLMs like Claude and GPT-4o
You are an assistant that engages in extremely thorough, self-questioning reasoning. Your approach mirrors human stream-of-consciousness thinking, characterized by continuous exploration, self-doubt, and iterative analysis.
## Core Principles
1. EXPLORATION OVER CONCLUSION
- Never rush to conclusions
- Keep exploring until a solution emerges naturally from the evidence
- If uncertain, continue reasoning indefinitely
- Question every assumption and inference
@juliensagot
juliensagot / VariableBlurView.swift
Last active April 15, 2025 21:17
SwiftUI variable blur view
import Foundation
import SwiftUI
import UIKit
extension UIBlurEffect {
public static func variableBlurEffect(radius: Double, imageMask: UIImage) -> UIBlurEffect? {
let methodType = (@convention(c) (AnyClass, Selector, Double, UIImage) -> UIBlurEffect).self
let selectorName = ["imageMask:", "effectWithVariableBlurRadius:"].reversed().joined()
let selector = NSSelectorFromString(selectorName)
@stephancasas
stephancasas / NSApplication+openSettings.swift
Last active May 30, 2025 22:51
An extension enabling global access to settings scene of a macOS SwiftUI application.
//
// NSApplication+openSettings.swift
//
// Created by Stephan Casas on 12/3/23.
//
import SwiftUI;
fileprivate let kAppMenuInternalIdentifier = "app"
fileprivate let kSettingsLocalizedStringKey = "Settings\\U2026";
@Tunous
Tunous / SwiftUIView.swift
Created November 9, 2022 14:55
SwiftUI view wrapper for UIKit that calculates its size
import SwiftUI
final class SwiftUIView<Content: View>: UIView {
private var heightConstraint: NSLayoutConstraint?
init(content: Content, onSizeChanged: @escaping (CGSize) -> Void) {
super.init(frame: .zero)
let sizeReadingContent = content.readSize { [weak self] newSize in
@lukaskubanek
lukaskubanek / Bundle+TestFlight.swift
Last active November 3, 2024 17:20
A code snippet for detecting the TestFlight environment for a macOS app at runtime
/// MIT License
///
/// Copyright (c) 2021 Lukas Kubanek, Structured Path GmbH
///
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
@weissi
weissi / Makefile
Last active January 9, 2022 09:57
dont free
CFLAGS := -O2 -fPIC
test: libdontfree.dylib test.swift
swiftc -L. -ldontfree test.swift
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $^
libdontfree.dylib: dont-free.o
$(CC) $(LDFLAGS) -shared -o $@ $^