Skip to content

Instantly share code, notes, and snippets.

View rynkowsg's full-sized avatar

Greg Rynkowski rynkowsg

View GitHub Profile
@rynkowsg
rynkowsg / SharedPreferencesUtils.kt
Created March 6, 2024 16:03
Get EncryptedSharedPreferences
//
// Get EncryptedSharedPreferences and handle restore of accidentallly
// backuped file that we can no longer decrypt. If the master key provided
// is not able to decrypt the shared preferences, the file will be recreated.
//
// Tested with "androidx.security:security-crypto:1.1.0-alpha06"
//
package pl.rynkowski.platform_utils
@rynkowsg
rynkowsg / keybase.md
Created October 19, 2023 16:03
keybase.md

Keybase proof

I hereby claim:

  • I am rynkowsg on github.
  • I am rynkowsg (https://keybase.io/rynkowsg) on keybase.
  • I have a public key whose fingerprint is F347 6719 D066 1632 D61D 0B3B 6762 037B 92E2 622E

To claim this, I am signing this object:

// Avenir
@font-face {
font-family: "Avenir";
font-weight: 800;
src: url(#{$font-url + "/Avenir/Avenir-Black.ttf"}) format("truetype");
}
@font-face {
font-family: "Avenir";
#!/usr/bin/env bash
yes_or_no() {
while true; do
printf "%s [y/n]: " "$*"
read -r yn
case $yn in
[Yy]*) return 0 ;;
[Nn]*) return 1 ;;
esac
@rynkowsg
rynkowsg / .gitattributes
Last active December 25, 2022 18:39
.gitattributes for Git LFS
#################################################
#### audio files
*.m4a filter=lfs diff=lfs merge=lfs -text
*.mp3 filter=lfs diff=lfs merge=lfs -text
*.ogg filter=lfs diff=lfs merge=lfs -text
*.wav filter=lfs diff=lfs merge=lfs -text
### audio editor files
#*.aup filter=lfs diff=lfs merge=lfs -text
*.au filter=lfs diff=lfs merge=lfs -text
#################################################
@rynkowsg
rynkowsg / atom_db.cljc
Last active December 20, 2022 13:47
Atom DB with nav support
(ns atom-db
(:require
[clojure.core.protocols :as ccp]
[clojure.datafy :as cd]))
(defn init-db []
(atom {}))
(defn- navigify [db path]
(vary-meta
@rynkowsg
rynkowsg / .gitattributes
Created October 16, 2021 23:36
.gitattributes for Git LFS
#################################################
#### audio files
*.m4a filter=lfs diff=lfs merge=lfs -text
*.mp3 filter=lfs diff=lfs merge=lfs -text
*.ogg filter=lfs diff=lfs merge=lfs -text
*.wav filter=lfs diff=lfs merge=lfs -text
### audio editor files
#*.aup filter=lfs diff=lfs merge=lfs -text
*.au filter=lfs diff=lfs merge=lfs -text
#################################################
@rynkowsg
rynkowsg / colors.sh
Created June 19, 2021 23:36
Shell colors
#!/usr/bin/env sh
RED=$(printf '\033[31m')
GREEN=$(printf '\033[32m')
YELLOW=$(printf '\033[33m')
BLUE=$(printf '\033[34m')
BOLD=$(printf '\033[1m')
RESET=$(printf '\033[m')
@rynkowsg
rynkowsg / non-interactive-gpg.sh
Last active June 27, 2021 15:24
Example of non-interactive GPG
#!/usr/bin/env bash
# shellcheck disable=SC2155
RED=$(printf '\033[31m')
GREEN=$(printf '\033[32m')
YELLOW=$(printf '\033[33m')
BLUE=$(printf '\033[34m')
BOLD=$(printf '\033[1m')
RESET=$(printf '\033[m')
@rynkowsg
rynkowsg / dependencies.kt
Last active November 23, 2020 08:19
dependencies.kt
// ktlint-disable max-line-length
@file:Suppress("unused", "MemberVisibilityCanBePrivate")
package buildsrc
// Alternative how to define dependencies:
// https://github.com/ProteGO-Safe/android/blob/76a96eb9801b8cd9c83f4f221982cc5a93891eea/dependencies.gradle
import org.gradle.api.JavaVersion