Skip to content

Instantly share code, notes, and snippets.

View brunogama's full-sized avatar

Bruno da Gama Porciuncula brunogama

View GitHub Profile
@dedlim
dedlim / claude_3.5_sonnet_artifacts.xml
Last active April 24, 2025 19:21
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
import UIKit
extension UIView {
static func vstack(
_ views: UIView...,
spacing: CGFloat = 0,
alignment: UIStackView.Alignment = .fill,
distribution: UIStackView.Distribution = .fill
) -> UIStackView {
@davidtaylorhq
davidtaylorhq / codenames-timer.js
Last active August 15, 2022 17:22
Timer UI for codenames.game
/*
Add-on timer for https://codenames.game
When run, a popup window will be opened with a countdown timer.
The timer will automatically reset when a team completes its turn.
There is also a manual reset control and duration setting
To run, start a game, then paste this entire gist into your browser developer tools.
Alternatively, add this URL as a bookmarklet:
javascript:fetch("https://gist.githubusercontent.com/davidtaylorhq/b64c294122dafbaf244ad7a53ce7a82a/raw/codenames-timer.js").then(response => response.text()).then(eval)
@TizianoCoroneo
TizianoCoroneo / DontTrustThisSelector.swift
Created August 6, 2020 16:24
Closure based Selector
import Foundation
import PlaygroundSupport
import UIKit
final class Sel {
static let target = DummyClass.shared
final class DummyClass {
@stefanomondino
stefanomondino / project.yaml
Last active July 29, 2020 16:13
Project.yaml example for XcodeGen
name: TestProject
configs:
Devel Run: debug
Devel Archive: release
Prod Run: debug
Prod Archive: release
settings:
configs:
Devel Run:
SWIFT_ACTIVE_COMPILATION_CONDITIONS: DEVEL DEBUG
hey guys, hi guys, hey guyz, hi guyz, hey dudes, hi dudez, hey dudez, hi dudez, hey bros, hi bros, hey brahs, hi brahs, hey broz, hi broz, dudebros, bros, dudes, guys, brahs, you guys, you dudes, sup dudes, sup bros, sup brahs, sup guys, sup dudez
May I suggest “everyone”? It's more gender inclusive.
May I suggest “all”? It's more gender-inclusive.
May I suggest “people”? It's more gender-inclusive.
May I suggest “y’all”? It's more gender-inclusive.
May I suggest “folks”? It's more gender-inclusive.
May I suggest “people”? It's more gender-inclusive.
May I suggest “humans”? It's more gender-inclusive.
May I suggest “everyone”? It's more gender-inclusive.
@nunogoncalves
nunogoncalves / BetterDecodingError.swift
Last active January 26, 2024 08:37
Better Decoding Error Messages
import Foundation
enum BetterDecodingError: CustomStringConvertible {
case dataCorrupted(_ message: String)
case keyNotFound(_ message: String)
case typeMismatch(_ message: String)
case valueNotFound(_ message: String)
case any(_ error: Error)
@heestand-xyz
heestand-xyz / cases.swift
Last active August 7, 2020 19:21
Swift Cases
import Foundation
fileprivate let badChars = CharacterSet.alphanumerics.inverted
public extension String {
var camelToTitleCased: String {
if self.count <= 1 {
return self.uppercased()
}
@brunogama
brunogama / qrcode.swift
Created November 21, 2019 19:26
There's no need to download third party software when you can execute this code and generate your own qr-code generator qr-code.playground 😀
//: A UIKit based Playground for presenting user interface
import UIKit
import PlaygroundSupport
final class QRCodeViewController: UIViewController {
private var input: String = ""
func generateQRCode(from string: String) -> UIImage? {
let data = string.data(using: String.Encoding.ascii)
@julienma
julienma / README.md
Last active April 10, 2023 21:59
Pi-Hole docker setup with DNSCrypt-Proxy 2

This will setup Pi-Hole with DNS-Over-HTTPS (DoH) enabled, using dnscrypt-proxy as a DoH proxy — which is an alternative to cloudflared, as explained in the Cloudflare docs. Inspired from https://github.com/losuler/pihole-dnscrypt-docker.

Install Pi-Hole on Docker

Create docker-compose.yml and etc-dnscrypt-proxy/dnscrypt-proxy.toml, then to install/update: