Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍🏭
Super busy

Shantanu Johri hanuor

👨‍🏭
Super busy
View GitHub Profile
View test.html
<a href=”#add_to_cart” class=”btnmain”>Add to Cart </a>
CSS
.btnmain {display:inline-block;color:#fff;background:#222;padding:10px 20px;}
View landing.html
<?php
global $CI; ?>
<!DOCTYPE html>
<html>
<?php $CI->load->view('common/header', array()); ?>
<link rel="stylesheet" type="text/css" href="<?= base_url('assets/css/footer.css') ?>">
<link rel="stylesheet" href="<?= base_url('/assets/css/large.css') ?>">
<link rel="stylesheet" type="text/css" href="<?= base_url('assets/css/global.css') ?>">
<body>`
<!-- Google Tag Manager (noscript) -->
View two_buckets_policy.txt
{
"Version": "2008-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::sample-bucket/profile_images*"
View bucket_policy.txt
{
"Version": "2008-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::sample-bucket/profile_images*"
@hanuor
hanuor / SampleFile.java
Last active Jun 9, 2019
Medium article
View SampleFile.java
@Override
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent intent) {
if (resultCode == AutocompleteActivity.RESULT_OK) {
Place place = Autocomplete.getPlaceFromIntent(intent);
// place.getName();
// place.getAddress();
} else if (resultCode == AutocompleteActivity.RESULT_ERROR) {
Status status = Autocomplete.getStatusFromIntent(intent);
} else if (resultCode == AutocompleteActivity.RESULT_CANCELED) {
// The user canceled the operation.
@hanuor
hanuor / PlacesFieldSelector.java
Created Feb 6, 2019
Medium article Google places SDK
View PlacesFieldSelector.java
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<>();
@hanuor
hanuor / Pz.txt
Last active Jul 6, 2018
Puzzly about app
View Pz.txt
Version 0.1.1. Guess my name? P.
@hanuor
hanuor / min_edit_dist.java
Created May 27, 2018
Minimum Edit Distance
View min_edit_dist.java
/**
* 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 / OkHttpStack.java
Created Mar 30, 2018 — forked from JakeWharton/OkHttpStack.java
A `HttpStack` implementation for Volley that uses OkHttp as its transport.
View OkHttpStack.java
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 / index.js
Created Mar 24, 2018
lazy loading.
View index.js
$(document).ready(function(){
$('#about_me').load("https://raw.githubusercontent.com/hanuor/shanjohri/gh-pages/data/about-me.md");
});