Skip to content

Instantly share code, notes, and snippets.

View silentsudo's full-sized avatar

Ashish Agre silentsudo

  • Bangalore
View GitHub Profile
@silentsudo
silentsudo / RetrieveAccessTokenActivity.java
Created March 5, 2016 12:36 — forked from ianbarber/RetrieveAccessTokenActivity.java
A quick example of retrieving an access token with GoogleAuthUtil
package com.google.devrel.samples.gmstest.app;
import android.app.Activity;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
@silentsudo
silentsudo / android_maps_mylocation_button.md
Created March 17, 2016 09:57 — forked from bdiegel/android_maps_mylocation_button.md
Android Maps v2 MyLocation Button Position

Change MyLocation button position

It's easy to enable Zoom and MyLocation buttons but annoying to change where they overlay the Map.

Options

  1. Use Map padding (are that will not overlap map controls)
  2. Disable them and implement your own (probably safer than hack below)
  3. Find the buttons by id and alter the layout params

Resources:

@silentsudo
silentsudo / gist:580f17a5f1733a20e68164061b27c01e
Created July 7, 2016 06:16 — forked from lttlrck/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@silentsudo
silentsudo / MultipartFileSender
Created January 6, 2017 08:48 — forked from davinkevin/MultipartFileSender
Implementing HTTP byte-range requests in Spring 4 and other framework...
package lan.dk.podcastserver.utils.multipart;
import lan.dk.podcastserver.utils.MimeTypeUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/* Copyright 2013 Google Inc.
Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0.html */
package com.example.latlnginterpolation;
import android.animation.ObjectAnimator;
import android.animation.TypeEvaluator;
import android.animation.ValueAnimator;
import android.annotation.TargetApi;
import android.os.Build;
@silentsudo
silentsudo / multiple_ssh_setting.md
Created October 16, 2017 10:02 — 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"
@silentsudo
silentsudo / gitconfig
Created February 18, 2018 18:37 — forked from lkopocinski/gitconfig
Git branches aliases
[alias]
po = !git remote prune origin
dm = !git branch --merged | grep -E -v \"master|develop\" | xargs git branch -d
@silentsudo
silentsudo / deleteMerged.sh
Created February 18, 2018 18:37 — forked from lkopocinski/deleteMerged.sh
Git command for deleting merged branches
git branch --merged | grep -E -v "master|develop" | xargs git branch -d
@silentsudo
silentsudo / pruneDryRun.sh
Created February 18, 2018 18:37 — forked from lkopocinski/pruneDryRun.sh
Git command for reporting what would be pruned
git remote prune origin --dry-run
@silentsudo
silentsudo / pruneRemote.sh
Created February 18, 2018 18:37 — forked from lkopocinski/pruneRemote.sh
Git command for pruning remote branches
git remote prune origin