Skip to content

Instantly share code, notes, and snippets.

View AniketSK's full-sized avatar
😀
Available for consulting on Android, maybe fulltime for the right company!

Aniket Kadam AniketSK

😀
Available for consulting on Android, maybe fulltime for the right company!
View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/placesRecyclerView"
@AniketSK
AniketSK / MaxHeap.kt
Created August 9, 2020 05:34
Trying out MaxHeaps
package com.aniketkadam.heaps
import org.jetbrains.annotations.TestOnly
class MaxHeap<T : Comparable<T>> {
private val items: MutableList<T> = mutableListOf()
fun insertAll(items: List<T>): Unit = items.forEach(::insert)
fun insert(item: T): Unit {
@AniketSK
AniketSK / LceGeneric.kt
Created August 28, 2020 11:32
A way to define a generic kotlin lce.
sealed class Lce<T> {
class Loading<T> : Lce<T>() // Can't be an object since it wouldn't have the T otherwise.
data class Content<T>(val data : T) : Lce<T>()
data class Error<T>(val error : Throwable) : Lce<T>()
}
@AniketSK
AniketSK / RealmModule.kt
Created December 30, 2020 10:29
A "module" in the Dependency Injection sense, which handles connecting to realm anonnymously for a given appid and prepares a synced realm instance for Android
package com.example.emojigarden
import android.app.Application
import android.util.Log
import io.realm.Realm
import io.realm.mongodb.App
import io.realm.mongodb.AppConfiguration
import io.realm.mongodb.Credentials
import io.realm.mongodb.User
@AniketSK
AniketSK / settings.json
Last active July 23, 2021 11:35
Settings to turn off any kind of tooltip for vscode. This is particularly helpful if you're trying to write text and the constant tooltips are messing with you. By default it doesn't consider mdx markdown, so these settings make sure it also considers mdx, while applying the changes to markdown files.
{
"files.autoSave": "afterDelay",
"editor.suggest.snippetsPreventQuickSuggestions": false,
"files.associations": {
"*.mdx": "markdown",
"*.md":"markdown"
},
"[markdown]":{
"editor.wordWrap": "on",
"editor.quickSuggestions": false,
package live.hms.video.media.tracks;
import android.content.Context;
import android.os.SystemClock;
import org.webrtc.CapturerObserver;
import org.webrtc.JavaI420Buffer;
import org.webrtc.Logging;
import org.webrtc.SurfaceTextureHelper;
import org.webrtc.VideoCapturer;