Skip to content

Instantly share code, notes, and snippets.

View yusufkandemir's full-sized avatar

Yusuf Kandemir yusufkandemir

View GitHub Profile
@yusufkandemir
yusufkandemir / time-string.ts
Created November 1, 2021 13:54
Typescript time string type using template literal types
// prettier-ignore
type Hours = '00' | '01' | '02' | '03' | '04' | '05' | '06' | '07' | '08' | '09' | '10' | '11' | '12' | '13' | '14' | '15' | '16' | '17' | '18' | '19' | '20' | '21' | '22' | '23';
// prettier-ignore
type Minutes = '00' | '01' | '02' | '03' | '04' | '05' | '06' | '07' | '08' | '09' | '10' | '11' | '12' | '13' | '14' | '15' | '16' | '17' | '18' | '19' | '20' | '21' | '22' | '23' | '24' | '25' | '26' | '27' | '28' | '29' | '30' | '31' | '32' | '33' | '34' | '35' | '36' | '37' | '38' | '39' | '40' | '41' | '42' | '43' | '44' | '45' | '46' | '47' | '48' | '49' | '50' | '51' | '52' | '53' | '54' | '55' | '56' | '57' | '58' | '59';
export type TimeString = `${Hours}:${Minutes}`;
@yusufkandemir
yusufkandemir / 1_quasar-sentry-firebase-deployment.yml
Last active March 11, 2024 10:53
Github Actions: Deploy a Quasar Framework app to Firebase Hosting and create a Sentry release
# .github/workflows/hosting.yml
name: Hosting
on:
# You can use other strategies here, check: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#on
push:
branches:
- production
jobs:
@yusufkandemir
yusufkandemir / README.md
Created June 23, 2020 18:25
Quasar + FCM(Firebase Cloud Messaging) Setup

What to do next?

Manage The Subscription State

Manage the subscription state using localStorage, IndexedDB, or a server-side solution(e.g. in Firestore, store per-user), depending on the flow of your app.

Notification UI/UX

Create a notification section in settings, in navbar or just prompt it directly(not recommended, bad UX). On UI interaction such as a subscribe button, call subscribeNotifications with the related parameters(subscribe = true/false, token), then persist the notification state.

Create Notifications