Skip to content

Instantly share code, notes, and snippets.

View mrsid96's full-sized avatar
😎
Open Source Lover

Sidharth Patnaik mrsid96

😎
Open Source Lover
View GitHub Profile
Attach mobile via USB and type:
## adb tcpip 5555
To find the mobile ip type:
## adb shell ip -f inet addr show wlan0
The ip address will be shown in second line like this:
## inet 192.168.1.233/24 brd 192.168.1.255 scope global wlan0
where 192.168.1.233 is the ip address of your mobile.
@mrsid96
mrsid96 / gist:7018fc87c7549c5b99dbf5f26cc6fb2e
Created June 18, 2017 17:14
Adding Gravatar images based on emails in Android
String hash = MD5Util.md5Hex(email);
String gravatarUrl = "http://www.gravatar.com/avatar/" + hash + "?s=204&d=404";
Picasso.with(mContext)
.load(gravatarUrl)
.placeholder(R.drawable.avatar_empty)
.into(holder.userImageView);
@mrsid96
mrsid96 / googleProfileImg.txt
Last active June 22, 2017 01:44
Get the public photo of person by email
URL to Fetch : http://picasaweb.google.com/data/entry/api/user/<hereYourUserIdOrYourEmail>?alt=json
Php Code Snippet:
<?php
$json = file_get_contents('http://picasaweb.google.com/data/entry/api/user/dknayakbu@gmail.com?alt=json');
$result = json_decode($json);
print_r($result->{'entry'}->{'gphoto$thumbnail'}->{'$t'});
@mrsid96
mrsid96 / gist:54181bc6bbf2c05376964e8ef7349cbf
Created September 1, 2017 04:54
Postal Pincode Search
http://postalpincode.in/api/pincode/760010
@mrsid96
mrsid96 / gist:234b03c006c9d4baa6ca9d80ece06e5d
Created May 24, 2018 03:59
Stuck at 0% apt-get update
sudo nano /etc/gai.conf
change line ~54 to uncomment the following:
precedence ::ffff:0:0/96 100
write and quit
@mrsid96
mrsid96 / textarea
Created May 30, 2018 12:02
Textarea in android
xml
<android.support.design.widget.TextInputLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/shipper_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginStart="8dp"
@mrsid96
mrsid96 / Installer.sh
Last active June 8, 2018 08:20
Quick Start setup
sudo apt-get update
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
echo deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
sudo apt-get update
sudo apt-get install -y mongodb-org
sudo service mongod start
sudo service mongod stop
sudo service mongod restart
sudo apt-get install -y ffmpeg
sudo apt-get install -y sox
@mrsid96
mrsid96 / jsArrayCSV.js
Created November 1, 2018 10:02
Create a csv file from js array from frontend
var rows = [["name1", "city1", "some other info"], ["name2", "city2", "more info"]];
var csvContent = "data:text/csv;charset=utf-8,";
rows.forEach(function(rowArray){
let row = rowArray.join(",");
csvContent += row + "\r\n";
});
var encodedUri = encodeURI(csvContent);
var link = document.createElement("a");
link.setAttribute("href", encodedUri);
@mrsid96
mrsid96 / cardViewRipple.xml
Created November 2, 2018 22:17
Ripple effect in cardview tap
android:foreground="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
@mrsid96
mrsid96 / build.gradle
Created January 15, 2019 14:22 — forked from albinmathew/build.gradle
An example configuration for proguard-rules.pro
android {
compileSdkVersion 22
buildToolsVersion "22.0.0"
defaultConfig {
applicationId "com.abc.example"
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName "1.0"