Skip to content

Instantly share code, notes, and snippets.

View vvsevolodovich's full-sized avatar

Vladimir Ivanov vvsevolodovich

View GitHub Profile
@vvsevolodovich
vvsevolodovich / .sh
Created October 12, 2020 13:21
Openapi Automation with Github
#!/bin/bash
if [ $# -eq 0 ]
then
echo "usage: ./tools/openapi-generate <your_service> <project_id> <token>"
exit
fi
BASE_PATH=`pwd`"/$1/lib"
BASE_MODEL_PATH="$BASE_PATH/model"
GENERATED_PATH="$BASE_PATH/newversion/lib"
@vvsevolodovich
vvsevolodovich / BottomSheet.js
Created July 17, 2020 18:40
BottomSheet reference implementation
// @flow
import * as React from 'react'
import { Animated, StyleSheet, Text, View, Dimensions, TouchableWithoutFeedback } from 'react-native'
import {
PanGestureHandler,
NativeViewGestureHandler,
State,
TapGestureHandler
} from 'react-native-gesture-handler'
data class Movie(
var title: String,
var year: int,
var Description: String
) {
public constructor() : this("", 0, "")
}
class MovieService(private val iDataStore: IDataStore<Movie> =
Backendless.Data.of(Movie::class.java)) : IBackendlessService
public fun <R, T> (suspend R.() -> T).startCoroutine(
receiver: R,
completion: Continuation<T>
) {
createCoroutineUnchecked(receiver, completion).resume(Unit)
}
public actual override fun <T> interceptContinuation(continuation: Continuation<T>): Continuation<T> =
DispatchedContinuation(this, continuation)
_pool.execute(timeSource.trackTask(block))
IntStream
.range(1, 1_000_000)
.parallel()
.sum()
public actual val DefaultDispatcher: CoroutineDispatcher = CommonPool
public actual fun launch(
context: CoroutineContext = DefaultDispatcher,
start: CoroutineStart = CoroutineStart.DEFAULT,
parent: Job? = null,
block: suspend CoroutineScope.() -> Unit
): Job {
val newContext = newCoroutineContext(context, parent)
val coroutine = if (start.isLazy)
LazyStandaloneCoroutine(newContext, block) else
StandaloneCoroutine(newContext, active = true)