Skip to content

Instantly share code, notes, and snippets.

View Debdutta-Panda's full-sized avatar

Debdutta Panda Debdutta-Panda

View GitHub Profile
@Debdutta-Panda
Debdutta-Panda / create_access_token.js
Created July 22, 2024 10:07
Firebase new v1 api to send push notification
var { google } = require("googleapis");
var MESSAGING_SCOPE = "https://www.googleapis.com/auth/firebase.messaging";
var SCOPES = [MESSAGING_SCOPE];
function getAccessToken() {
return new Promise(function (resolve, reject) {
var jwtClient = new google.auth.JWT(
"[email protected]",
null,
"put_your_private_key_from_json",
SCOPES,
import android.app.Application
import android.content.Context
import android.net.ConnectivityManager
import android.net.Network
import android.net.NetworkCapabilities
import android.net.NetworkRequest
import kotlinx.coroutines.*
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.asSharedFlow
import java.io.IOException
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello, I am a TextView" />
<Button android:id="@+id/button"
@Debdutta-Panda
Debdutta-Panda / MainActivity.kt
Created July 22, 2022 03:49
Jetpack Compose pointerInterOpFilter
package com.debduttapanda.pointerinteropfilter
import android.os.Bundle
import android.util.Log
import android.view.MotionEvent
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
@Debdutta-Panda
Debdutta-Panda / MainActivity.kt
Created July 20, 2022 19:20
Nested Scroll in Jetpack Compose
package com.debduttapanda.nestedscroll
import android.os.Bundle
import android.util.Log
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.gestures.Orientation
import androidx.compose.foundation.gestures.scrollable
@Debdutta-Panda
Debdutta-Panda / MainActivity.kt
Created July 19, 2022 16:33
Jetpack Compose Vertical Slider
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.background
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.*
import androidx.compose.material.*
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
@Debdutta-Panda
Debdutta-Panda / MainActivity.kt
Created July 9, 2022 16:56
Flower on jetpack compose canvas
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material.Slider
import androidx.compose.material.Surface
@Debdutta-Panda
Debdutta-Panda / script_and_code
Created July 8, 2022 03:58
AWS VPC EC2 inter communication
sudo su
apt update
apt upgrade -y
apt install nginx -y
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
apt install nodejs -y
apt install build-essential -y
npm install pm2@latest -g
cd /var/www/html
mkdir app
@Debdutta-Panda
Debdutta-Panda / Dialog.kt
Last active June 23, 2022 15:51
Dialoger mechanism
if(vm.dialoger.enabled.value){
Dialog(
onDismissRequest = {
vm.dialoger.onDone("dismiss")
},
properties = DialogProperties(
dismissOnBackPress = true,
dismissOnClickOutside = true
)
) {
@Debdutta-Panda
Debdutta-Panda / Dialog.kt
Created June 23, 2022 15:37
Dialog in jetpack compose
if(vm.isDialogOpen.value){
Dialog(
onDismissRequest = {
vm.dismissDialog()
},
properties = DialogProperties(
dismissOnBackPress = true,
dismissOnClickOutside = true
)
) {