Skip to content

Instantly share code, notes, and snippets.

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

Rinav rinav

🏗️
building...
  • HTC Global Services Pvt Ltd
  • Bangalore
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 / 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
{
"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 / DistanceCalculator.java
Created July 13, 2016 15:27 — forked from danielgomezrico/DistanceCalculator.java
Java / Android - calculate the distance between two coordinates with great circle formula.
import static java.lang.Math.acos;
import static java.lang.Math.cos;
import static java.lang.Math.sin;
/**
* Calculate distance between coordinates.
*/
public class DistanceCalculator {
static double PI_RAD = Math.PI / 180.0;
@rinav
rinav / android_toolbar_color_changes.txt
Created June 23, 2016 13:01
Android Toolbar text and popup color tests
Toolbar text and popup color tests
1)
Input:
app:theme="@style/ThemeOverlay.AppCompat.Light"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
Output:
Toolbar: black text, primaryColor background
Popup: black text, white background
@rinav
rinav / LocalBroadcastExampleActivity.java
Created May 27, 2016 07:36 — forked from Antarix/LocalBroadcastExampleActivity.java
Simple Example of using LocalBroadcastManager in Android
import android.app.Activity;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.os.IBinder;
import android.support.v4.content.LocalBroadcastManager;
@rinav
rinav / Interceptor.java
Created January 20, 2016 11:18 — forked from alex-shpak/Interceptor.java
Refreshing OAuth token with okhttp interceptors. All requests will wait until token refresh finished, and then will continue with the new token.
private class HttpInterceptor implements Interceptor {
@Override
public Response intercept(Chain chain) throws IOException {
Request request = chain.request();
//Build new request
Request.Builder builder = request.newBuilder();
builder.header("Accept", "application/json"); //if necessary, say to consume JSON