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
| # If you come from bash you might have to change your $PATH | |
| export ANDROID_HOME=$HOME/Library/Android/sdk/ | |
| export PATH=$HOME/bin:/usr/local/bin:$HOME/Library/Python/2.7/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:$PATH | |
| export LC_ALL=en_US.UTF-8 | |
| export LANG=en_US.UTF-8 | |
| # Path to your oh-my-zsh installation. | |
| export ZSH="/Users/aleksandrsobol/.oh-my-zsh" |
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
| image: openjdk:8-jdk | |
| stages: | |
| - build | |
| - package | |
| #################################################################################################### | |
| # BUILD | |
| # |
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
| data class Chat( | |
| @SerializedName("chat_id") val chatId: String, | |
| @SerializedName("created_at") val createdAt: Long, | |
| @SerializedName("updated_at") val updatedAt: Long, | |
| @SerializedName("creator_id") val creatorId: String, | |
| @SerializedName("recipients") val recipients: List<String>, | |
| @SerializedName("unread_messages") val unreadMessages: Int, | |
| @SerializedName("last_message_id") val lastMessageId: String, | |
| @SerializedName("last_message") val lastMessage: String, | |
| @SerializedName("last_message_timestamp") val lastMessageTimeStamp: Long, |
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
| 05-30 23:52:14.445 6225-6225/com.motoris.motorist D/ChatListPresenter: new_chat: { | |
| "chat_id": "chat_id", | |
| "created_at": 13432543245325532, | |
| "recipients": [ | |
| "rec1", | |
| "rec2", | |
| "rec3" | |
| ] | |
| } | |
| 05-30 23:52:14.446 6225-6225/com.motoris.motorist D/ChatListPresenter: text_payload: { |
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
| enum class EnvelopeType { | |
| CHAT_MESSAGE, CHAT_NEW, MESSAGE_STATUS, CHAT_UPDATED | |
| } | |
| enum class PayloadType { | |
| TEXT_MESSAGE, IMAGE_MESSAGE | |
| } | |
| enum class MessageStatusType { | |
| FAILED, SENDING, DELIVERED_TO_SERVER, DELIVERED_TO_RECIPIENT, READED, DELETED |
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
| Observables.combineWithUnit(checkedProducts, view.confirmReplacement()) | |
| .switchMap { interactor.confirmReplacement(orderId, DenyCourierOrderRequest(it)) } | |
| .subscribe { response -> response.fold(view::showError, { Timber.d("confirmed!!!!") }) } | |
| fun <T> combineWithUnit(o1: Observable<T>, o2: Observable<Unit>): Observable<T> | |
| = Observable.combineLatest(o1, o2, BiFunction { t1, _ -> t1 }) | |
| val checkedProducts = view.checkProduct() | |
| .scan(ArrayList<String>(), {acc, next -> acc.add(next); acc}) | |
| .publish() |
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
| Observable personsObs = | |
| Observable | |
| .from(personList) | |
| .reduce(new ArrayList<Person>(), (acc, person) -> { | |
| person.setInPhonebook(isInPhonebook); | |
| person.setAccessoryType(accessoryType); | |
| acc.add(person); | |
| return acc; | |
| }) | |
| .map(personDao::save); |
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 GzipRequestInterceptor implements Interceptor { | |
| @Override public Response intercept(Chain chain) throws IOException { | |
| Request originalRequest = chain.request(); | |
| if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { | |
| return chain.proceed(originalRequest); | |
| } | |
| Request compressedRequest = originalRequest.newBuilder() | |
| .header("Content-Encoding", "gzip") | |
| .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |