Skip to content

Instantly share code, notes, and snippets.

View EdricChan03's full-sized avatar

Edric Chan EdricChan03

View GitHub Profile
@Spottedleaf
Spottedleaf / Starlight 1.20.md
Last active June 6, 2024 15:18
The future of the Starlight mod

Final change of plans (March 8, 2024)

I don't see that many people are using Starlight on modern versions anymore. As such, I don't see any reason to continue to maintain the mod versions, given that they do have real mod conflict issues with other mods. Starlight is also not neccessary to use on 1.20.x anyways.

Starlight may make a return in a future project of mine, but for now I am ceasing to upload new mod versions and commit updates to the github. If you want Starlight on the server, you will need to use Paper or one of its derivatives.

@arriolac
arriolac / vcs_table.md
Created May 4, 2023 20:48
ViewCompositionStrategy Table
ViewCompositionStrategy Description
DisposeOnDetachedFromWindow The Composition will be disposed when the underlying ComposeView is detached from the window. Has since been superseded by DisposeOnDetachedFromWindowOrReleasedFromPool.

Interop scenario:

* ComposeView whether it’s the sole element in the View hierarchy, or in the context of a mixed View/Compose screen (not in Fragment).
DisposeOnDetachedFromWindowOrReleasedFromPool (Default) Similar to DisposeOnDetachedFromWindow, when the Composition is not in a pooling container, such as a RecyclerView. If it is in a pooling container, it will dispose when either the pooling container itself detaches from the window
@imashnake0
imashnake0 / RAndroidDevConvos.md
Last active March 13, 2023 14:40
Notable /r/AndroidDev discussions
@pudquick
pudquick / brew.md
Last active June 24, 2024 19:41
Lightly "sandboxed" homebrew on macOS

brew is a bad neighbor

This isn't a guide about locking down homebrew so that it can't touch the rest of your system security-wise.

This guide doesn't fix the inherent security issues of a package management system that will literally yell at you if you try to do something about "huh, maybe it's not great my executables are writeable by my account without requiring authorization first".

But it absolutely is a guide about shoving it into its own little corner so that you can take it or leave it as you see fit, instead of just letting the project do what it likes like completely taking over permissions and ownership of a directory that might be in use by other software on your Mac and stomping all over their contents.

By following this guide you will:

  • Never have to run sudo to forcefully change permissions of some directory to be owned by your account
@boswelja
boswelja / FlowLifecycleExt.kt
Last active April 15, 2022 08:38
Single-line Flow collector tied to Android's lifecycle
/**
* Observe a Flow on the calling lifecycle. This functions similar to LiveData observe, where
* collectors are tied to the calling scope's lifecycle. Using this, we can avoid having to launch
* a coroutine scope + using repeatOnLifecycle every time.
* @param lifecycleState The lifecycle state to start collecting the Flow on. Collection will be
* cancelled in the mirror state. See [repeatOnLifecycle] for more details.
* @param collector The [FlowCollector] used to collect values. See [Flow.collect] for more details.
*/
context(LifecycleOwner)
fun <T> Flow<T>.observe(
@vlsi
vlsi / kotlin_vs_java_generic_variance.md
Last active November 3, 2022 08:35
I would definitely recommend Kotlin generics to a Java fellow, here's why

Generics in Java are hard (sad, but true), however, Kotlin makes them way more accessible 🤩.

Suppose you are doing property-based testing. Just like I suggest, I was creating a jqwik test, and I ran into an issue with generic signatures.

Here's a minimal example, and it already has two issues.

Take a second and find both of them 😉

@joepie91
joepie91 / es-modules-are-terrible-actually.md
Last active June 15, 2024 04:54
ES Modules are terrible, actually

ES Modules are terrible, actually

This post was adapted from an earlier Twitter thread.

It's incredible how many collective developer hours have been wasted on pushing through the turd that is ES Modules (often mistakenly called "ES6 Modules"). Causing a big ecosystem divide and massive tooling support issues, for... well, no reason, really. There are no actual advantages to it. At all.

It looks shiny and new and some libraries use it in their documentation without any explanation, so people assume that it's the new thing that must be used. And then I end up having to explain to them why, unlike CommonJS, it doesn't actually work everywhere yet, and may never do so. For example, you can't import ESM modules from a CommonJS file! (Update: I've released a module that works around this issue.)

And then there's Rollup, which apparently requires ESM to be u

@sindresorhus
sindresorhus / esm-package.md
Last active June 28, 2024 07:58
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@cedrickring
cedrickring / ColoredShadow.kt
Last active June 24, 2024 10:26
Draw a colored shadow in Android Jetpack Compose
/*
Copyright 2020 Cedric Kring.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
@Maxim-Mazurok
Maxim-Mazurok / changes.txt
Last active January 11, 2020 10:58
Google API changes gathered for Maxim-Mazurok/google-api-typings-generator
[2020-01-07T21:10:32.008Z] cloudidentity:v1beta1 changed
[2020-01-07T21:10:50.175Z] fcm:v1 changed
[2020-01-07T21:15:31.100Z] classroom:v1 changed
[2020-01-07T21:16:11.734Z] runtimeconfig:v1 changed
[2020-01-07T21:21:10.775Z] remotebuildexecution:v1alpha changed
[2020-01-07T21:21:25.053Z] sheets:v4 changed
[2020-01-07T21:26:32.119Z] tagmanager:v1 changed
[2020-01-07T21:36:09.790Z] runtimeconfig:v1beta1 changed
[2020-01-07T21:36:11.287Z] script:v1 changed
[2020-01-07T21:41:24.950Z] slides:v1 changed