Skip to content

Instantly share code, notes, and snippets.

View afiqiqmal's full-sized avatar
👻
I may be slow to respond.

Hafiq afiqiqmal

👻
I may be slow to respond.
View GitHub Profile
@afiqiqmal
afiqiqmal / MainActivity.java
Created February 4, 2018 08:24
Get Credential Email from android smartlock
public class LoginActivity extends BaseActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
...
...
CredentialsOptions options = new CredentialsOptions.Builder().forceEnableSaveDialog().build();
mCredentialsClient = Credentials.getClient(this, options);
@afiqiqmal
afiqiqmal / laravel_starter.sh
Last active February 10, 2018 10:33
Simple Laravel Project
IBlack='\033[0;90m' # Black
IRed='\033[0;91m' # Red
IGreen='\033[0;92m' # Green
IYellow='\033[0;93m' # Yellow
IBlue='\033[0;94m' # Blue
IPurple='\033[0;95m' # Purple
ICyan='\033[0;96m' # Cyan
IWhite='\033[0;97m' # White
Color_Off='\033[0m' # Text Reset
@afiqiqmal
afiqiqmal / SoapRequest.php
Last active August 8, 2019 12:08
Soap Request Using PHP which focus on SOAP using WSSE Security and Basic Authenticattion
<?php
/**
* Created by PhpStorm.
* User: hafiq
* Date: 28/02/2018
* Time: 9:30 AM
*/
namespace App\Library;
@afiqiqmal
afiqiqmal / MacroContract.php
Last active March 27, 2018 03:59
Custom Router using Macro for laravel
<?php
namespace App\Macros;
interface MacroContract
{
public static function registerMacros();
public function createMacros();
}
@afiqiqmal
afiqiqmal / BaseRepository.php
Last active May 7, 2019 04:24
Use for extend the others Model Repository Class
<?php
/**
* Created by PhpStorm.
* User: hafiq
* Date: 19/07/2018
* Time: 2:21 PM
*/
namespace App\Repository;
@afiqiqmal
afiqiqmal / CustomIncomingMessage.php
Last active April 1, 2022 11:51
Laravel Botman Custom Driver Just for Combining Multiple Attachment to Single Upload Attachment
<?php
/**
* Created by PhpStorm.
* User: hafiq
* Date: 18/03/2018
* Time: 11:59 PM
*/
namespace App\Conversation\Custom;
@afiqiqmal
afiqiqmal / ViewPagerAdapter.java
Created March 31, 2018 05:42
View Pager Adapter for slide pager Android
package com.package;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.view.PagerAdapter;
import java.util.ArrayList;
import java.util.List;
@afiqiqmal
afiqiqmal / ApiRequest.php
Last active November 7, 2019 07:49
Api Request + HTTP Guzzle PHP
<?php
namespace App\Http\Services;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;
define('METHOD_POST', 'POST');
define('METHOD_GET', 'GET');
define('METHOD_PATCH', 'PATCH');
@afiqiqmal
afiqiqmal / jsgrid-custom.js
Last active November 7, 2019 07:51
Boilderplate for JSGrid Library
$(function () {
"use strict";
jsGrid.setDefaults({
tableClass: "jsgrid-table table table-striped table-hover"
});
jsGrid.setDefaults("text", {
_createTextBox: function() {
return $("<input>").attr("type", "text").attr("class", "form-control input-sm")
@afiqiqmal
afiqiqmal / FeedSample.php
Last active September 3, 2018 13:58
Get Facebook Page Feed with PHP + Guzzle
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
require_once __DIR__ .'/../vendor/autoload.php';
use Dotenv\Dotenv;
// load envirionment variable
// add this package in your composer.json if want to use dotenv "vlucas/phpdotenv"