Skip to content

Instantly share code, notes, and snippets.

@premacck
premacck / android-release-pipeline.yml
Last active January 16, 2021 18:47
Release workflow to run on push to `main` branch, which builds release & debug apps and uploads both to firebase app distribution, and notify Teams channel
name: Push on main branch
on:
push:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
@premacck
premacck / setup-emulator-auth.js
Created January 28, 2021 15:42
Script to add users from firestore emulator data to auth emulator
const admin = require('firebase-admin');
const readline = require('readline');
// Use your project's admin service account JSON, or you can hardcode your project ID in admin.initializeApp below
const serviceAccount = require('./your-project-firebase-adminsdk-abcde-1234567890.json');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
@premacck
premacck / Permissions.kt
Created February 2, 2021 04:58
Util functions for Splitties permissions
import android.Manifest
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.cancel
import kotlinx.coroutines.suspendCancellableCoroutine
import splitties.alertdialog.appcompat.alertDialog
import splitties.alertdialog.appcompat.coroutines.DialogButton
import splitties.alertdialog.appcompat.coroutines.showAndAwait
import splitties.alertdialog.appcompat.messageResource
/**
* Function to start circular tooltip queue form a fragment
*/
fun Fragment.roundTooltipOf(tooltipItem: TooltipItem, anchor: View?) = if (anchor != null) {
activity?.let { TooltipHandler.prepare(it, tooltipItem, anchor, false) }
} else null
/**
* Function to start rounded rectangular tooltip queue form a fragment
*/
@premacck
premacck / BlurBottomSheet.kt
Last active June 6, 2023 06:55
Bottom sheet dialog with dim and blur background, and curved corners. works with BlurKit (https://github.com/CameraKit/blurkit-android) and Anko (https://github.com/Kotlin/anko)
//TODO: add package info here
import android.os.Bundle
import android.annotation.SuppressLint
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.accessibility.AccessibilityNodeInfo
import android.widget.FrameLayout
import androidx.annotation.LayoutRes