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
extension ObservableType { | |
func showHUDWhileExecuting(view: UIView) -> RxSwift.Observable<Self.E> { | |
dispatch_async(dispatch_get_main_queue()) { | |
MBProgressHUD.showHUDAddedTo(view, animated: true) | |
} | |
return self.doOn { (_) in | |
dispatch_async(dispatch_get_main_queue()) { |
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
package io.github.zzdjk6; | |
import java.util.HashMap; | |
import rx.Observable; | |
import rx.subjects.PublishSubject; | |
@SuppressWarnings("WeakerAccess") | |
public final class RxEventHub { |
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
import android.os.Handler | |
import android.view.View | |
import android.widget.AbsListView | |
import android.widget.AdapterView | |
// workaround for scrolling issue | |
// refer: https://stackoverflow.com/questions/11431832/android-smoothscrolltoposition-not-working-correctly | |
fun AbsListView.realSmoothScrollToPosition(position: Int) { | |
fun getChildAtPosition(view: AdapterView<*>, position: Int): View? { | |
val index = position - view.firstVisiblePosition |
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
public extension ObservableType { | |
public func subscribeNext(_ onNext: ((Self.E) -> Swift.Void)? = nil) -> Disposable { | |
return self.subscribe(onNext: onNext, onError: nil, onCompleted: nil, onDisposed: nil) | |
} | |
public func doOnNext(_ onNext: ((Self.E) -> (Swift.Void))? = nil) -> Observable<E> { | |
return self.do( | |
onNext: { (element) in | |
onNext?(element) |
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
public class AnonymousDisposable: Cancelable { | |
public func dispose() { | |
self.disposableImpl.dispose() | |
} | |
public var isDisposed: Bool { return self.disposableImpl.isDisposed } | |
private var disposableImpl: Cancelable |
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
FROM ubuntu:18.04 | |
MAINTAINER THOR CHEN "<[email protected]>" | |
RUN apt-get update && apt-get install -y tzdata && rm -rf /var/lib/apt/lists/* | |
ENV TZ Pacific/Auckland | |
RUN apt-get update && apt-get install -y \ | |
php7.2 \ | |
php7.2-mbstring \ | |
php7.2-mysql \ |
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
import axios from "axios"; | |
import StorageService from "./StorageService"; | |
export default class AxiosService { | |
static getInstance(query, variables) { | |
let headers = {}; | |
const user = StorageService.readUser(); | |
if (user && user.Token) { | |
headers["Authorization"] = "Bearer " + user.Token; | |
} |
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
import axios from "axios"; | |
import StorageService from "./StorageService"; | |
import persistedQueryMapping from "../graphql/mapping.json"; | |
import compress from "graphql-query-compress"; | |
export default class AxiosService { | |
static getInstance(query, variables) { | |
let headers = {}; | |
const user = StorageService.readUser(); | |
if (user && user.Token) { |
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
SilverStripe\GraphQL\PersistedQuery\JSONStringProvider: | |
mapping_with_key: | |
default: '{"mutation($songID:Int,$playlistID:Int){addSongToPlaylist(SongID:$songID,PlaylistID:$playlistID){ID ClassName LastEdited Created Title Description NumberOfSongs}}":"eaa0ae5c-818a-4cb4-936d-50da2fe3c9a9","mutation($input:ModelPlaylistCreateInputType!){createPlaylist(Input:$input){ID ClassName LastEdited Created Title Description NumberOfSongs}}":"75390ddb-8573-41dc-a956-abddad50b1b5","mutation($email:String!,$password:String!){createToken(Email:$email,Password:$password){ID FirstName Surname Email Token}}":"78b0294c-d6af-4922-9a88-7cb49626a2f9","query{readPlaylists{ID ClassName LastEdited Created Title Description NumberOfSongs}}":"934da2a0-3c04-4f54-baff-2e89598b84cb","query{readSongs{ID Title Length Artist Album Disc Track StreamFileURL}}":"683e444c-c393-46db-9deb-fc2a46ef5107","query($playlistID:ID!){readOnePlaylist(ID:$playlistID){ID ClassName LastEdited Created Title Description Songs{ID ClassName LastEdited Created |
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
// 1. Define the constants | |
const FETCH_DATA_REQUEST: string = 'FETCH_DATA/REQUEST'; | |
const FETCH_DATA_SUCCESS: string = 'FETCH_DATA/SUCCESS'; | |
const FETCH_DATA_FAILURE: string = 'FETCH_DATA/FAILURE'; | |
// 2. Define action creators | |
const fetchDataRequest: () => Action<void> = createAction(FETCH_DATA_REQUEST); | |
const fetchDataSuccess: (payload: DataType) => Action<DataType> = createAction(FETCH_DATA_SUCCESS); | |
const fetchDataFailure: (payload: Error) => Action<Error> = createAction(FETCH_DATA_FAILURE); | |
OlderNewer