Skip to content

Instantly share code, notes, and snippets.

View jasonsparc's full-sized avatar
🤖

Jason jasonsparc

🤖
View GitHub Profile
@serpro69
serpro69 / build.gradle.kts
Last active May 8, 2023 05:22
gradle junit test output
import org.gradle.api.tasks.testing.TestResult.ResultType
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
//...
tasks.test {
useJUnitPlatform()
maxParallelForks = 1
testLogging { // credits: https://stackoverflow.com/a/36130467/5917497
@agnostic-apollo
agnostic-apollo / hasFragileUserData.md
Last active April 11, 2024 07:30
Android hasFragileUserData AndroidManifest.xml flag

The hasFragileUserData flag can be added to the application node of AndroidManifest.xml. If its value is true, then when the user uninstalls the app, a prompt will be shown to the user asking him whether to keep the app's data.

<application
	...
    android:hasFragileUserData="true" tools:targetApi="q">
...
</application>
@latant
latant / await_shutdown.kt
Created October 23, 2020 10:50
A coroutine function that suspends until a shutdown is requested
import kotlin.concurrent.thread
import kotlin.coroutines.resume
import kotlin.coroutines.suspendCoroutine
suspend fun awaitShutdown() {
suspendCoroutine<Unit> { c ->
Runtime.getRuntime().addShutdownHook(thread(start = false) {
c.resume(Unit)
})
}
@szktty
szktty / clockwork-base32.md
Last active March 4, 2024 04:35
Clockwork Base32: A variant of Base32 inspired by Crockford's Base32
@gabrielemariotti
gabrielemariotti / README.MD
Last active March 7, 2024 07:50
How to use the ShapeableImageView.

The Material Components Library introduced with the 1.2.0-alpha03 the new ShapeableImageView.

In your layout you can use:

 <com.google.android.material.imageview.ShapeableImageView
      android:id="@+id/image_view"
      app:srcCompat="@drawable/..." />

Then in your code apply the ShapeAppearanceModel to define your custom corners:

@craigstjean
craigstjean / javasoft.reg
Last active May 22, 2023 19:16
Configure OpenJDK in Windows Registry
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft]
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment]
"CurrentVersion"="1.8"
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.8]
"JavaHome"="C:\\Tools\\Java\\jdk8u192-b12\\jre"
"RuntimeLib"="C:\\Tools\\Java\\jdk8u192-b12\\jre\\bin\\j9vm\\jvm.dll"
// ==UserScript==
// @name EmuParadise download script
// @version 1
// @description Downloads games directly after clicking their name
// @author Eptun
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// @match https://www.emuparadise.me/*/*/*
// @grant none
// ==/UserScript==
// ==UserScript==
// @name EmuParadise Download Workaround - 1.1.1
// @version 1.1.2
// @description Replaces the download button link with a working one
// @author Eptun
// @match https://www.emuparadise.me/*/*/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// @grant none
// ==/UserScript==
@ChrisK91
ChrisK91 / View HTML source with JavaScript and CSS styles.py
Created February 17, 2018 16:15
Reupload of the "View HTML source with JavaScript and CSS styles" add on for anki
# -*- mode: Python ; coding: utf-8 -*-
# • View HTML source with JavaScript and CSS styles
# https://ankiweb.net/shared/info/1128123950
# https://github.com/ankitest/anki-musthave-addons-by-ankitest
# License: GNU GPL, version 3 or later; http://www.gnu.org/copyleft/gpl.html
# Copyright (c) 2016 Dmitry Mikheev, http://finpapa.ucoz.net/
#
# Menu Cards - View Source code Body Alt+F3
# shows HTML source with JavaScript and CSS styles
# but without jQuery Menu Cards
@notwa
notwa / desmos.md
Last active January 5, 2021 18:02
stuff i've plotted in desmos

stuff i've plotted in desmos

in some order idk

the two nonlinearities involved in (a scalar version of) converting RGB to CIELAB.

f(x) converts RGB to linear sRGB. g(x) is used in converting linear sRGB to XYZ. the black line is the combination of the two, not quite linear.