Skip to content

Instantly share code, notes, and snippets.

View dturner's full-sized avatar
🎧

Don Turner dturner

🎧
View GitHub Profile
@dturner
dturner / TERMS.md
Created July 2, 2026 17:12
Terms of Service — Personal Finance Analysis (self-hosted)

Terms of Service — Personal Finance Analysis (self-hosted)

Last updated: 2 July 2026

1. Nature of the application

This application is a private, non-commercial, self-hosted tool operated by a single individual (the "Operator") for retrieving and analysing the Operator's own bank account data via the Enable Banking API. It is not a product or service offered to the public, has no customers, and accepts no registrations.

2. Eligible users

@dturner
dturner / PRIVACY.md
Created July 2, 2026 17:12
Privacy Policy — Personal Finance Analysis (self-hosted)

Privacy Policy — Personal Finance Analysis (self-hosted)

Last updated: 2 July 2026

What this application is

This is a private, non-commercial, self-hosted tool operated by a single individual (the "Operator") to retrieve and analyse the Operator's own bank account data via the Enable Banking API. It is not offered as a service to anyone else and has no users other than the Operator.

Data collected

@dturner
dturner / SPEAKER_NOTES.md
Last active May 8, 2026 20:07
Careers for Teens — presentation

Speaker notes — What kind of life do you want?

Total: ~20 mins. Keep it conversational. Pause for reactions. Skip anything that's already landed.


1. Title — "What kind of life do you want?" (~1 min)

  • This isn't a careers lecture. It's a chat about the life you want first, the job second.
  • Promise: 20 minutes, no quiz, no pressure.
  • Tee them up: "I want you to have information I didn't have at your age."
@dturner
dturner / nav_uri_parameters.md
Last active September 13, 2024 14:04
AndroidX Navigation URI parameters
Path parameter Query parameter
Used for required arguments optional arguments
collections (arrays and lists)
Example fields val id: String
val code: Int?
val color: String? = null
val variants: List<String> = emptyList()
Generated URL format /{id}/{code} ?color={color}&variants={variant1}&variants={variant2}
Example URL product/ABC/123 product?color=red&amp;variants=small&amp;variants=medium
@dturner
dturner / BookmarksViewModel.kt
Created December 13, 2022 11:11
BookmarksViewModel - After adding domain layer
/* Copyright 2022 Google LLC.
SPDX-License-Identifier: Apache-2.0 */
class BookmarksViewModel @Inject constructor(
getSaveableNewsResources: GetSaveableNewsResourcesUseCase
) : ViewModel() {
val feedState: StateFlow<NewsFeedUiState> = getSaveableNewsResources()
.map { newsResources ->
newsResources.filter(SaveableNewsResource::isSaved)
@dturner
dturner / GetSaveableNewsResourcesUseCase.kt
Created December 13, 2022 11:09
Adding GetSaveableNewsResourcesUseCase
/* Copyright 2022 Google LLC.
SPDX-License-Identifier: Apache-2.0 */
class GetSaveableNewsResourcesUseCase @Inject constructor(
private val newsRepository: NewsRepository,
userDataRepository: UserDataRepository
) {
private val bookmarks = userDataRepository.userDataStream.map { userData ->
userData.bookmarkedNewsResources
}
@dturner
dturner / BookmarksViewModel.kt
Created December 13, 2022 11:07
BookmarksViewModel - Before adding domain layer
/* Copyright 2022 Google LLC.
SPDX-License-Identifier: Apache-2.0 */
class BookmarksViewModel @Inject constructor(
newsRepository: NewsRepository,
private val userDataRepository: UserDataRepository
) : ViewModel() {
// #1. Obtain a list of bookmarks.
private val bookmarks: StateFlow<Set<String>> =
@dturner
dturner / MyApplication.kt
Created March 24, 2022 16:02
Reporting performance class to Firebase analytics
class MyApplication : Application() {
private lateinit var devicePerf: DevicePerformance
private lateinit var firebaseAnalytics: FirebaseAnalytics
override fun onCreate() {
devicePerf = DevicePerformance.create(this)
firebaseAnalytics = Firebase.analytics
firebaseAnalytics.setUserProperty(
@dturner
dturner / OptimalVideoSettings.kt
Created March 24, 2022 16:01
Example of using performance class to determine video encoding settings
class OptimalVideoSettings(context: Context){
private val devicePerf: DevicePerformance = DevicePerformance.create(context)
val encodeHeight by lazy {
when (devicePerf.mediaPerformanceClass) {
Build.VERSION_CODES.S -> 1080 // On performance class 12 use 1080p
Build.VERSION_CODES.R -> 720 // On performance class 11 use 720p
else -> 480
}
#!/bin/bash
# Script which copies libraries from the FFmpeg build folder to a
# folder within an Android Studio project in the correct structure
# Should be run from the FFmpeg root folder.
# Check that a target directory has been supplied
if [ -z "$1" ]
then
echo "Usage: copy_to_project.sh <target directory>. Example: copy_to_project.sh \${ANDROID_PROJECT}/app/libs"