Skip to content

Instantly share code, notes, and snippets.

View nasrabadiAM's full-sized avatar

Ali Nasrabadi nasrabadiAM

View GitHub Profile
@nasrabadiAM
nasrabadiAM / NestedCoordinatorLayout.kt
Last active March 10, 2020 08:22
Having multiple point scrollFlags for CoordinatorLayout and appbars. link: https://stackoverflow.com/a/60613726/8743629
package com.nasrabadiam.widget
import android.content.Context
import android.util.AttributeSet
import android.view.View
import androidx.coordinatorlayout.widget.CoordinatorLayout
import androidx.core.view.NestedScrollingChild
import androidx.core.view.NestedScrollingChildHelper
class NestedCoordinatorLayout @JvmOverloads constructor(
@nasrabadiAM
nasrabadiAM / bug-report-template.md
Created May 6, 2019 05:52
Bug report template

Issue(bug report) Template:

  • This a template to report an issue.

When reporting a bug:

Fill out the sections below, leaving the headers but replacing the content. If you're unable to provide certain information, please explain why in the relevant section. We may close issues if they do not include sufficient information.

@cho0o0
cho0o0 / generateAccesskey.js
Last active June 18, 2024 20:17
Generate Outline access key based on Shadowsocks infomation
const generateAccesskey = (method, password, ip, port) => {
const firstPart = btoa(`${method.toLowerCase()}:${password}`)
const secondPart = `${ip}:${port}`
const accesskey = `ss://${firstPart}@${secondPart}`
return accesskey
}
@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
@Ghedeon
Ghedeon / NestedCoordinatorLayout.kt
Created August 21, 2018 21:02
NestedCoordinatorLayout
import android.annotation.SuppressLint
import android.content.Context
import android.support.annotation.AttrRes
import android.support.design.widget.CoordinatorLayout
import android.support.v4.view.NestedScrollingChild2
import android.support.v4.view.NestedScrollingChildHelper
import android.util.AttributeSet
import android.view.View
import com.douglas.startpage.R
keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
@JoseAlcerreca
JoseAlcerreca / EventObserver.kt
Created April 26, 2018 12:14
An Observer for Events, simplifying the pattern of checking if the Event's content has already been handled.
/**
* An [Observer] for [Event]s, simplifying the pattern of checking if the [Event]'s content has
* already been handled.
*
* [onEventUnhandledContent] is *only* called if the [Event]'s contents has not been handled.
*/
class EventObserver<T>(private val onEventUnhandledContent: (T) -> Unit) : Observer<Event<T>> {
override fun onChanged(event: Event<T>?) {
event?.getContentIfNotHandled()?.let { value ->
onEventUnhandledContent(value)
public abstract class ResponseWithErrorHandling<R, E> implements Callback<ResponseBody> {
private Type responseType;
private Type errorType;
public abstract void onResponseRequest(Call<ResponseBody> call, R response);
public abstract void onErrorRequest(Call<ResponseBody> call, E error);
public abstract void onFailureRequest(Call<ResponseBody> call, Throwable error);
@deepakpk009
deepakpk009 / media.json
Created November 8, 2017 14:02
sample free video urls
{
"categories": [
{
"name": "Movies",
"videos": [
{
"description": "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources": [
"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
],
@pratos
pratos / zeppelin_ubuntu.md
Last active February 13, 2022 01:53
To Install Zeppelin [Scala and Spark] in Ubuntu 16.04LTS

Install Zeppelin in Ubuntu systems

  • First install Java, Scala and Spark in Ubuntu

    • Install Java
      sudo apt-add-repository ppa:webupd8team/java
      sudo apt-get update
      sudo apt-get install oracle-java8-installer