Skip to content

Instantly share code, notes, and snippets.

View eduardb's full-sized avatar

Eduard-Cristian Boloș eduardb

View GitHub Profile
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.remember
import androidx.compose.runtime.snapshots.MutableSnapshot
import androidx.compose.runtime.snapshots.Snapshot
import java.util.WeakHashMap
@PublishedApi
internal class DebugStateObservation(private val id: String) {
private val map = WeakHashMap<Any, MutableList<Exception>>()

This gist provides a more flexible version of adb that exposes the functionality to select a device and then use that device's serial number in one or more adb commands. It expands on the initial implementation of the deeplinks.sh gist.

Companion blog post for usage is 🔗 here.

Companion posts for earlier versions of the script: Extending an Interactive ADB

import android.os.Build.VERSION.SDK_INT
import android.os.Bundle
import android.os.Parcel
import android.util.Base64
/**
* This class implements a fix for https://issuetracker.google.com/issues/147246567
* Investigation: https://twitter.com/Piwai/status/1374129312153038849
*
* Usage:
@alexjlockwood
alexjlockwood / CircleSquare.kt
Last active September 26, 2020 17:52
A circle square animation implemented using Jetpack Compose. Inspired by @beesandbombs (twitter.com/beesandbombs).
package com.alexjlockwood.circlesquare
import androidx.compose.animation.animatedFloat
import androidx.compose.animation.core.AnimationConstants
import androidx.compose.animation.core.LinearEasing
import androidx.compose.animation.core.repeatable
import androidx.compose.animation.core.tween
import androidx.compose.foundation.Canvas
import androidx.compose.runtime.Composable
package com.babylon.checks.detectors
import com.android.tools.lint.client.api.UElementHandler
import com.android.tools.lint.detector.api.Category
import com.android.tools.lint.detector.api.Detector
import com.android.tools.lint.detector.api.Implementation
import com.android.tools.lint.detector.api.Issue
import com.android.tools.lint.detector.api.JavaContext
import com.android.tools.lint.detector.api.Scope
import com.android.tools.lint.detector.api.Severity
@burntcookie90
burntcookie90 / linguist-runner.sh
Last active February 23, 2021 03:51
runs linguist on ever commit since a date
#!/usr/bin/bash
for commit in $(git --no-pager log --reverse --after="2016-10-01T10:36:00-07:00" --pretty=format:%H)
do
echo $commit
git checkout $commit
#write linguist data to a file
echo "" >> ~/repo-linguist-report.txt
echo "commit: $commit" >> ~/repo-linguist-report.txt
@scottrigby
scottrigby / keybase-team-encrypted-fs.md
Last active January 4, 2023 03:32
🔐 Keybase team encrypted file sharing

🔐 Keybase team encrypted file sharing

Keybase is a cryptographically secure, popular tool to verify identities, and provide secure groups, files and chats.

We are using keybase filesystem (KBFS) for securely sharing encrypted files (containing keys, passwords, etc). This announcement explains the high-level, this documentation page goes into further detail, and the KBFS Crypto Spec explains how their cryptography works (see the link to Saltpack, which is used for the encryption format).

Team file sharing directories are mounted to /Volumes/Keybase/team/TEAM.NAME. For example, the helm_project file sharing would be mounted to /Volumes/Keybase/team/helm_project (see Known issues and workarounds below).

Prerequisites

@japgolly
japgolly / upgrade.md
Last active April 26, 2022 02:55
Scala 2.13 migration notes

scalafix

addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.13")
import scalafix.sbt.ScalafixPlugin.autoImport.{scalafixDependencies, scalafixSemanticdb}

scalafixDependencies in ThisBuild += "org.scala-lang.modules" %% "scala-collection-migrations" % "2.1.4",
fun main(args: Array<String>) {
println("a" to "b")
println("a" to "b" tre "c")
println("a" to "b" tre "c" fo "d")
println("a" to "b" tre "c" fo "d" fi "e")
println("a" to "b" tre "c" fo "d" fi "e" sik "f")
println("a" to "b" tre "c" fo "d" fi "e" sik "f" seva "g")
}
infix fun <A, B, C> Pair<A, B>.tre(c: C) = Triple(first, second, c)
@dlew
dlew / script.sh
Created November 9, 2018 16:36
Simple AndroidX Migration Script
#!/usr/bin/env bash
# I've found that the "Migrate to AndroidX" converter in Android Studio doesn't work very
# well, so I wrote my own script to do the simple job of converting package names.
#
# You can download a CSV of package names here: https://developer.android.com/topic/libraries/support-library/downloads/androidx-class-mapping.csv
#
# It'll run faster on a clean build because then there are fewer files to scan over.
#
# Uses `gsed` because I'm on a Mac. Can easily replace with `sed` if you don't have `gsed`.