Skip to content

Instantly share code, notes, and snippets.

View shercoder's full-sized avatar

Pardeep Singh Sanghera shercoder

View GitHub Profile
@shercoder
shercoder / gist:5647795
Last active December 17, 2015 17:39
Bash Aliases that I think are useful
# I just installed SanDisk 6Gig/s SSD in my Sony VAIO Laptop today.
# I also installed Xubuntu 13.04 on it as well. I have been
# using Ubuntu from almost a year now. I was actually kind of
# getting tired of Ubuntu, it was causing a lot of issues. And yes I
# am well aware of the fact that Xubuntu is technically Ubuntu.
# Anyways that's not why I am writing this gist. I am just creating
# this gist so I can have a reference to my bash aliases file
# and so that other's can use it as an example as well.
@shercoder
shercoder / gist:5906915
Last active December 19, 2015 05:49
Cool linux stuff
  • Termination status of the last executed program available via a shell variable named $?
@shercoder
shercoder / gist:5992823
Last active December 19, 2015 17:38
Linux Commands

##Create public keys

  • Generate a public key
ssh-keygen -t dsa
  • Now put public key to your remote server
scp .ssh/id_dsa.pub singh@server.com:
  • Install public key on remote server
set wrapmargin=8
set ruler
set number
" ts = tabstop, sw = shiftwidth, sts = softtabstop
set ts=4 sw=4 sts=2
" expandtab: appropriate number of spaces in insert mode
set expandtab

Java 7 (JDK, JRE, java browser plugin)

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
s
package com.example.yourapp;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import com.example.yourapp.AuthenticationModel;
import retrofit.client.Header;
import retrofit.client.OkClient;

Docker Cheat Sheet

Why

Why Should I Care (For Developers)

"Docker interests me because it allows simple environment isolation and repeatability. I can create a run-time environment once, package it up, then run it again on any other machine. Furthermore, everything that runs in that environment is isolated from the underlying host (much like a virtual machine). And best of all, everything is fast and simple."

TL;DR, I just want a dev environment

  • To list dependencies: gradlew -q dependencies
#!/bin/bash
# Author: Tobias Preuss
# Version: 2014-08-01
echo "Creating symbolic links in Android SDK folder"
echo "============================================="
echo
if [ -z "$ANDROID_HOME" ] ; then
@shercoder
shercoder / README.md
Last active August 29, 2015 14:18 — forked from polbins/README.md

Android REST Controller with Cache-Control

Android REST Controller with Simple Cache Control Headers using Retrofit 1.9.0 + OkHttp 2.2.0