Skip to content

Instantly share code, notes, and snippets.

View skbhati199's full-sized avatar
🎯
Focusing in EV

Sonu Kumar skbhati199

🎯
Focusing in EV
View GitHub Profile
@skbhati199
skbhati199 / payment_details
Created June 23, 2024 14:22 — forked from ramanathanrv/payment_details
Payment Details for Juspay Browser Fragment
import in.juspay.godel.core.PaymentDetails;
// setup the initial parameters for the browser fragment
PaymentDetails paymentDetails = new PaymentDetails();
paymentDetails.setOrderId(rechargeRequest.getPaymentId());
paymentDetails.setMerchantId("juspay_recharge");
// clientId uniquely identifies the weblab configuration rules to apply
paymentDetails.setClientId("juspay_recharge_android");
// customerId uniquely identifies a customer
paymentDetails.setCustomerId(rechargeRequest.getMobileNumber());
@skbhati199
skbhati199 / gist:8b8fedd82eb22be98227db258769becd
Created February 21, 2024 03:54
React Native Push Notification
Follow These Steps:
Step1:
yarn add @react-native-firebase/app
yarn add @react-native-firebase/messaging
cd ios/ && pod install
Step2:
Configure firebase in IOS side.
Download the GoogleService-Info.plist file
@skbhati199
skbhati199 / .ps1
Created August 11, 2023 14:22
how to move all zip files to folder all directories to another folder powershell
Get-ChildItem -Path "*.zip" -Recurse -File | Move-Item -Destination ./destination
@skbhati199
skbhati199 / 03_practice-exercise-1.ipynb
Created March 21, 2023 14:01
03_Practice+Exercise+1.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
class AuthToken(context: Context) : Interceptor {
var cont = context
override fun intercept(chain: Interceptor.Chain): Response {
val sp = cont.getSharedPreferences("app_data", 0)
if (sp!!.getLong("expires_in", 0) - sp.getLong("time_delta", 0) - System.currentTimeMillis() / 1000 <= 60 && !sp.getString("refresh_token", "")!!.isBlank()) updateAccessToken(cont)
val initialRequest = if (sp.getLong("expires_in", 0) - sp.getLong("time_delta", 0) - System.currentTimeMillis() / 1000 <= 60 && !sp.getString("refresh_token", "")!!.isBlank()) {
updateAccessToken(cont)
requestBuilder(chain)
} else {
@skbhati199
skbhati199 / bitbucket-pipelines.yml
Created July 7, 2022 21:27 — forked from GuilhE/bitbucket-pipelines.yml
Bitbucket pipeline for Android Firebase App Distribution
image: bitbucketpipelines/android-ci-image
pipelines:
tags:
firebase-*:
- step:
name: Setup & Deploy
image: java:8 #remove this line if plugin "com.starter.easylauncher" isn't used
caches:
- android-sdk
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.android.hltherasocialnetwork.provider"
android:exported="false"
android:grantUriPermissions="true"
tools:replace="android:authorities">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_provider_paths"
tools:replace="android:resource" />
//Dialog for Choose photos from Camera
private fun chooseFromCamera() {
val intent = Intent(this, TakeImageUtil::class.java)
intent.putExtra("from", "camera")
this.startActivityForResult(intent, Constants.REQUEST_CAMERA_IMAGE_CODE)
}
if (requestCode == Constants.REQUEST_CAMERA_IMAGE_CODE || requestCode == Constants.REQUEST_GALLERY_eIMAGE_CODE) {
@skbhati199
skbhati199 / RealPathUtil2.java
Created February 23, 2022 04:59
RealPathUtil2
import android.annotation.SuppressLint
import android.content.ContentResolver
import android.content.ContentUris
import android.content.Context
import android.database.Cursor
import android.net.Uri
import android.os.Build
import android.os.Environment
import android.provider.DocumentsContract
@skbhati199
skbhati199 / TakeImageUtil.java
Created February 23, 2022 04:47
Take Camera
import android.Manifest
import android.app.Activity
import android.os.Bundle
import android.content.Intent
import android.net.Uri
import android.os.Environment
import androidx.core.content.FileProvider
import java.io.File
import android.content.pm.PackageManager