Skip to content

Instantly share code, notes, and snippets.

View kgundula's full-sized avatar

Khuthadzo Gundula kgundula

View GitHub Profile
@kgundula
kgundula / git aliases
Last active March 11, 2020 09:56
Add git : pull rebase with autostash alias.
[alias]
cu = !git branch --merged | egrep -v \"(^\\*|master|develop|release|patch)\" | xargs git branch -d
[alias]
lg = log --graph --pretty=format:'%Cred%h%Creset %an -%C(yellow)%d%Creset %s %Cgreen(%cr)'
[alias]
amend = !git add -A && git commit --amend --no-edit
p = !git push origin $(git rev-parse --abbrev-ref HEAD)
c = "!git add -A && git commit -m "

Keybase proof

I hereby claim:

  • I am kgundula on github.
  • I am kgundula (https://keybase.io/kgundula) on keybase.
  • I have a public key ASATVfAKyjOJiZ1Ui-AXd76DLMYJXK2Gv8geEjb7k_-ldQo

To claim this, I am signing this object:

@kgundula
kgundula / PosterAdapter.java
Created January 16, 2019 04:01
Poster Adapter to show errors Picasso doesn't load the images
package com.example.android.popularmovies;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
@kgundula
kgundula / genesis_public_key
Created February 25, 2018 12:57
genesis_public_key
04beb3977942ed59480f3b6a8f59acc511050735d59e2d8b79b87f6da737d1373ac329a6be8b4bc18095f6824b27cedfb56c4b776858542fe7dbebc694ee8278c7;c-darwin
[
{
"id": "4",
"photo": "https://dl.dropboxusercontent.com/u/231329/xyzreader_data/images/p004.jpg",
"thumb": "https://dl.dropboxusercontent.com/u/231329/xyzreader_data/thumbs/p004.jpg",
"aspect_ratio": 1.49925,
"author": "Carl Sagan",
"title": "Mysteries of the Universe Solved",
"published_date": "2013-06-20T00:00:00.000Z",
@kgundula
kgundula / CaptureActivity.java
Created March 8, 2017 09:51
Setting background color on the captureactivity
package za.co.gundula.app.androidcolorpicker;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
@kgundula
kgundula / MainActivity.java
Created March 8, 2017 09:47
Fab color capture
package za.co.gundula.app.androidcolorpicker;
import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;

Keybase proof

I hereby claim:

  • I am kgundula on github.
  • I am kgundula (https://keybase.io/kgundula) on keybase.
  • I have a public key ASBgYWM9mCXoGzTbb5iaJftP6jR7x6kqqLH6cpINKdDsXQo

To claim this, I am signing this object:

@kgundula
kgundula / Java MD5 Hash Generator
Created August 28, 2015 08:58
Java MD5 Hash Generator which is equivalent to PHP MD5()
public static String md5Hash (String input) throws NoSuchAlgorithmException {
String result = input;
if(input != null) {
MessageDigest messageDigest = MessageDigest.getInstance("MD5");
messageDigest.update(input.getBytes());
BigInteger hash = new BigInteger(1, messageDigest.digest());
result = hash.toString(16);
while (result.length() < 32) {
result = "0"+result;
}
@kgundula
kgundula / color codes array
Created August 8, 2014 09:32
PHP Array of Color Codes
$color_list = array("#5d8aa8","#f0f8ff","#e32636","#efdecd","#e52b50","#ffbf00","#ff033e","#9966cc","#a4c639","#f2f3f4","#cd9575","#915c83","#faebd7","#008000","#8db600","#fbceb1","#00ffff","#7fffd4","#4b5320","#e9d66b","#b2beb5","#87a96b","#ff9966","#a52a2a","#fdee00","#6e7f80","#ff2052","#007fff","#f0ffff","#89cff0","#a1caf1","#f4c2c2","#21abcd","#fae7b5","#ffe135","#848482","#98777b","#bcd4e6","#9f8170","#f5f5dc","#ffe4c4","#3d2b1f","#fe6f5e","#000000","#ffebcd","#318ce7","#ace5ee","#faf0be","#0000ff","#a2a2d0","#6699cc","#0d98ba","#8a2be2","#8a2be2","#de5d83","#79443b","#0095b6","#e3dac9","#cc0000","#006a4e","#873260","#0070ff","#b5a642","#cb4154","#1dacd6","#66ff00","#bf94e4","#c32148","#ff007f","#08e8de","#d19fe8","#f4bbff","#ff55a3","#fb607f","#004225","#cd7f32","#a52a2a","#ffc1cc","#e7feff","#f0dc82","#480607","#800020","#deb887","#cc5500","#e97451","#8a3324","#bd33a4","#702963","#007aa5","#e03c31","#536872","#5f9ea0","#91a3b0","#006b3c","#ed872d","#e30022","#fff600","#a67b5b","#4b3621","#1e4d2b","#a3