Skip to content

Instantly share code, notes, and snippets.

View abdhilabs's full-sized avatar
🎯
Focusing

Abdhi P abdhilabs

🎯
Focusing
  • nbs.co.id
  • Bandung
View GitHub Profile
@alfianlosari
alfianlosari / docc_static_hostling_cli_command
Created February 17, 2022 08:46
Docc command for generating static site hosting with Xcode > 13.3
// Generate docarhive file using xcodebuild to custom derived data path
xcodebuild docbuild \
-scheme YOUR_TARGET_NAME \
-derivedDataPath PATH_TO_SAVE_DERIVED_DATA_FOLDER \
-destination 'platform=iOS Simulator,name=iPhone 13'
// Find docarchive file in the build derived data path
find PATH_TO_SAVE_DERIVED_DATA_FOLDER -type d -name '*.doccarchive'
@AmrAbedal
AmrAbedal / Localizable.strings
Last active January 8, 2023 03:03
iOS XIB Localization tips
"Welcome_back"="Welcome back";
"PromoCodeAmount"="You have a promo code for %d %@";
@ironic-name
ironic-name / EmailValidator.kt
Last active September 23, 2022 18:03
Kotlin regex email validator function
fun isEmailValid(email: String): Boolean {
return Pattern.compile(
"^(([\\w-]+\\.)+[\\w-]+|([a-zA-Z]|[\\w-]{2,}))@"
+ "((([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\\.([0-1]?"
+ "[0-9]{1,2}|25[0-5]|2[0-4][0-9])\\."
+ "([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\\.([0-1]?"
+ "[0-9]{1,2}|25[0-5]|2[0-4][0-9]))|"
+ "([a-zA-Z]+[\\w-]+\\.)+[a-zA-Z]{2,4})$"
).matcher(email).matches()
}