This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}' | |
killall Dock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
echo "PDF Resize" | |
echo "Usage: $0 input-image.pdf output-image.pdf 100x100" | |
if [ $# -eq 0 ]; then | |
echo "No arguments provided" | |
exit 1 | |
fi | |
gs -o $2 -sDEVICE=pdfwrite -dPDFFitPage -r72x72 -g$3 $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# HOW TO USE: | |
# script suppose to run as one of the build phases in a Xcode project | |
# (For example like this: ${SOURCE_ROOT}/scripts/check_strings.pl ${PRODUCT_NAME}) | |
# HOW IT WORKS | |
# script parse the Localizable file for the specific target (get target name from parameter ${PRODUCT_NAME}) | |
# and .m files in the project (except KDSLocalization.m) | |
# script generates xcode error messages during a build process |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: objective-c | |
osx_image: xcode9.3 | |
env: | |
global: | |
- LC_CTYPE=en_US.UTF-8 | |
- LANG=en_US.UTF-8 | |
- WORKSPACE=Ronald.xcworkspace | |
- IOS_SCHEME="Ronald" | |
matrix: | |
- DESTINATION="OS=11.3,name=iPhone X" SCHEME="$IOS_SCHEME" RUN_TESTS="YES" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum Auth { | |
struct TokenWasObtained: Action { | |
let token: String | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String) { | |
core.dispatch(action: Auth.TokenWasObtained( | |
token: fcmToken) | |
) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func downloadProfileImage(_ url: URL) { | |
// I've skipped action creator here, just to keep it short | |
let action = Downloader.DownloadProfileImage(url: url) | |
core.dispatch(action: action) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func downloadFinished(_ image: UIImage) { | |
let action = ProfileImageDownloaded(image: image) | |
core.dispatch(action: action) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func reduce(_ old: AuthState, with action: Action) -> AuthState { | |
switch action { | |
case let payload as Auth.TokenWasObtained: | |
return AuthState(id: old.id, | |
token: payload.token | |
) | |
default: return old | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct DownloadUserProfile: Action { | |
let baseURL: String | |
let endpoint: String | |
let profileID: String | |
let authToken: String | |
let retryCount: Int | |
} |
OlderNewer