Skip to content

Instantly share code, notes, and snippets.

View briannadoubt's full-sized avatar

Brianna Zamora briannadoubt

View GitHub Profile
@briannadoubt
briannadoubt / View+UIModalPresentationStyle.swift
Last active January 25, 2023 23:25
View + UIModalPresentationStyle
public extension View {
/// Present another SwiftUI `View` by embedding it into a `UIHostingController` and presenting it on the key `UIViewController`, on the top-most `UIWindow`.
///
/// This extension was originally copied from [this Medium article](https://medium.com/@cuongnguyenhuu/how-to-present-a-screen-with-modalpresentationstyle-in-swiftui-like-uikit-fe9b53e09d72) written by Cuon (Currie) H. NGUYEN.
///
/// The code has been updated to fix warnings and implicitly unwrapped optional variables.
/// - Parameters:
/// - isPresented: Whether or not the `Content` view is presented.
/// - modalPresentationStyle: The `UIModalPresentationStyle` to present with.
/// - content: The `Content` view that will desplay when `isPresented` is `true`.
@briannadoubt
briannadoubt / ContentView.swift
Last active November 20, 2022 19:10
Core Data Fetch Request Wrapper View
import SwiftUI
struct ContentView: View {
var body: some View {
CoreDataFetchRequestWrapper(Relationship.self) { relationships in
ForEach(relationships, id: \.self) { relationship in
Text(relationship.id?.uuidString ?? "Rawr")
}
}
}
@briannadoubt
briannadoubt / wp.sh
Created December 22, 2019 07:05 — forked from bgallagh3r/wp.sh
Wordpress: Bash Install Script -- Downloads latest WP version, updates wp-config with user supplied DB name, username and password, creates and CHMOD's uploads dir, copies all the files into the root dir you run the script from, then deletes itself!
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Database Name: "
read -e dbname
echo "Database User: "
read -e dbuser
echo "Database Password: "
Verifying my Blockstack ID is secured with the address 1H6khUEby5fr8P46kojvoUyLvtksMiekMf https://explorer.blockstack.org/address/1H6khUEby5fr8P46kojvoUyLvtksMiekMf