Skip to content

Instantly share code, notes, and snippets.

View byaruhaf's full-sized avatar
🏄
Surfing Xcode

Franklin Byaruhanga byaruhaf

🏄
Surfing Xcode
View GitHub Profile
@byaruhaf
byaruhaf / Brewfile
Created November 9, 2021 02:43 — forked from cliss/Brewfile
Casey Liss's Brewfile, as of 31 October 2021
cask_args appdir: "/Applications"
tap "homebrew/cask-fonts"
brew "mas"
#### LAPTOPS ####
#cask "tripmode"
#### LAPTOPS ####
mas "Boop", id: 1518425043
@byaruhaf
byaruhaf / CustomPhotoPickerView.swift
Created January 7, 2021 14:38 — forked from felix-larsen/CustomPhotoPickerView.swift
PHPhotoPicker metadata example
import SwiftUI
import PhotosUI
struct CustomPhotoPickerView: UIViewControllerRepresentable {
@Binding var selectedImage: UIImage?
@Binding var date: Date?
@Binding var location: CLLocationCoordinate2D?
@Environment(\.presentationMode) var presentationMode
@byaruhaf
byaruhaf / IntegerTextField.swift
Created December 21, 2020 12:55 — forked from grosch/IntegerTextField.swift
SwiftUI TextField which only accepts integers and binds to an Int? instead of a String
import SwiftUI
private class IntegerTextFieldValue: ObservableObject {
@Published var value = "" {
didSet {
let numbersOnly = value.filter { $0.isNumber }
if value != numbersOnly {
value = numbersOnly
}
}
@byaruhaf
byaruhaf / shh.rb
Created December 20, 2020 07:55 — forked from robinsloan/shh.rb
Disable RTs from all the people you follow on Twitter.
require "rubygems"
require "twitter"
# get these from apps.twitter.com
CONSUMER_KEY = "foo"
CONSUMER_SECRET = "bar"
OAUTH_TOKEN = "blee"
OAUTH_TOKEN_SECRET = "baz"
TWITTER_USER = "your_username" # needs to be the one associated with keys above
@byaruhaf
byaruhaf / RevealBuildPhase.sh
Created December 13, 2020 02:27 — forked from Ashton-W/RevealBuildPhase.sh
Build Phase Script for copying and signing libReveal in Debug Configuration
#!/usr/bin/env bash
# Build Phase Script for copying and signing libReveal based on Configuration
# https://gist.github.com/Ashton-W/6db611ac93be2f8bad7f
set -o errexit
set -o nounset
LIBREVEAL_PATH="/Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/libReveal.dylib"
INJECT_REVEAL="${INJECT_REVEAL:-NO}"
@byaruhaf
byaruhaf / CopyConfigurationResources.sh
Created December 13, 2020 01:21 — forked from Ashton-W/CopyConfigurationResources.sh
CopyConfigurationResources Xcode Build Phase Script
#!/usr/bin/env bash
# Build Phase Script for use in Xcode
# Copy Resources based on Configuration
#
# https://gist.github.com/Ashton-W/a47ec8b128ecbe470632
set -o nounset
# From Build Environment
#!/bin/sh
# make sure you have imagemagick installed: brew install imagemagick
# your app_icons.sh file should have the correct permissions: run `chmod 775 app_icons.sh` in your terminal from where you put this file
# put your `my_icon.png` next to this file and run ./app_icons.sh to export your app icons
x=my_icon.png
y=${x%.*}
# delete the export directory so we start clean
@byaruhaf
byaruhaf / swiftc_help.txt
Created November 29, 2020 17:56 — forked from enomoto/swiftc_help.txt
$ swiftc -help
OVERVIEW: Swift compiler
USAGE: swiftc [options] <inputs>
MODES:
-dump-ast Parse and type-check input file(s) and dump AST(s)
-dump-parse Parse input file(s) and dump AST(s)
-dump-scope-maps <expanded-or-list-of-line:column>
Parse and type-check input file(s) and dump the scope map(s)
-dump-type-refinement-contexts