Skip to content

Instantly share code, notes, and snippets.

name: CI/CD counter app
on:
push:
branches: [ master ]
jobs:
#First we will see the application build or not , then we will deploy in EC2
build:
runs-on: ubuntu-latest
object RealPathUtil {
fun getRealPath(context: Context, fileUri: Uri): String? {
// SDK >= 11 && SDK < 19
return if (Build.VERSION.SDK_INT < 19) {
getRealPathFromURIAPI11to18(context, fileUri)
} else {
getRealPathFromURIAPI19(context, fileUri)
}// SDK > 19 (Android 4.4) and up
recyclerView.addOnScrollListener(object : RecyclerView.OnScrollListener() {
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
super.onScrolled(recyclerView, dx, dy)
if (dy < 0 && firstVisibleItemPosition == 0 && !isLoadMore) {
loadMoreData()
}
}
})
import React, { useEffect } from "react";
import clsx from "clsx";
import { makeStyles, useTheme } from "@material-ui/core/styles";
import {
Hidden,
ListItem,
ListItemIcon,
ListItemText,
List,
Typography,
@Farhandroid
Farhandroid / AutoResizableSelectBox.tsx
Last active January 18, 2022 16:06
Auto Resizable SelectBox (React , TypeScript , No jQuery)
import React, { useEffect, useRef, useState } from "react";
const optionList = [
{ id: "1", option: "Text" },
{ id: "2", option: "Loooooong Text" },
{ id: "3", option: "Looooooooooooooooooooooooooooooooong Text" },
{
id: "4",
option:
"Loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong Text",
name: gae-ci-cd
on:
push:
branches: [main]
jobs:
deploy:
if: github.ref == 'refs/heads/main'
name: deploy
runs-on: ubuntu-latest
class GetPopularMoviesUseCase(private val movieRepository: MovieRepository) {
suspend operator fun invoke()=movieRepository.getPopularMovies()
}
interface MovieRepository {
suspend fun getPopularMovies(): Result<MovieList>
}
interface MovieApi {
@GET("movie/popular")
suspend fun getPopularMovies(
@Query(
"api_key"
) apiKey: String
): Response<MovieList>
}
interface MovieRemoteDataSource {
suspend fun getPopularMovies(): Response<MovieList>
}