Skip to content

Instantly share code, notes, and snippets.

View victorBaro's full-sized avatar
👾

Victor Baro victorBaro

👾
View GitHub Profile
@victorBaro
victorBaro / pipDynamics.playground
Created August 17, 2021 05:02
Dynamics Playground - PIP using field behaviors
import UIKit
import PlaygroundSupport
class DummyVC: UIViewController {
let margin: CGFloat = 20
override func viewDidLoad() {
view.backgroundColor = .green
view.addSubview(pipView)
@victorBaro
victorBaro / FolderSizeCalculator.swift
Last active July 3, 2022 14:00
Calculate total size of a given directory URL. Ready to paste in a Playground. Code uses modern swift concurrency async/await. Part of the code based on the following SO post: https://stackoverflow.com/a/32814710
import UIKit
enum FolderSizeCalculatorError: Error {
case urlUnreachableOrNotDirectory
case failToEnumerateDirectoryContent
case failToGenerateString
}
class FolderSizeCalculator {
private let fileManager: FileManager
@victorBaro
victorBaro / GlowingWaves.metal
Last active March 4, 2025 23:14
Glowing waves shader using new SwiftUI colorEffect modifier. Used code from here: https://github.com/GrishTad/GlowingWaves - Original shadertoy implementation here: https://www.shadertoy.com/view/tlySzm
#include <metal_stdlib>
using namespace metal;
// MARK: Helper methods
float N2(float2 p) {
p = fmod(p, float2(1456.2346));
float3 p3 = fract(float3(p.xyx) * float3(443.897, 441.423, 437.195));
p3 += dot(p3, p3.yzx + 19.19);
return fract((p3.x + p3.y) * p3.z);
}
@victorBaro
victorBaro / Crashlog.txt
Created July 17, 2024 14:18
Xcode Crash log
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------
Process: Xcode [4064]
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 15.4 (22622)
Build Info: IDEApplication-22622000000000000~2 (15F31d)
App Item ID: 497799835