Skip to content

Instantly share code, notes, and snippets.

💭
I may be slow to respond.

Hafiz Waleed Hussain Hafiz-Waleed-Hussain

💭
I may be slow to respond.
Block or report user

Report or block Hafiz-Waleed-Hussain

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Hafiz-Waleed-Hussain
Hafiz-Waleed-Hussain / WaterStream.java
Last active Mar 12, 2017
Water stream example code.
View WaterStream.java
import java.util.ArrayList;
import java.util.function.Function;
import java.util.function.Predicate;
/**
* Created by waleed on 12/03/2017.
*/
public class WaterStream {
@Hafiz-Waleed-Hussain
Hafiz-Waleed-Hussain / HelloWorldStream.java
Created Mar 12, 2017
HelloWorldStream using Java8 API example.
View HelloWorldStream.java
import java.util.ArrayList;
import java.util.List;
/**
* Created by waleed on 12/03/2017.
*/
public class HelloWorldStream {
public static void main(String [] args){
@Hafiz-Waleed-Hussain
Hafiz-Waleed-Hussain / HelloWorldStream.java
Created Mar 12, 2017
HelloWorldStream using Rx Java 2 Android.
View HelloWorldStream.java
package async.waleed.rx;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import java.util.ArrayList;
import java.util.List;
import io.reactivex.Observable;
@Hafiz-Waleed-Hussain
Hafiz-Waleed-Hussain / build.gradle
Created Mar 12, 2017
Project level gradle for Android Examples
View build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
classpath 'me.tatarka:gradle-retrolambda:3.4.0'
@Hafiz-Waleed-Hussain
Hafiz-Waleed-Hussain / build.gradle
Created Mar 12, 2017
App level gradle for Android Examples.
View build.gradle
apply plugin: 'com.android.application'
apply plugin: 'me.tatarka.retrolambda'
android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
defaultConfig {
applicationId "async.waleed.rx"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
@Hafiz-Waleed-Hussain
Hafiz-Waleed-Hussain / ArrayOfInteger.java
Created Mar 12, 2017
ArrayOfInteger using Rx Java 2 Android.
View ArrayOfInteger.java
package async.waleed.rx;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import io.reactivex.Observable;
public class MainActivity extends AppCompatActivity {
View Commit Message Hook
#!/bin/sh
msg=`head -n 1 $1`
if echo $msg | egrep -qv '(Android-\d{3,4}.{20,})'; then
echo "[Message Format] Your message is not formatted correctly. Correct message format\n
#Ticket Number - Minimum 20 or more Character \n
like #Android-123 Bug fixed for login issue"
exit 1;
fi
View Pre-Push Hook
#!/bin/sh
CMD="./gradlew clean testDebugUnitTest"
# Check if we actually have commits to push
commits=`git log @{u}..`
if [ -z$commits” ]; then
exit 0
fi
$CMD
RESULT=$?
if [ $RESULT -ne 0 ]; then
You can’t perform that action at this time.