Skip to content

Instantly share code, notes, and snippets.

@KlassenKonstantin
KlassenKonstantin / RubberBandSlider.kt
Created January 15, 2024 17:16
Rubber Band Slider Compose
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
WindowCompat.setDecorFitsSystemWindows(window, false)
super.onCreate(savedInstanceState)
setContent {
RubberBandSliderTheme {
Surface(modifier = Modifier.fillMaxSize(), color = MaterialTheme.colorScheme.background) {
Box(contentAlignment = Alignment.Center) {
RubberBandSlider(modifier = Modifier
.height(200.dp)
@HylkeB
HylkeB / enable_android_certificate_revocation_check.kt
Last active April 19, 2026 22:24
Sample code of how to enable certificate revocation checking using a CertPathValidator. Required to make Certificate Transparency a suitable replacement for Certificate Pinning
package com.example
import android.net.http.X509TrustManagerExtensions
import android.os.Build
import androidx.annotation.RequiresApi
import okhttp3.Interceptor
import java.io.IOException
import java.security.KeyStore
import java.security.cert.CertPathValidator
import java.security.cert.CertPathValidatorException
@vegard
vegard / kernel-dev.md
Last active April 29, 2026 03:13
Getting started with Linux kernel development

Getting started with Linux kernel development

Prerequisites

The Linux kernel is written in C, so you should have at least a basic understanding of C before diving into kernel work. You don't need expert level C knowledge, since you can always pick some things up underway, but it certainly helps to know the language and to have written some userspace C programs already.

It will also help to be a Linux user. If you have never used Linux before, it's probably a good idea to download a distro and get comfortable with it before you start doing kernel work.

Lastly, knowing git is not actually required, but can really help you (since you can dig through changelogs and search for information you'll need). At a minimum you should probably be able to clone the git repository to a local directory.

@rharter
rharter / InjectableActivityScenario.kt
Created July 19, 2019 15:27
An ActivityScenario that allows you to use Dagger Android's automatic, lifecycle based injection without making your Application class `open`, or overriding it in tests.
package com.pixite.pigment.testing
import android.app.Activity
import android.app.Instrumentation
import android.content.Context
import android.content.Intent
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.Lifecycle
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active May 5, 2026 23:54
Conventional Commits Cheatsheet