Skip to content

Instantly share code, notes, and snippets.

@iamriajul
iamriajul / GlideImageGetter.kt
Last active October 16, 2023 05:48
Custom Html.ImageGetter to load images in TextView HTML tags using Glide
/*
* Based on java code by Yaser Rajabi https://gist.github.com/yrajabi
*/
package org.dailyislam.android.utils.extenstions
import android.graphics.Bitmap
import android.graphics.Canvas
import android.graphics.drawable.BitmapDrawable
import android.graphics.drawable.Drawable
import android.text.Html.ImageGetter
@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
@pamartineza
pamartineza / GitSubmodulesCheatsheet.txt
Last active June 28, 2023 08:41
Git Submodules Cheatsheet
//Adding a submodule:
git submodule add git@github.com:GreenLionSoft/xxxx.git folderName
git submodule init
git submodule update
cd folderName
git checkout xxxx
//Config for checking submodules before pushing
git config push.recurseSubmodules check
@alex-shpak
alex-shpak / Interceptor.java
Last active March 29, 2023 21:06
Refreshing OAuth token with okhttp interceptors. All requests will wait until token refresh finished, and then will continue with the new token.
private class HttpInterceptor implements Interceptor {
@Override
public Response intercept(Chain chain) throws IOException {
Request request = chain.request();
//Build new request
Request.Builder builder = request.newBuilder();
builder.header("Accept", "application/json"); //if necessary, say to consume JSON