This file contains hidden or 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
| target 'SomeApp' do | |
| if !ENV['PIPPIN_PATH'].blank? then | |
| pod 'Pippin', :path => ENV['PIPPIN_PATH'] | |
| else | |
| pod 'Pippin' | |
| end | |
| end |
This file contains hidden or 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
| desc 'Create git tags and push them to remote, push podspec to CocoaPods.' | |
| task :release do | |
| version = `vrsn --read --file #{version_file}` | |
| sh "git tag #{version.strip}" | |
| sh 'git push --tags' | |
| sh 'pod trunk push' | |
| end |
This file contains hidden or 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
| desc 'Bump version number and commit the changes with message as the output from vrsn. Can supply argument to bump one of: major, minor, patch or build. E.g., `rake bump[major]` or `rake bump[build]`.' | |
| task :bump,[:component] do |t, args| | |
| require 'open3' | |
| modified_file_count, stderr, status = Open3.capture3("git status --porcelain | egrep '^(M| M)' | wc -l") | |
| if modified_file_count.to_i > 0 then | |
| sh "git stash --all" | |
| end | |
| component = args[:component] |
This file contains hidden or 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 modelLayerFunction() throws -> [Any] { /* ... */ } | |
| func controllerFunction() throws -> [Any] { | |
| let models = try modelLayerFunction() | |
| // ... | |
| return models | |
| } | |
| do { | |
| let results = try controllerFunction() |
This file contains hidden or 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 modelLayerFunction() -> [Any]? { /* ... */ } | |
| func controllerFunction() -> [Any]? { | |
| guard let models = modelLayerFunction() else { | |
| // log error and/or show alert? | |
| return nil | |
| } | |
| // ... | |
| return models | |
| } |
This file contains hidden or 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
| class AnObject { | |
| func resultOfWork() throws -> Any {/* ... */} | |
| } | |
| func doSomeWork() throws -> Any { | |
| let result = try anObjectInstance.resultOfWork() | |
| // ... | |
| return result | |
| } |
This file contains hidden or 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
| class AnObject { | |
| func resultOfWork() -> Any? {/* ... */} | |
| } | |
| func doSomeWork() -> Any? { | |
| guard let result = anObjectInstance.resultOfWork() else { | |
| // log and/or show error alert here? | |
| return nil | |
| } | |
| // ... |
This file contains hidden or 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
| curl -s http://bash.org/?random1 \ | |
| | grep -oE "<p class=\"quote\">.*</p>.*</p>" \ | |
| | grep -oE "<p class=\"qt.*?</p>" \ | |
| | sed -e 's/<\/p>/\n/g' -e 's/<p class=\"qt\">//g' -e 's/<p class=\"qt\">//g' \ | |
| | perl -ne 'use HTML::Entities;print decode_entities($_),"\n"' \ | |
| | head -1 \ | |
| | say |
This file contains hidden or 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
| typedef void(^__nullable MyBlockType)(NSObject *__nullable a, NSObject *__nullable b, NSObject *__nullable c); | |
| @interface MyClass | |
| - (void)someMethodWithInput:(NSObject *__nonnull)input completion:(MyBlockType)completion; | |
| @end |
This file contains hidden or 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
| @interface MyClass | |
| - (void)someMethodWithInput:(NSObject *__nonnull)input completion:(void(^__nullable)(NSObject *__nullable a, NSObject *__nullable b, NSObject *__nullable c))completion; | |
| @end |