Skip to content

Instantly share code, notes, and snippets.

View brunogama's full-sized avatar

Bruno da Gama Porciuncula brunogama

View GitHub Profile
@brunogama
brunogama / Cursor Nested Rules & Project-Level MCP.md
Created April 18, 2025 21:14
Cursor Nested Rules & Project-Level MCP - original repository: https://github.com/JeredBlu/custom-instructions

Cursor Nested Rules & Project-Level MCP

This repository contains boilerplate rule templates for setting up an optimized AI development workflow in Cursor, as demonstrated in my YouTube video Combining Project-Level MCP Servers & Nested Cursor Rules to 10x Ai Dev Workflow.

Important Note ⚠️

These are intentionally generic boilerplate rules! You should modify and customize them to match your specific:

  • Project requirements
  • Technology stack
  • Database setup
extension String {
/// Returns an array of substrings based on the provided ranges
/// - Parameter ranges: Array of ranges to slice the string
/// - Returns: Array of sliced strings
func sliced(_ ranges: [Range<Int>]) -> [String] {
ranges.map { range in
let startIndex = self.index(self.startIndex, offsetBy: range.lowerBound)
let endIndex = self.index(self.startIndex, offsetBy: range.upperBound)
return String(self[startIndex..<endIndex])
}
@brunogama
brunogama / pbcopy_files_with_extension
Created February 8, 2025 02:27
puts all content from files with extension to clipboard
#!/bin/bash
if [ -z "$1" ]; then
echo "Usage: $0 <file_extension>"
exit 1
fi
EXTENSION="$1"
TMP_FILE="/tmp/temp.txt"
@brunogama
brunogama / claude_3.5_sonnet_artifacts.xml
Created January 7, 2025 12:19 — forked from dedlim/claude_3.5_sonnet_artifacts.xml
Claude 3.5 Sonnet, Full Artifacts System Prompt
<artifacts_info>
The assistant can create and reference artifacts during conversations. Artifacts are for substantial, self-contained content that users might modify or reuse, displayed in a separate UI window for clarity.
# Good artifacts are...
- Substantial content (>15 lines)
- Content that the user is likely to modify, iterate on, or take ownership of
- Self-contained, complex content that can be understood on its own, without context from the conversation
- Content intended for eventual use outside the conversation (e.g., reports, emails, presentations)
- Content likely to be referenced or reused multiple times
@brunogama
brunogama / .pre-commit-config.yaml
Last active January 1, 2025 06:30
.pre-commit-config.yaml
# swidt-mint
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
description: Ensure parseable yaml/yml files
- id: check-json
description: Ensure only valid json is commited
// FROM SWIFTLINT
import Dispatch
import Foundation
private let outputQueue: DispatchQueue = {
let queue = DispatchQueue(
label: "io.realm.swiftlint.outputQueue",
qos: .userInteractive,
target: .global(qos: .userInteractive)
)
@brunogama
brunogama / box.swift
Created December 4, 2024 10:06
Conformed Box
final class Box<Type> {
var value: Type
init(_ value: Type) {
self.value = value
}
}
extension Box: CustomStringConvertible where Type: CustomStringConvertible {
var description: String {
@brunogama
brunogama / nuke-xcinstall.sh
Last active January 17, 2023 13:56
XCInstall cleaner
#!/bin/bash
FIRST_APP_ON_XC_INSTALL=$(find ~/Library/Developer/Xcode/DerivedData \
-path "*/Build/Products/*/.XCInstall/*.app" \
-type d \
-maxdepth 6 \
-print \
-quit \
-exec dirname {} \;)
CLEAN=${FIRST_APP_ON_XC_INSTALL%/*}
@brunogama
brunogama / .gitconfig
Created November 23, 2022 10:17 — forked from codexico/.gitconfig
git alias
# https://gist.github.com/codexico/2a34c0d599f3af93b46f
[color]
# Use colors in Git commands that are capable of colored output when
# outputting to the terminal. (This is the default setting in Git ≥ 1.8.4.)
ui = auto
[color "branch"]
pihole -w clients4.google.com
pihole -w clients2.google.com
pihole -w s.youtube.com
pihole -w video-stats.l.google.com
pihole -w www.googleapis.com
pihole -w youtubei.googleapis.com
pihole -w oauthaccountmanager.googleapis.com
pihole -w android.clients.google.com
pihole -w reminders-pa.googleapis.com firestore.googleapis.com
pihole -w gstaticadssl.l.google.com