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
#!/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
@felix-larsen
felix-larsen / CustomPhotoPickerView.swift
Last active May 16, 2024 06:58
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
import Foundation
struct Post: Decodable {
let id: String
let title: String
let body: String
}
struct GraphQLResult<T: Decodable>: Decodable {
let object: T?
//
// AnimatableVector2D.swift
//
// this is derivation of generic AnimatableVector presented at: https://nerdyak.tech/development/2020/01/12/animating-complex-shapes-in-swiftui.html
//
// Created by Pavel Zak on 18/05/2020.
//
import SwiftUI
@chriseidhof
chriseidhof / boilerplate.swift
Last active September 25, 2026 13:31
QuickMacApp
// Run any SwiftUI view as a Mac app.
import Cocoa
import SwiftUI
NSApplication.shared.run {
VStack {
Text("Hello, World")
.padding()
.background(Capsule().fill(Color.blue))
@mariusc
mariusc / conferences.md
Last active June 17, 2020 07:58
2020 iOS/mobile conferences status (as of May 8th)
Name Date Location Status
iOS Conf SG January 15-18 🇸🇬 Singapore Happened
dotSwift February 3 🇫🇷 Paris Happened
MobOS February 20-21 🇷🇴 Cluj Napoca Happened
Appdevcon March 10-13 🇳🇱 Amsterdam Postponed
try! Swift Tokyo March 18-20 🇯🇵 Tokyo Cancelled
CodeMobile April 28-29 🇬🇧 London Cancelled
App Builders May 11-12 🇨🇭 Lugano Online
UIKonf May 18-19 🇩🇪 Berlin Online
import XCTest
import Firebase
extension XCTestCase {
func clearFirestore() {
let semaphore = DispatchSemaphore(value: 0)
let projectId = FirebaseApp.app()!.options.projectID!
let url = URL(string: "http://localhost:8080/emulator/v1/projects/\(projectId)/databases/(default)/documents")!
var request = URLRequest(url: url)
//
// ContentView.swift
//
// Created by Chris Eidhof on 20.04.20.
// Copyright © 2020 objc.io. All rights reserved.
//
import SwiftUI
import UIKit
// Created by Marcin Krzyzanowski
import Foundation
public protocol JSONEncodable: Encodable { }
public extension JSONEncodable {
func toJSON(using encoder: @autoclosure () -> JSONEncoder = JSONEncoder()) throws -> String {
try String(decoding: encoder().encode(self), as: UTF8.self)
}