This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun onTaskRemoved(rootIntent: Intent) { | |
val restartServiceIntent = Intent(applicationContext, EndlessService::class.java).also { | |
it.setPackage(packageName) | |
}; | |
val restartServicePendingIntent: PendingIntent = PendingIntent.getService(this, 1, restartServiceIntent, PendingIntent.FLAG_ONE_SHOT); | |
applicationContext.getSystemService(Context.ALARM_SERVICE); | |
val alarmService: AlarmManager = applicationContext.getSystemService(Context.ALARM_SERVICE) as AlarmManager; | |
alarmService.set(AlarmManager.ELAPSED_REALTIME, SystemClock.elapsedRealtime() + 1000, restartServicePendingIntent); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<service android:name=".EndlessService"" android:stopWithTask="false" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
az login |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
az vm create --resource-group nym-node-burn --name nym --image UbuntuLTS --admin-username robertohuertasm --admin-password hZRAAJpjkwZ4KW --nics "/subscriptions/e3871cc7-3444-42ad-b4b8-5ee6bdbf6d54/resourceGroups/nym-node-burn/providers/Microsoft.Network/networkInterfaces/nym-nic" --location westeurope --size "Standard_B1s" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm init svelte@next sveltekit-cognito-auth | |
# I'm choosing the Skeleton project, | |
# opting out of TypeScript for this tutorial | |
# and using ESlint and Prettier support | |
cd sveltekit-cogniton-auth | |
npm install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
// we'll edit this later | |
let user; | |
</script> | |
<svelte:head> | |
<title>SvelteKit - Cognito</title> | |
</svelte:head> | |
{#if !user} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm run dev -- --open |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm i sk-auth --save |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { SvelteKitAuth, Providers } from 'sk-auth'; | |
// this is the domain we set up in our Cognito Pool | |
const DOMAIN = 'sveltekit.auth.eu-west-1.amazoncognito.com'; | |
// these are the configuration seetings for our OAUTH2 provider | |
const config = { | |
accessTokenUrl: `https://${DOMAIN}/oauth2/token`, | |
profileUrl: `https://${DOMAIN}/oauth2/userInfo`, | |
authorizationUrl: `https://${DOMAIN}/oauth2/authorize`, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VITE_CLIENT_ID=<your_client_id> | |
VITE_CLIENT_SECRET=<your_client_secret> |