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 / proguard.pro
Last active May 12, 2016 18:02
Android proguard retrofit butterknife twitter fabric digits fresco facebook android-support android-google-play-services ok-http ok-io
#-------------------App Package-------------
-keep class com.mymodels.package.** { *;}
-dontwarn com.mymodels.package.**
#-----------General Keep attr-----------
-keepattributes Exceptions
-keepattributes InnerClasses
-keepattributes Signature
-keepattributes Deprecated
@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 / oops.swift
Last active December 2, 2016 21:10
inheritance in swift
//: Playground - noun: a place where people can play
import UIKit
enum ServerError: Error {
case SERVER_NOT_INITIALIZED(String)
}
class Server {
@silentsudo
silentsudo / callback.playground
Created December 13, 2016 10:03
Callback and closure test in playground
//: Playground - noun: a place where people can play
import UIKit
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
var hello: () -> String = {
return "Hello!"
}
@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;
@silentsudo
silentsudo / go_install.sh
Created January 11, 2017 16:17
Go Installation Libraries
#!/bin/sh
#GET current working directory
CURRENT_DIR=`pwd`
echo "GOPATH is pointing to ${CURRENT_DIR}"
#Export GOPATH for current working directory
export GOPATH=${CURRENT_DIR}
#Change Directory permission to executable
chmod +x ${GOPATH}
go get -u -v github.com/gorilla/mux
go get -u -v github.com/gorilla/handlers
go get -u -v github.com/dgrijalva/jwt-go
#!/bin/sh
#GET current working directory
CURRENT_DIR=`pwd`
echo "GOPATH is pointing to ${CURRENT_DIR}"
#Export GOPATH for current working directory
export GOPATH=${CURRENT_DIR}
echo "Starting server at http://localhost:9096"