Skip to content

Instantly share code, notes, and snippets.

View djrobby's full-sized avatar

Robby Dhillon djrobby

  • Detroit, MI - USA
View GitHub Profile
@Amzd
Amzd / TextFieldFocusableArea.swift
Last active August 6, 2021 14:48
SwiftUI TextField has a very small tappable area and there is no simple way to make that area bigger. This is a solution using Introspect (https://github.com/siteline/SwiftUI-Introspect/) Stack Overflow question: https://stackoverflow.com/questions/56795712/swiftui-textfield-touchable-area/62089790#62089790
extension View {
public func textFieldFocusableArea() -> some View {
TextFieldButton { self.contentShape(Rectangle()) }
}
}
fileprivate struct TextFieldButton<Label: View>: View {
init(label: @escaping () -> Label) {
self.label = label
}
@mnaruse
mnaruse / GeocoderService.swift
Last active July 17, 2020 15:14
Swift標準のCLGeocoderを使ったジオコーディングと逆ジオコーディング
//
// GeocoderService.swift
// myGeocoding
//
// Created by Miharu Naruse on 2020/05/20.
// Copyright © 2020 Miharu Naruse. All rights reserved.
//
// https://developer.apple.com/documentation/corelocation/converting_between_coordinates_and_user-friendly_place_names
// https://developer.apple.com/documentation/corelocation/clplacemark
// https://developer.apple.com/documentation/corelocation/clgeocoder
@frankfka
frankfka / iOSCustomSegmentedControlSwiftUI.swift
Created May 17, 2020 16:47
Custom Segmented Picker / Segmented Control in SwiftUI
import SwiftUI
extension View {
func eraseToAnyView() -> AnyView {
AnyView(self)
}
}
struct SizePreferenceKey: PreferenceKey {
typealias Value = CGSize
@gladilindv
gladilindv / auth.swift
Created May 5, 2020 09:50
Swift observable
import Foundation
import SwiftUI
import Combine
class HttpAuth: ObservableObject {
@Published var authenticated = false
func postAuth(username: String, password: String) {
guard let url = URL(string: "http://mysite/login") else { return }
@Nazmul56
Nazmul56 / APIManager.swift
Created April 26, 2020 09:18
Swift api manager
/
// APIManager.swift
// iOSDuComm
//
// Created by Sufian on 20/6/19.
// Copyright © 2019 Abu Sufian. All rights reserved.
//
import UIKit
import Alamofire
//
// ContentView.swift
// newUI
//
// Created by prafull kumar on 3/4/20.
// Copyright © 2020 prafull kumar. All rights reserved.
//
import SwiftUI
@rigwild
rigwild / .bashrc
Last active March 19, 2024 20:31
my wsl bash .bashrc configs
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@Ex-Ark
Ex-Ark / 00.Capistrano-Rails-Unicorn-Nginx-Webpack
Last active February 25, 2022 15:31
Rails 6 + webpack assets + capistrano + unicorn + nginx : Zero downtime deploy and code reload
cap staging deploy:check
cap staging deploy
/*
It's now a package. You can find it here:
https://github.com/joshnuss/svelte-local-storage-store
*/
// Svelte store backed by window.localStorage
// Persists store's data locally
@cleonps
cleonps / !Swift Snippets.md
Last active July 15, 2022 14:47
Swift Snippets