Skip to content

Instantly share code, notes, and snippets.

View amin3536's full-sized avatar

amin mirmahmoudi amin3536

View GitHub Profile

VertaCast

Verata is casting a Laravel cast class to read or write values in Georgia format in the database. However, you can receive the output in Jalil format. Additionally, you can use Jalil string format or Carbon as input to save data.

usage

'created_at' => VertaCast::class.':Y-n-j,Y-n-j hh:mm'

@amin3536
amin3536 / EventBus.kt
Created July 9, 2020 06:43 — forked from DaleLaw/EventBus.kt
Implement EventBus with Kotlin coroutine
object EventBus {
val bus: BroadcastChannel<Any> = BroadcastChannel()
fun send(o: Any) {
launch {
bus.send(o)
}
}
#مشخص کردن ایمج داکر
image: openjdk:8-jdk
# تعریف وریبل ها
variables:
ANDROID_COMPILE_SDK: "28"
ANDROID_BUILD_TOOLS: "28.0.2"
ANDROID_SDK_TOOLS: "4333796"
before_script:
#این هام یک سری اسکریپت دستور لینوکس هست
public Single<User> getUserById(String userId){
return db.getUserById(userId)
/// if there is no user in the database get data from api
.onErrorResumeNext(api.getUserById(userId)
.subscribeOn(Schedulers.io())
//check your request
.filter(statusPojo::getStatus)
// save data to room
.switchMap(data -> {
//sava data to db