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 / script.sh
Created May 14, 2025 12:21
lowerc case and snake case all files shell
for f in *; do new=$(echo "$f" | tr '[:upper:]' '[:lower:]' | sed -E 's/[^a-z0-9]+/_/g' | sed -E 's/^_|_$//g'); if [ "$f" != "$new" ]; then mv "$f" "$new"; fi; done
{
"output": {
"filePath": "ios-monorepo-repomix.xml",
"style": "xml",
"compress": true,
"git": {
"sortByChanges": true,
"sortByChangesMaxCommits": 200,
"branch": "main"
},
@brunogama
brunogama / clean-utm.js
Created May 1, 2025 14:47
clean-utm.js using OpenIn Browser
// Remove tracking utm query
// Convert the iterator to an array to avoid modification issues
let keys = Array.from(ctx.url.searchParams.keys());
// Loop through all parameters
keys.forEach(function(key) {
// Check for both utm with and without underscore, same for uta
if (key === "utm" || key.startsWith("utm_") ||
key === "uta" || key.startsWith("uta_")) {
ctx.url.searchParams.delete(key);
export type MCP = {
name: string;
url: string;
description: string;
logo?: string;
};
export default [
{
name: "Upstash",
@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)
)