Skip to content

Instantly share code, notes, and snippets.

@tinsukE
tinsukE / freebsd_13.2_py-paperless-ngx_patch.md
Last active April 19, 2024 19:05
Patches to install py-paperless-ngx 2.7.2 on FreeBSD 13.2

Patches to install py-paperless-ngx 2.7.2 on FreeBSD 13.2, which can come in handy if you can't upgrade, yet (ex: you run TrueNAS Core).

os.sched_getaffinity.patch

numpy and joblib need to be patched to avoid an exception when calling os.getaffinity():

OverflowError: could not allocate a large enough CPU set

This might be something needed for my system only, which is a FreeBSD 13.1 machine (TrueNAS CORE) hosting a FreeBSD 13.2 jail.

py-threadpoolctl.patch

@tinsukE
tinsukE / Callback.kt
Created May 30, 2018 10:02
Simple Callback
interface Callback<T> {
fun onSuccess(result: T)
fun onError(error: Error)
}
@tinsukE
tinsukE / SplashActivity.kt
Last active May 31, 2018 07:37
Coroutines Splash
class SplashActivity : Activity() {
private val creationTime = System.currentTimeMillis()
private var splashJob: Job? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
initializeApp()
}
@tinsukE
tinsukE / SplashActivity.kt
Last active May 30, 2018 12:25
Complicated Splash
class SplashActivity : Activity() {
private var isUserSessionInitialized = false
private var hasBeenShownForMinTime = false
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
initializeApp()
scheduleProgressBar()
@tinsukE
tinsukE / SplashActivity.kt
Last active May 30, 2018 12:25
Simple Splash
class SplashActivity : Activity() {
private var isUserSessionInitialized = false
private var hasBeenShownForMinTime = false
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
initializeUserSession()
scheduleProgressBar()