Skip to content

Instantly share code, notes, and snippets.

View titiphoque's full-sized avatar

Thibaut Schmitt titiphoque

  • Clermont-Ferrand
View GitHub Profile
@titiphoque
titiphoque / OSBaseModifier.swift
Created May 10, 2023 14:10
SwiftUI modifiers to apply modifier based on which OS code is running
import SwiftUI
extension View {
func isIOS() -> Bool {
#if os(iOS)
if UIDevice.current.userInterfaceIdiom == .phone {
return true
}
return false
#else
@titiphoque
titiphoque / delete_git_submodule.md
Created February 15, 2022 16:39 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@titiphoque
titiphoque / ObjectMapper+Combine.swift
Created April 29, 2021 13:44
Combine extension allowing parsing data with ObjectMapper framework
//
// ObjectMapper+Combine.swift
//
// Created by Thibaut Schmitt on 04/12/2020.
//
import Combine
import Foundation
import ObjectMapper