Skip to content

Instantly share code, notes, and snippets.

View rinav's full-sized avatar
🏗️
building...

Rinav rinav

🏗️
building...
View GitHub Profile
@rinav
rinav / multiple_ssh_setting.md
Created August 4, 2022 20:59 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
// error image in the phone
Glide.with(context)
.load("yourImageURL")
.placeholder(R.drawable.ic_image)
.error(R.drawable.ic_error)
.into(imageView)
// load another image error
Glide.with(context)
.load("yourImageURL")
@rinav
rinav / glideImageLoadUnknownSize.kt
Created June 26, 2019 14:24
Glide issue when both width and height are unknown
/*
* How to effectively use Glide to load Images in both RecyclerView and normal ImageView in layout, when we do not know the image size before hand.
* My ImageViews are both wrap-content, also my REST api does not provide size values in responses.
* Moreover I have many different image sizes in views.
*/
... // Somewhere in my Adapter
internal var isImageSizeFound = false
inner class ShowsListViewHolder internal constructor(itemView: View) :
@rinav
rinav / Example.kt
Created June 21, 2019 12:12 — forked from radoyankov/Example.kt
Easy Spannable on Kotlin
val spanned = spannable{ bold("some") + italic(" formatted") + color(Color.RED, " text") }
val nested = spannable{ bold(italic("nested ")) + url("www.google.com", "text") }
val noWrapping = bold("no ") + sub("wrapping ) + sup("also ") + "works"
text_view.text = spanned + nested + noWrapping
@rinav
rinav / docker-tricks.md
Created March 10, 2019 19:02
docker quick tricks

remove images, filtering by repo name/tag

will run in fish shell as well docker image ls --filter reference=mariadb --quiet | xargs docker image rm

same as above but wont work in fish shell because of $ docker image rm $(docker image ls --filter reference=docker --quiet)

@rinav
rinav / android_hex_opacity_values.md
Last active December 4, 2018 11:02
Set alpha/opacity value to color on xml drawable

Hex Opacity Values

Example

  1. 0 -> 0 (this is completely transparent)
  2. 32 -> 20 (this is your opacity)
  3. 255 -> FF (this is completely opaque)

Complete List

{
"info": {
"name": "Login with Amazon (OAuth)",
"_postman_id": "c1a33327-55de-7a7c-0103-44829c86b65a",
"description": "A small collection of sample requests in the OAuth flow for LWA authentication.",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "1 LWA Get Authorization Code",
@rinav
rinav / FirebaseToFirestore.js
Created January 5, 2018 15:25 — forked from JoeRoddy/FirebaseToFirestore.js
Convert Firebase Database JSON to Firestore Collections
var db = firebase.firestore();
var content = require("./sourceData.json");
content &&
Object.keys(content).forEach(contentKey => {
const nestedContent = content[contentKey];
if (typeof nestedContent === "object") {
Object.keys(nestedContent).forEach(docTitle => {
firebase
.firestore()
@rinav
rinav / 60-jetbrains.conf
Created October 23, 2017 12:17 — forked from bittner/60-jetbrains.conf
Inotify configuration for IntelliJ IDEA (PhpStorm, PyCharm, RubyMine, WebStorm). Create this file with e.g. `sudo vim /etc/sysctl.d/60-jetbrains.conf`
# Set inotify watch limit high enough for IntelliJ IDEA (PhpStorm, PyCharm, RubyMine, WebStorm).
# Create this file as /etc/sysctl.d/60-jetbrains.conf (Debian, Ubuntu), and
# run `sudo service procps start` or reboot.
# Source: https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit
#
# More information resources:
# -$ man inotify # manpage
# -$ man sysctl.conf # manpage
# -$ cat /proc/sys/fs/inotify/max_user_watches # print current value in use
@rinav
rinav / android avd launcher
Last active May 25, 2017 10:35
Create a launcher to launch the specified AVD to deal with the famous lib64stdc++6 conflict with the system libs on linux systems
# create a launcher on your prefered Desktop Environment, mine is XFCE and add the below line to 'command' section.
# next, Select an icon for the launcher and thats it.
``` fish
/run/media/rinav/sdk/android-sdk/tools/emulator -avd Nexus_6P_API_25 -use-system-libs
```
OR
you can also add the following environment to your shell. I am using fish shell, so below is the syntax for the same