Skip to content

Instantly share code, notes, and snippets.

@josuesilva-hotmart
josuesilva-hotmart / delete_git_submodule.md
Created January 29, 2020 23:19 — 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
ACTION = build
AD_HOC_CODE_SIGNING_ALLOWED = NO
ALTERNATE_GROUP = staff
ALTERNATE_MODE = u+w,go-w,a+rX
ALTERNATE_OWNER = grantdavis
ALWAYS_SEARCH_USER_PATHS = NO
ALWAYS_USE_SEPARATE_HEADERMAPS = YES
APPLE_INTERNAL_DEVELOPER_DIR = /AppleInternal/Developer
APPLE_INTERNAL_DIR = /AppleInternal
APPLE_INTERNAL_DOCUMENTATION_DIR = /AppleInternal/Documentation
@josuesilva-hotmart
josuesilva-hotmart / Decodable+Any.swift
Created July 28, 2019 21:59
Use Codable to decode any object like NSDictionary or Arrays
extension Decodable {
init(_ any: Any) throws {
let data = try JSONSerialization.data(withJSONObject: any, options: .prettyPrinted)
let decoder = JSONDecoder()
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:sszzz"
decoder.dateDecodingStrategy = .formatted(dateFormatter)
self = try decoder.decode(Self.self, from: data)
}
}