Skip to content

Instantly share code, notes, and snippets.

View mohamed-khaled-hsn's full-sized avatar

Mohamed Khaled mohamed-khaled-hsn

View GitHub Profile
@okmanideep
okmanideep / EventQueue.kt
Last active January 5, 2023 15:27
Event abstraction for Jetpack Compose
import androidx.compose.runtime.*
import kotlinx.coroutines.CoroutineScope
@Stable
internal class Event<T>(val value: T)
class MutableEventQueue<T>
internal constructor(): EventQueue<T>() {
private val events = mutableListOf<Event<T>>()
private val nextEventAsState = mutableStateOf<Event<T>?>(null)
@filipkowicz
filipkowicz / HeaderItemDecoration.kt
Last active April 19, 2024 15:37
Item Decorator for sticky headers in Kotlin
package com.filipkowicz.headeritemdecorator
/*
solution based on - based on Sevastyan answer on StackOverflow
changes:
- take to account views offsets
- transformed to Kotlin
- now works on viewHolders
@LOG-TAG
LOG-TAG / VolleyOkHttp3StackInterceptors.java
Last active December 30, 2022 16:53
CREDITS: <1>https://gist.github.com/alashow/c96c09320899e4caa06b <2>https://gist.github.com/intari/e57a945eed9c2ee0f9eb9082469698f3 <3>https://gist.github.com/alirezaafkar/a62d6a9a7e582322ca1a764bad116a70 Reason: for making the Volley use latest okhttpstack work for latest version Volley 1.1.0 by removing all deprecated org.apache dependencies!
/**
* Created by @subrahmanya on 2/3/18.
* CREDITS:
*<1>https://gist.github.com/alashow/c96c09320899e4caa06b
*<2>https://gist.github.com/intari/e57a945eed9c2ee0f9eb9082469698f3
*<3>https://gist.github.com/alirezaafkar/a62d6a9a7e582322ca1a764bad116a70
*
*
* Reason: for making the Volley use latest okhttpstack work for latest version Volley 1.1.0 by removing all deprecated org.apache dependencies!
*/
@mgedmin
mgedmin / jenkins.md
Last active April 3, 2019 17:33
Installing latest Jenkins on Ubuntu

Installing upstream Jenkins

  1. Make sure you don't have Jenkins installed from Ubuntu repositories -- you'll get problems if you try to mix it with upstream packages
apt-get purge jenkins --auto-remove
  1. Add the upstream Jenkins package repository
@libinbensin
libinbensin / DrawerActivity
Last active March 13, 2021 05:30
Android Navigation Drawer with Activities
public class DrawerActivity extends ActionBarActivity {
private DrawerLayout mDrawerLayout = null;
private ListView mDrawerList = null;
private String[] mDrawerItems;
private ActionBarDrawerToggle mDrawerToggle = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_drawer_layout);