Skip to content

Instantly share code, notes, and snippets.

@hanuor
hanuor / json
Last active February 27, 2017 04:57
Sample Json
[{
"name":"Husky",
"species": "Dog"
},{
"name":"Monty",
"species": "Spider"
@hanuor
hanuor / json
Last active February 27, 2017 05:34
json sample
[{
"name":"Bomrra",
"species": "Bull"
},{
"name":"Apple",
"species": "Dog"
@hanuor
hanuor / sampleJson
Created May 19, 2017 04:00
This is a sample JSON
{
"id": "1",
"type": "donut",
"name": "Cake",
"ppu": 0.55
}
@hanuor
hanuor / kotlin-guide
Created May 19, 2017 05:20
Kotlin guide links
https://github.com/hanuor/android-kotlin-samples/blob/master/README.md#findviewbyid
https://github.com/hanuor/android-kotlin-samples/blob/master/README.md#getting-started
https://github.com/hanuor/android-kotlin-samples/blob/master/README.md#onclicklisteners
https://github.com/hanuor/android-kotlin-samples/blob/master/README.md#starting-a-new-activity
https://github.com/hanuor/android-kotlin-samples/blob/master/README.md#asynctasks
@hanuor
hanuor / demo.kt
Created October 10, 2017 11:36
Hey there
var gist = Intent(this@MainActivity, Duplicate::class.java)
@hanuor
hanuor / index.js
Created March 24, 2018 15:57
lazy loading.
$(document).ready(function(){
$('#about_me').load("https://raw.githubusercontent.com/hanuor/shanjohri/gh-pages/data/about-me.md");
});
@hanuor
hanuor / OkHttpStack.java
Created March 30, 2018 04:45 — forked from JakeWharton/OkHttpStack.java
A `HttpStack` implementation for Volley that uses OkHttp as its transport.
import com.android.volley.toolbox.HurlStack;
import com.squareup.okhttp.OkHttpClient;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
/**
* An {@link com.android.volley.toolbox.HttpStack HttpStack} implementation which
* uses OkHttp as its transport.
*/
@hanuor
hanuor / min_edit_dist.java
Created May 27, 2018 16:57
Minimum Edit Distance
/**
* Date 07/07/2014
* @author Tushar Roy
*
* Given two strings how many minimum edits(update, delete or add) is needed to convert one string to another
*
* Time complexity is O(m*n)
* Space complexity is O(m*n)
*
@hanuor
hanuor / Pz.txt
Last active July 6, 2018 08:09
Puzzly about app
Version 0.1.1. Guess my name? P.
@hanuor
hanuor / PlacesFieldSelector.java
Created February 6, 2019 06:22
Medium article Google places SDK
public class PlacesFieldSelector {
private final List<PlaceField> placeFields;
public PlacesFieldSelector() {
this(Arrays.asList(Place.Field.values()));
}
public PlacesFieldSelector(List<Place.Field> validFields) {
placeFields = new ArrayList<>();