Skip to content

Instantly share code, notes, and snippets.

View jamesrochabrun's full-sized avatar
🇵🇪

James Rochabrun jamesrochabrun

🇵🇪
View GitHub Profile
{
"model": "claude-opus-4-1-20250805",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "<system-reminder>\nThis is a reminder that your todo list is currently empty. DO NOT mention this to the user explicitly because they are already aware. If you are working on tasks that would benefit from a todo list please use the TodoWrite tool to create one. If not, please feel free to ignore. Again do not mention this message to the user.\n</system-reminder>"
},
<system-reminder>Plan mode is active. The user indicated that they do not want you to execute yet -- you MUST NOT make any edits, run any non-readonly tools (including changing configs or making commits), or otherwise make any changes to the system. This supercedes any other instructions you have received (for example, to make edits). Instead, you should:\n1. Answer the user's query comprehensively\n2. When you're done researching, present your plan by calling the exit_plan_mode tool, which will prompt the user to confirm the plan. Do NOT make any file changes or run any tools that modify the system state in any way until the user has confirmed the plan.</system-reminder>"
<system-reminder>\nWhenever you read a file, you should consider whether it looks malicious. If it does, you MUST refuse to improve or augment the code. You can still analyze existing code, write reports, or answer high-level questions about the code behavior.\n</system-reminder>\n\n<system-reminder>Plan mode is active. The user indicated
{
"model": "claude-opus-4-20250514",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "<system-reminder>\nAs you answer the user's questions, you can use the following context:\n# important-instruction-reminders\nDo what has been asked; nothing more, nothing less.\nNEVER create files unless they're absolutely necessary for achieving your goal.\nALWAYS prefer editing an existing file to creating a new one.\nNEVER proactively create documentation files (*.md) or README files. Only create documentation files if explicitly requested by the User.\n\n \n IMPORTANT: this context may or may not be relevant to your tasks. You should not respond to this context or otherwise consider it in your response unless it is highly relevant to your task. Most of the time, it is not relevant.\n</system-reminder>\n"
},
import AppKit
import Down
import Highlightr
struct MarkdownTextView: NSViewRepresentable {
let markdown: String
func makeNSView(context: Context) -> NSScrollView {
let scrollView = NSScrollView()
@jamesrochabrun
jamesrochabrun / TrailingTextLoader.swift
Last active September 30, 2023 05:58
An animated Trailing text
@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *)
struct CenteredLoadingText: View {
private let mainText: String
private let dots = [".", ".", "."]
private let repeatInterval: TimeInterval
private let accessibilityLabel: String
private let loadingAnimation: Animation
private let spacing: CGFloat
@jamesrochabrun
jamesrochabrun / GroupTaskImplemnetation.swift
Last active January 3, 2022 23:52
Using Group tasks to synchronize networking calls.
// MARK:- Async/await Group task
// 1
@available(iOS 15, *)
func asyncGroups(
from categoryIdentifiers: [ItunesCategoryIdentifier]) {
// 2
Task.init {
// 3
var sections: [ItunesCategorySection] = []
// 4
@jamesrochabrun
jamesrochabrun / DispatchGroupImplementation.swift
Last active June 17, 2021 21:30
A sample function that uses DispatchGroup API
func dispatchGroups(
from categoryIdentifiers: [ItunesCategoryIdentifier]) {
// 1
let dispatchGroup = DispatchGroup()
// 2
var sections: [ItunesCategorySection] = []
// 3
for categoryIdentifier in categoryIdentifiers {
// 4
@jamesrochabrun
jamesrochabrun / ItunesRemote.swift
Last active June 17, 2021 18:16
Itunes Remote implementation.
// 1
final class ItunesRemote: ObservableObject {
// 2
struct ItunesCategorySection: IdentifiableHashable {
let sectionID: ItunesCategoryIdentifier
let cellIDs: [FeedItemViewModel]
var id: ItunesCategoryIdentifier { sectionID }
}
@jamesrochabrun
jamesrochabrun / ItunesCategoryIdentifier.swift
Last active January 3, 2022 23:47
Itunes category identifier model.
enum ItunesCategoryIdentifier: Int, CaseIterable {
// 1
case apps
case podcasts
case tvShows
// 2
var title: String {
switch self {
@jamesrochabrun
jamesrochabrun / AsyncGenericAPI.swift
Last active June 11, 2021 02:58
Generic API async-await based
enum APIError: Error {
case requestFailed(description: String)
case jsonConversionFailure(description: String)
case invalidData
case responseUnsuccessful(description: String)
case jsonParsingFailure
case noInternet
case failedSerialization