Skip to content

Instantly share code, notes, and snippets.

View CassiusPacheco's full-sized avatar

Cassius Pacheco CassiusPacheco

View GitHub Profile
/// |                    World                 |
/// |------------------------------------------|
/// | Module A | Module B | Module C | Module D|
  1. World is a module
  2. World is aware of all modules.
  3. Modules aren't aware of World.
@chriseidhof
chriseidhof / sample.swift
Last active February 25, 2024 16:04
View Inspection
import SwiftUI
struct SizeKey: PreferenceKey {
static func reduce(value: inout CGSize?, nextValue: () -> CGSize?) {
value = value ?? nextValue()
}
}
struct ContentView: View {
@State var width: CGFloat? = nil
var body: some View {
@pepasflo
pepasflo / .gitignore
Last active October 22, 2023 12:06
Scripts for encrypting / decrypting secrets (to prevent them from being accidentally checked into git)
secrets/
@lattner
lattner / TaskConcurrencyManifesto.md
Last active May 3, 2024 08:18
Swift Concurrency Manifesto
//
// PaginationNetworkLogic.swift
//
// Created by Daniel Tartaglia on 4/9/17.
// Copyright © 2019 Daniel Tartaglia. MIT License
//
import RxSwift
struct PaginationUISource {
@0xjac
0xjac / private_fork.md
Last active May 3, 2024 18:34
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

//
// LevenshteinEditDistance.swift
//
// Created by Guilherme Rambo on 01/09/16.
// Based on https://gist.github.com/shergin/a6dba6ee5ae3b9ecb16c
// Copyright © 2016 Guilherme Rambo. All rights reserved.
//
import Foundation
@steipete
steipete / ios-xcode-device-support.sh
Last active December 12, 2023 03:36
Using iOS 15 devices with Xcode 12.5 (instead of Xcode 13)
# The trick is to link the DeviceSupport folder from the beta to the stable version.
# sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :)
# Support iOS 15 devices (Xcode 13.0) with Xcode 12.5:
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
# Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions
# (A similar approach works for older versions too, just change the version number after DeviceSupport)
@digoreis
digoreis / CURLSwift.swift
Last active May 15, 2018 20:45
test extension for curl - Update to Swift 3
//
// CURLDebug.swift
//
// Created by apple on 02/06/16.
// Copyright © 2016 Rodrigo Reis. All rights reserved.
//
import Foundation
@ZevEisenberg
ZevEisenberg / resetAllSimulators.sh
Last active November 30, 2022 09:27
Reset all iOS simulators with this one weird trick
osascript -e 'tell application "iOS Simulator" to quit'
osascript -e 'tell application "Simulator" to quit'
xcrun simctl erase all