Skip to content

Instantly share code, notes, and snippets.

View asajadi84's full-sized avatar
👉
Check my profile

A Sajadi asajadi84

👉
Check my profile
View GitHub Profile
@asajadi84
asajadi84 / cookie.js
Created January 2, 2023 16:31
Express JS How to Set and Destroy Cookies (Explain Like I'm 5)
View cookie.js
@asajadi84
asajadi84 / RTLFriendlySnackbar.java
Created August 12, 2019 16:15
Android RTL friendly Snackbar
View RTLFriendlySnackbar.java
public void showSnackBar (String myString, boolean longTime) {
int duration = longTime? Snackbar.LENGTH_LONG : Snackbar.LENGTH_SHORT;
Snackbar mySnackbar = Snackbar.make(thePhoto, myString, duration);
View myView = mySnackbar.getView();
//use "android.support.design.R.id.snackbar_text" instead of "com.google.android.material" if you are not using Androidx
TextView myTextView = (TextView) myView.findViewById(com.google.android.material.R.id.snackbar_text);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1)
myTextView.setTextAlignment(View.TEXT_ALIGNMENT_TEXT_START);