Skip to content

Instantly share code, notes, and snippets.

View alahammad's full-sized avatar

Ala Hammad alahammad

View GitHub Profile
@alahammad
alahammad / fragment_utility.kt
Created June 20, 2018 11:26 — forked from rakshakhegde/fragment_utility.kt
Handy Idiom: Pass Arguments to Android Fragment using Kotlin + Anko
import android.support.v4.app.Fragment
import org.jetbrains.anko.bundleOf
/**
* Pass arguments to a Fragment without the hassle of
* creating a static newInstance() method for every Fragment.
*
* Declared outside any class to have full access in any
* part of your package.
*
@FormUrlEncoded
@POST("users_mobile/sendVerificationCode")
Call<UserModel> sendVerificationCode(@Field("phoneNumber") String phoneNumber, @Field("name") String name);
@FormUrlEncoded
@POST("users_mobile/verifyPhoneNumber")
Call<UserModel> verifyCode(@Field("verification_code") String verification_code, @Field("phoneNumber") String phoneNumber);
@FormUrlEncoded
@POST("users_mobile")
@alahammad
alahammad / Locator.java
Created February 7, 2018 09:47 — forked from emil2k/Locator.java
Android utility class for getting device location using various methods. Depends on `Connectivity` class found here: https://gist.github.com/emil2k/5130324
/*
* Copyright (c) 2017 Emil Davtyan
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
@alahammad
alahammad / ADB short cut
Created August 29, 2017 08:22
ADB shortcut for mac users, just change adb path
#!/bin/bash
clear
echo " ____ _____ ____ _____ _ _ _ ____
/ / / /\ | __ \| _ \ / ____| | | | | | \ \ \
/ / / / \ | | | | |_) | | (___ | |__ ___ _ __| |_ ___ _ _| |_ \ \ \
< < < / /\ \ | | | | _ < \___ \| '_ \ / _ \| '__| __/ __| | | | __| > > >
\ \ \ / ____ \| |__| | |_) | ____) | | | | (_) | | | || (__| |_| | |_ / / /
\_\_\ /_/ \_\_____/|____/ |_____/|_| |_|\___/|_| \__\___|\__,_|\__| /_/_/
"