Skip to content

Instantly share code, notes, and snippets.

View Wooder's full-sized avatar

Jochen Holzer Wooder

  • Karlsruhe, Germany
View GitHub Profile
@Wooder
Wooder / useful-git-commands.txt
Last active April 5, 2024 09:40
useful-git-commands collection
#H1 Useful GIT commands
#H2 Which Git Branches contain the given commit
#H3 local
git branch --contains your_commit_hash
#H3 remote
git branch -a --contains your_commit_hash
#H2 Revert a merge commit that was already pushed
git revert -m 1 <commit-hash>
Requirement IDFA IDFV
User permission(ATT) needed Yes No
Same ID in all Apps of same device Yes No
Same ID in all Apps of vendor on same device Yes Yes
Same ID on different devices No No
Can be used for Ad Attribution Yes No
Can be used for Ad Frequency Capping Yes No (under certain circumstances yes - see article)
Can be used for Audience Targeting Yes Yes
sonarqube-check:
stage: test
image:
name: sonarsource/sonar-scanner-cli:latest
entrypoint: [""]
variables:
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
cache:
key: "${CI_JOB_NAME}"
# See https://docs.sonarqube.org/7.2/AnalysisParameters.html for documentation
sonar.projectKey=your_project_key
sonar.organization=default
sonar.links.homepage=https://gitlab.com/aaa/bbb
sonar.projectBaseDir=.
sonar.sources=YourApp/Classes
sonar.host.url=https://sonarqube-instance.yourdomain.com/
sonar.report.export.path=sonar-report.json
#sonar.login= add this if running sonar-client locally
sonar.qualitygate.wait=true
# record video from iOS simulator
xcrun simctl io booted recordVideo appVideo.mov
import Foundation
public class EmailValidator {
public init() {
}
public func validateEmailAddress(_ email: String) -> Bool {
let emailTest = NSPredicate(format: "SELF MATCHES %@", String.emailValidationRegEx)
return emailTest.evaluate(with: email)
extension Int {
init?(doubleVal: Doube) {
guard (doubleVal <= Double(Int.max).nextDown) && (doubleVal >= Double(Int.min).nextUp) else {
return nil
}
self.init(doubleVal)
}
Date in current timezone as string:
let longDateString = Date().description(with: .current)
let shortDateString DateFormatter.localizedString(from: expiryDate, dateStyle: .medium, timeStyle: .short)
@Wooder
Wooder / swiftlint_commandsmd
Last active August 29, 2018 12:03
swiftlint command to autocorrect a single file
#autocorrect a single file
SCRIPT_INPUT_FILE_COUNT=1 SCRIPT_INPUT_FILE_0="Class.swift" swiftlint autocorrect --use-script-input-files
#show only swiftlint warnings
swiftlint 2>&1 | grep -i warning
### which shell is used?
echo $SHELL
echo $0