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)
}
}
WEBVTT
00:00:02.170 --> 00:00:04.136
Emo, feche seus olhos
00:00:04.136 --> 00:00:05.597
Por quê?
AGORA!
00:00:05.597 --> 00:00:07.405
export default class BaseService {
defaultHeaders: DefaultHeaders;
constructor(token: string) {
this.defaultHeaders = {
Authorization: `Bearer ${token}`,
Accept: "application/json",
"Content-Type": "application/json"
};
}
@josuesilva-hotmart
josuesilva-hotmart / script.sh
Last active December 3, 2018 18:56
Run Swiftlint for the last modified swift file
swiftlint lint "${SRCROOT}/$( find . -type f -print0 | xargs -0 stat -f "%m %N" | sort -rn | head -3 | cut -f2- -d" " | grep swift | head -1 | awk '{print substr($1,3); }')"