This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| TASK="${*:-}" | |
| if [ -z "$TASK" ]; then | |
| echo "Uso: sh do-task.sh \"<minha_tarefa>\"" | |
| exit 1 | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -Eeuo pipefail | |
| # ============================================================ | |
| # agent-loop.sh | |
| # | |
| # Orquestra: | |
| # 1. Claude Code -> planejamento | |
| # 2. Hermes Agent -> execução | |
| # 3. Codex -> revisão estruturada |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import <Metal/Metal.h> | |
| #include <iostream> | |
| #include <cstring> | |
| int main() { | |
| @autoreleasepool { | |
| const char* input = "Anotaram a data da maratona"; | |
| NSString *objcString = [NSString stringWithUTF8String:input]; | |
| NSString *lowerString = [objcString lowercaseString]; | |
| NSString *normalized = [[lowerString componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] componentsJoinedByString:@""]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { dirname, join } from "node:path"; | |
| import { existsSync, readFileSync } from "node:fs"; | |
| export function getClosestPackageVersionSync(startDir = import.meta.dir) { | |
| for (let dir = startDir; ; dir = dirname(dir)) { | |
| const filePath = join(dir, "package.json"); | |
| if (existsSync(filePath)) { | |
| const pkg = JSON.parse(readFileSync(filePath, "utf8")) as { | |
| version?: string; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { z } from "zod"; | |
| const originalSchema = z | |
| .object({ | |
| age: z.number(), | |
| name: z.string() | |
| }) | |
| // Strict defined on the original object schema | |
| .strict(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type EventTypes = 'rateLimitExceeded' | 'rateLimitDismissed' | |
| function simplePubSub() { | |
| const callbacks = new Map<symbol, (event: EventTypes) => void> | |
| return { | |
| subscribe: (callback: (event: EventTypes) => void) => { | |
| const key = Symbol() | |
| callbacks.set(key, callback); | |
| return () => callbacks.delete(key) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { stdin as input, stdout as output } from 'process'; | |
| import { emitKeypressEvents } from 'readline'; | |
| function clearConsole(lengthOfOptions) { | |
| //adapted from sindresorhus ansi-escape module | |
| const ESC = '\u001B[' | |
| const eraseLine = ESC + '2K'; | |
| const cursorUp = (count = 1) => ESC + count + 'A' | |
| const cursorLeft = ESC + 'G' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Isso é uma factory function, basicamente é como se tivesse instanciando uma classe, mas faço isso com function, | |
| * prefiro esse padrão do que usar classes. Eu tenho que chamar essa função globalmente antes de começar o app. | |
| * | |
| * IMPORTANTE: Não demorei nem 10 minutos fazendo essa porcaria, então sei lá, recomendo algo mais parrudão pra usar em prod. | |
| * Principalmente algo com tipagem melhor que vc consiga listar os eventos disponiveis e os parâmetros que cada callback recebe. | |
| */ | |
| function simplePubSubFactory() { | |
| const subscribed = new Map<string, Map<symbol, (...args: any[]) => void>> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { AppState, Linking } from "react-native"; | |
| import { useEffect, useRef, useState } from "react"; | |
| import { Audio, InterruptionModeIOS } from "expo-av"; | |
| import { getNetworkStateAsync } from "expo-network"; | |
| import Voice, { | |
| SpeechRecognizedEvent, | |
| SpeechResultsEvent, | |
| } from "@react-native-voice/voice"; | |
| import BackgroundTimer from "react-native-background-timer"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "app_id": 1966818, | |
| "billing_address": { | |
| "address1": "2259 Park Ct", | |
| "address2": "Apartment 5", | |
| "city": "Drayton Valley", | |
| "company": null, | |
| "country": "Canada", | |
| "first_name": "Christopher", | |
| "last_name": "Gorski", |
NewerOlder