Skip to content

Instantly share code, notes, and snippets.

View fsalata's full-sized avatar
🌎

Fábio Salata fsalata

🌎
View GitHub Profile
@fsalata
fsalata / TouchDownInside.playground
Last active November 8, 2023 19:15
SwiftUI TouchDown
import SwiftUI
import PlaygroundSupport
struct ContentView: View {
@State var buttonTouched = false
var body: some View {
VStack {
Text("Button")
.foregroundStyle(buttonTouched ? Color.blue.opacity(0.2) : Color.blue)
@fsalata
fsalata / yolo.sh
Created February 4, 2022 11:21
Set number of XCode threads
defaults write com.apple.dt.xcodebuild PBXNumberOfParallelBuildSubtasks `sysctl -n hw.ncpu`
defaults write com.apple.dt.xcodebuild IDEBuildOperationMaxNumberOfConcurrentCompileTasks `sysctl -n hw.ncpu`
defaults write com.apple.dt.Xcode PBXNumberOfParallelBuildSubtasks `sysctl -n hw.ncpu`
defaults write com.apple.dt.Xcode IDEBuildOperationMaxNumberOfConcurrentCompileTasks `sysctl -n hw.ncpu`
@fsalata
fsalata / build_script.sh
Created January 30, 2019 15:41 — forked from davedelong/build_script.sh
Auto-increment build numbers in release mode
# Automatically increment the CFBundleVersion in release builds
config=${CONFIGURATION}
if [ "${config}" = "Release" ]; then
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${PROJECT_DIR}/${INFOPLIST_FILE}")
buildNumber=$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/${INFOPLIST_FILE}"
else
echo "info: Skipping build number incrementation in ${config} mode"
@fsalata
fsalata / UIColorExtension.swift
Last active December 12, 2018 20:49
iOS Extensions
extension UIColor {
convenience init(r: Int, g: Int, b: Int) {
self.init(red: CGFloat(r) / 255.0, green: CGFloat(g) / 255.0, blue: CGFloat(b) / 255.0, alpha: 1.0)
}
}

Videos