Skip to content

Instantly share code, notes, and snippets.

View rhexgomez's full-sized avatar

Rhex Gomez rhexgomez

  • Philippines
View GitHub Profile
@rhexgomez
rhexgomez / QuickFind.java
Last active November 28, 2015 06:20
Quick Find Algorithm
public class QuickFind {
public static void main(String[] args){
QuickFind pol = new QuickFind(10);
pol.union(3, 5);
pol.union(5, 6);
pol.union(3, 1);
pol.union(8, 0);
pol.union(8, 2);

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

@rhexgomez
rhexgomez / BASH.md
Last active November 26, 2015 12:20
Setting up multiple Environment Variable in Linux

Open your Bashrc file

sudo gedit .bashrc

To demonstrate an example mutliple Environment Variable

FIRST_VARIABLE=<full path>
SECOND_VARIABLE=<full path>
PATH=$PATH:$FIRST_VARIABLE/$SECOND_VARIABLE
@rhexgomez
rhexgomez / Apache 2.0.java
Created December 2, 2015 05:16
An Apache Opensource License Header
/*
* Copyright ${YEAR} <Full name>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@rhexgomez
rhexgomez / AS External Module.md
Last active December 22, 2015 06:44
Setting up external Module as library in Android Studio.

In settings.gradle

include ':app',':mymodule'
project(":mymodule").projectDir = new File("/<prject full path>/mymodule");
@rhexgomez
rhexgomez / InvitationInformation.java
Created February 23, 2016 07:28
Wedding Planner Basic App
/*
* Copyright 2016 Elmar Rhex Gomez.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@rhexgomez
rhexgomez / Foo.java
Created April 7, 2016 14:45
Builder Design Pattern using Java Generics.
/*
* Copyright 2016 Elmar Rhex Gomez.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@rhexgomez
rhexgomez / UploadRequest.java
Last active August 1, 2016 01:56
Upload image using Android Volley and does not need any other 3rd party library.
/*
* Copyright (C) 2016 Elmar Rhex Gomez
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@rhexgomez
rhexgomez / ReusableFuture.java
Created August 3, 2016 08:26
The reusable implementation of Future<T> Blocking callback in Android Volley
/*
* Copyright 2016 Elmar Rhex Gomez.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@rhexgomez
rhexgomez / ContextHelper.java
Last active October 22, 2016 06:23
The proper way of getting the Activity or Fragment Manager from the Context.
/*
* Copyright 2016 Elmar Rhex Gomez.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software