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 / RsaKeyPair.java
Last active October 23, 2020 03:54
Generate KeyPair RSA In Java
package com.example.rsagenerator;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import android.os.Bundle;
import android.util.Base64;
import android.util.Log;
import android.view.View;
@afiqiqmal
afiqiqmal / ALaravelPipelineReadme.md
Last active December 27, 2023 10:24
Laravel Query Filter using Pipeline

Donate

Laravel Query Filter using Pipeline

Basically, with a pipeline we can pass an object through a stack of tasks and get the result via a callback.

Refer Here -> https://laravel.com/api/7.x/Illuminate/Pipeline/Pipeline.html

The method handle used to execute the task receives two parameters, the first is the object that we passed to our pipeline, the second is a closure, where the object will be sent to run the next task.

@afiqiqmal
afiqiqmal / DoubleClickListener.java
Created August 13, 2020 02:36
You may need to create new Class implements Onclick. Normal click will be delay as 400 ms until the second click is detected by using Timer. If no second click after 400 ms is not exist, it will consider One Tap
public abstract class DoubleClickListener implements OnClickListener {
private Timer timer = null; //at class level;
private int DELAY = 400;
private static final long DOUBLE_CLICK_TIME_DELTA = 300;//milliseconds
long lastClickTime = 0;
@Override
@afiqiqmal
afiqiqmal / ClassTypeAdapter.java
Created August 9, 2020 12:48
GSON Class Type Converter
public class ClassTypeAdapter extends TypeAdapter<Class<?>> {
@Override
public void write(JsonWriter jsonWriter, Class<?> clazz) throws IOException {
if(clazz == null){
jsonWriter.nullValue();
return;
}
jsonWriter.value(clazz.getName());
}
@afiqiqmal
afiqiqmal / setel_map_style.json
Created August 3, 2020 14:22
Setel App Google Map Style
[
{
"elementType": "geometry.fill",
"stylers": [
{
"hue": "#dfe5ed"
},
{
"saturation": -35
},
@afiqiqmal
afiqiqmal / grab_map_style.json
Created August 3, 2020 14:21
Grab Google Map Style
[
{
"elementType": "geometry.fill",
"stylers": [
{
"color": "#f3f3f3"
}
]
},
{
@afiqiqmal
afiqiqmal / grab_dark_map_style.json
Created August 3, 2020 14:21
Grab Google Map Style
[
{
"elementType": "geometry",
"stylers": [
{
"color": "#212121"
}
]
},
{
@afiqiqmal
afiqiqmal / ic_pin_locator.xml
Created August 3, 2020 13:44
Pretty Drawable for Location Marker
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:gravity="center">
<shape android:shape="oval">
<solid android:color="@color/transparent_blue2"/>
<size android:height="34dp" android:width="34dp"/>
</shape>
</item>
<item android:gravity="center">
<shape android:shape="oval">
@afiqiqmal
afiqiqmal / malaysia_postcode_list.json
Created June 8, 2020 12:11 — forked from zulhfreelancer/malaysia_postcode_list.json
Malaysia Postcode List By State (JSON)
{
"prepared_by": "Zulhilmi Zainudin",
"last_update": "21 June 2016",
"data": [
{
"state": "Selangor",
"codes": [
"40000",
"40100",
@afiqiqmal
afiqiqmal / opcache.ini
Created April 2, 2020 02:11 — forked from rohankhudedev/opcache.ini
Best Zend OpCache Settings / Tuning / Configurations
[opcache]
; Determines if Zend OPCache is enabled
opcache.enable=1
; Determines if Zend OPCache is enabled for the CLI version of PHP
;opcache.enable_cli=1
; The OPcache shared memory storage size.
opcache.memory_consumption=512