Skip to content

Instantly share code, notes, and snippets.

View kibotu's full-sized avatar
🎯
Focusing

Jan Rabe kibotu

🎯
Focusing
View GitHub Profile
@kibotu
kibotu / reclaim_build_folder.sh
Created March 14, 2025 10:00
Reclaims build folder in a directory. Ignores git folder, too and adds a summary.
import os
import shutil
import argparse
def get_dir_size(dir_path):
"""Calculate the total size of a directory in bytes."""
total_size = 0
for dirpath, dirnames, filenames in os.walk(dir_path):
for filename in filenames:
file_path = os.path.join(dirpath, filename)
import android.R
import android.app.Activity
import android.graphics.Rect
import android.view.View
import android.view.ViewTreeObserver
import android.widget.FrameLayout
class AndroidBug5497Workaround private constructor(activity: Activity) {
private val mChildOfContent: View
@kibotu
kibotu / ThreadsWatchdog.kt
Created March 11, 2025 12:39
Threads Watchdog
class ThreadsWatchDogInitializer: Initializer<Unit> {
@Inject lateinit var threads : ThreadsRepository
override fun create(context: Context) {
C24CoreApplication.inject(this)
threads.start()
}
@kibotu
kibotu / CoreStrictMode.kt
Last active March 11, 2025 12:34
CoreStrictService
class App : Application() {
var strictMode: CoreStrictMode? = null
val applicationScope: CoroutineScope = CoroutineScope(SupervisorJob() + Dispatchers.Default)
}
class StrictModeInitializer : Initializer<Unit> {
private val corePreferences: CoreSharedPreferencesRepository
get() = CoreServices.services.sharedPreferencesRepository
override fun create(context: Context) {
@kibotu
kibotu / threads.txt
Created March 4, 2025 10:40
Android thread optimization with shared thread pools.
ViewPostIme pointer 0
ViewPostIme pointer 1
Thread[AppUpdateService,5,main]
Thread[CameraAvailabilityObserver_ObservationThread,5,main]
Thread[Chrome_IOThread,7,main]
Thread[Chrome_ProcessLauncherThread,5,main]
Thread[CleanupReference,5,main]
Thread[ConnectivityThread,5,main]
Thread[CookieMonsterCl,5,main]
Thread[DefaultDispatcher-worker-1,5,main]
@kibotu
kibotu / Jenkins.groovy
Created February 13, 2025 11:04
Sending Slack Notifications from Jenkins to Threads + Reactions
def joke = new groovy.json.JsonSlurper().parseText(new URL("https://icanhazdadjoke.com/slack").text).attachments.text.join('')
def slackResponse = slackSend(
channel: "slack-tests",
color: "danger",
message: "$joke"
)
slackResponse.addReaction("thumbsup")
@kibotu
kibotu / Jenkinsfile.groovy
Last active January 30, 2025 08:13
Ollama Chat Groovy function
/**
* <pre>
* def messages = [
* [role: "system", content: "You're a helpful assistant talking like a cat"],
* [role: "user", content: "tell me another joke"]
* ]
*
* def response = functions.ollamaChat(messages)
* echo "${response.message.content}"
* </pre>
@kibotu
kibotu / README.md
Created December 19, 2024 10:51
Setup Guide MagicMirror for RaspberryPi
@kibotu
kibotu / install-node-v20.9.0.sh
Created October 16, 2024 09:02
install node on pi
#!/bin/bash
# By Steven de Salas
# Based on script by Richard Stanley @ https://github.com/audstanley/Node-MongoDb-Pi/
# This is for a RaspberryPi Zero but should work across all models.
VERSION=v20.9.0;
# Creates directory for downloads, and downloads node
cd ~/ && mkdir temp && cd temp;