Skip to content

Instantly share code, notes, and snippets.

@pedrocid
pedrocid / ConstructionBuilderPattern.swift
Created February 9, 2016 19:27
Example of Construction Builder in Swift
struct ObjectToConstruct {
let propertyOne: String?
let propertyTwo: Array<String>?
let propertyThree: Bool?
}
class ConstructBuilder {
@pedrocid
pedrocid / AbstractFactory.swift
Created February 21, 2016 10:21
Abstract Factory Pattern Example
//MARK: Abstract factory pattern
protocol AbstractProductA{
func display() -> String
}
protocol AbstractProductB{
func display() -> String
@pedrocid
pedrocid / CovarianceContravariance.swift
Created March 2, 2016 14:02
Examples os covariance and contravariance in Swift
//MARK: From https://mikeash.com/pyblog/friday-qa-2015-11-20-covariance-and-contravariance.html
import UIKit
//MARK: TYPE VARIANCE LESSON
//First we explore supertypes and subtypes
class Thing {}
class Vehicle: Thing {}
@pedrocid
pedrocid / Subscripts.swift
Created March 19, 2016 11:18
Custom subscripts in Swift
import UIKit
class Thing {
var name: String
var quantity: Int
init(name: String, quantity: Int){
self.name = name
//Exercises from https://www.pointfree.co/episodes/ep9-algebraic-data-types-exponents
import UIKit
enum Either<A,B> {
case left(A)
case right(B)
}
struct Pair<A,B> {
@pedrocid
pedrocid / GEMINI_CHALLENGES.md
Last active June 28, 2025 12:29
Claude Code & Gemini CLI Partnership Evaluation - Comprehensive AI Collaboration Study

🤖 Gemini CLI Challenge Arena

Welcome to the ultimate test for our new AI buddy! These challenges are designed to push Gemini CLI to its limits while having fun with collaborative AI development.

🏆 Challenge Categories

🔍 Level 1: Context Master

Test Gemini's ability to handle large context windows and file injection.

Challenge 1.1: The Great File Feast