Skip to content

Instantly share code, notes, and snippets.

View tanishq14developer's full-sized avatar
🎯
Focusing

Tanishq Chawda tanishq14developer

🎯
Focusing
View GitHub Profile
@tanishq14developer
tanishq14developer / AndroidManifest.xml
Created September 20, 2021 12:56 — forked from hugocore/AndroidManifest.xml
Android Deep Linking Activity
<activity
android:name="com.your.app.activity.ParseDeepLinkActivity"
android:alwaysRetainTaskState="true"
android:launchMode="singleTask"
android:noHistory="true"
android:theme="@android:style/Theme.Translucent.NoTitleBar">
<intent-filter android:autoVerify="true">
<data android:scheme="http" android:host="yourdomain.com" />
<data android:scheme="https" android:host="yourdomain.com" />
@tanishq14developer
tanishq14developer / YouTubePlayerSupportFragmentX.java
Created January 16, 2022 11:58 — forked from medyo/YouTubePlayerSupportFragmentX.java
Solution: YouTubePlayerSupportFragment that supports androidx
package com.google.android.youtube.player;
/**
* Please create this directories schema com.google.android.youtube.player and post the file there
*/
import android.os.Bundle;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
@tanishq14developer
tanishq14developer / recover-deleted-branch.sh
Created May 25, 2022 20:17 — forked from umayr/recover-deleted-branch.sh
How to recover a deleted branch
## Pre-requisite: You have to know your last commit message from your deleted branch.
git reflog
# Search for message in the list
# a901eda HEAD@{18}: commit: <last commit message>
# Now you have two options, either checkout revision or HEAD
git checkout a901eda
# Or
git checkout HEAD@{18}
@tanishq14developer
tanishq14developer / node_nginx_ssl.md
Created July 5, 2022 09:08 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@tanishq14developer
tanishq14developer / AccessTokenAuthenticator.kt
Created November 25, 2022 16:47 — forked from naturalwarren/AccessTokenAuthenticator.kt
An OkHttp Authenticator that performs token refreshes.
/**
* Authenticator that attempts to refresh the client's access token.
* In the event that a refresh fails and a new token can't be issued an error
* is delivered to the caller. This authenticator blocks all requests while a token
* refresh is being performed. In-flight requests that fail with a 401 are
* automatically retried.
*/
class AccessTokenAuthenticator(
private val tokenProvider: AccessTokenProvider
) : Authenticator {
abstract class SharedPreferenceLiveData<T> extends LiveData<T> {
SharedPreferences sharedPrefs;
String key;
T defValue;
public SharedPreferenceLiveData(SharedPreferences prefs, String key, T defValue) {
this.sharedPrefs = prefs;
this.key = key;
this.defValue = defValue;
@tanishq14developer
tanishq14developer / Speedometer.kt
Created October 19, 2023 16:21 — forked from saurabharora90/Speedometer.kt
Speedometer in Jetpack Compose
import androidx.annotation.FloatRange
import androidx.compose.animation.core.Animatable
import androidx.compose.animation.core.LinearOutSlowInEasing
import androidx.compose.animation.core.tween
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.requiredSize
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Slider
@tanishq14developer
tanishq14developer / TextTweern.kt
Created July 20, 2024 09:35 — forked from ardakazanci/TextTweern.kt
Text Tween Animation
val colors = listOf(
Color(0xFFF3C623),
Color(0xFFF2AAAA),
Color(0xFFF37121),
Color(0xFFF2AAAA),
Color(0xFF8FC0A9),
Color(0xFF84A9AC),
Color(0xFFD54062),
Color(0xFF8FC0A9)
)