Skip to content

Instantly share code, notes, and snippets.

View Zile995's full-sized avatar
๐Ÿ˜Ž
Focusing

Stefan Zile995

๐Ÿ˜Ž
Focusing
  • Belgrade
  • 16:57 (UTC +02:00)
View GitHub Profile
@Zile995
Zile995 / zsh-fzf-pacman.zsh
Created October 3, 2023 10:34
zsh fzf widget for installing and removing pacman packages
#!/bin/zsh
fzf-package-install() {
(( $+commands[yay] && $+commands[pacman] )) || return 1
setopt localoptions pipefail no_aliases 2> /dev/null
local preview="yay -Si {1}"
local yay_search="yay -Salq"
local pacman_search="pacman -Slq"
@Zile995
Zile995 / RecursiveFileWatcher.kt
Created February 26, 2023 14:54
Android RecursiveFileWatcher built by using the Java WatchService
// File extension function. Get the RecursiveFileWatcher instance from File.
fun File.asRecursiveFileWatcher(scope: CoroutineScope, recreateRootDir: Boolean = true) =
RecursiveFileWatcher(scope = scope, rootDir = this, recreateRootDir)
class RecursiveFileWatcher(
private val scope: CoroutineScope,
private val rootDir: File,
private val recreateRootDir: Boolean = true
) {
@Zile995
Zile995 / DriveKtx.kt
Last active February 26, 2023 14:45
Android, Google Drive API Kotlin extension functions.
// Coroutine dispatcher
private val ioDispatcher = Dispatchers.IO
// App drive folder
private val DRIVE_FOLDER =
ContentType.create("application/vnd.google-apps.folder", Consts.ISO_8859_1)
val APPLICATION_ZIP: ContentType
get() = ContentType.create("application/zip", Consts.ISO_8859_1)
@Zile995
Zile995 / GoogleSignIn.kt
Last active February 21, 2023 21:21
GoogleSignIn helper functions
private fun buildGoogleSignInClient(): GoogleSignInClient {
val signInOptions = GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN).run {
requestEmail()
requestScopes(Scope(DriveScopes.DRIVE_FILE))
build()
}
return GoogleSignIn.getClient(this, signInOptions)
}
private fun launchSignInIntent(resultLauncher: ActivityResultLauncher<Intent>) {
@Zile995
Zile995 / fonts.conf
Last active May 13, 2025 10:12
Arch Linux fontconfig
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<match target="font">
<edit mode="assign" name="autohint">
<bool>false</bool>
</edit>
<edit mode="assign" name="antialias">
<bool>true</bool>
</edit>