Skip to content

Instantly share code, notes, and snippets.

View ahmed-shehataa's full-sized avatar
🏠
Working from home

Ahmed Shehata ahmed-shehataa

🏠
Working from home
View GitHub Profile
@omarzer0
omarzer0 / MyServiceInterceptor.kt
Last active January 10, 2022 13:08
Service interceptor to update any okHttp/Retrofit header during run time when using hilt
@Singleton
class MyServiceInterceptor @Inject constructor(
private var sessionToken: String = ""
) : Interceptor {
fun setSessionToken(sessionToken: String) {
this.sessionToken = sessionToken
}
override fun intercept(chain: Interceptor.Chain): Response {
@bmc08gt
bmc08gt / StaggeredVerticalGrid.kt
Last active March 13, 2023 04:42
A StaggeredVerticalGrid with support for lazyPagingItems in Jetpack Compose
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxWithConstraints
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.GridCells
import androidx.compose.foundation.lazy.LazyColumn
@edgardo001
edgardo001 / youtube-dl.md
Created June 21, 2019 20:47
Using youtube-dl to download courses from Pluralsight

Download courses from learning sites with youtube-dl

You can download whole courses from an array of tutorial sites with the CLI tool youtube-dl. In the example further down I'm using my Pluralsight account to get videos from a course at their site. Here is a list of all supported sites that you can download from with this tool

The flags you have to supply may vary depending on which site you make a request to.

You can get a free 3 month trial to Pluralsight by signing up for free to Visual Studio Dev Essentials

Installation

@marciogranzotto
marciogranzotto / VIPER Android Example.kt
Last active April 16, 2021 08:41
This is an example of Android development with VIPER in Kotlin
interface LoginContracts {
interface View {
fun showError(message: String)
}
interface Presenter {
fun onDestroy()
fun onLoginButtonPressed(username: String, password: String)
}
@marciogranzotto
marciogranzotto / MVP + Interactor example.kt
Last active November 4, 2020 15:40
This is an example of Android development with MVP + Interactor in Kotlin
interface LoginContracts {
interface View {
fun presentHomeScreen(user: User)
fun showError(message: String)
}
interface Presenter {
fun onDestroy()
fun onLoginButtonPressed(username: String, password: String)
}