Skip to content

Instantly share code, notes, and snippets.

View pentagonal's full-sized avatar

Pentagonal pentagonal

View GitHub Profile
@pentagonal
pentagonal / HttpApi.java
Created December 1, 2017 05:51
`Java HTTP API` - easily create request with OKHTTP
// Package Name
// path: {root}/com/example/android/myapp/http
package com.example.android.myapp.http;
import okhttp3.*;
import okhttp3.Request.Builder;
import java.io.IOException;
import java.util.LinkedList;
import java.util.List;
@pentagonal
pentagonal / ImageResizer.php
Created December 4, 2017 10:25
Php SImple Image Resizer
<?php
namespace Pentagonal;
/**
* Image Resizer
*
* @uses
* $im = new ImageResizer();
* // array if success
* $result = $im->create('/path/to/file/source.png')
@pentagonal
pentagonal / Password.php
Last active December 6, 2017 13:10
Sample password_hash() object implementation
<?php
/**
* Copyright (c) 2017.
* @license GPL-3 or Later {@link https://www.gnu.org/licenses/gpl-3.0.html}
*/
declare(strict_types=1);
namespace Pentagonal\Sample\Util;
@pentagonal
pentagonal / installer.sh
Last active January 30, 2020 18:36
Ubuntu MySQL + Php (7.2) + Nginx (+Redis) Automated Installer
#!/bin/bash
#
# Pentagonal
# Ubuntu (Based) Php, Nginx, MariaDB Installer
# youtube: https://www.youtube.com/pentagonalOrg
# email: org@pentagonal.org
#
isDefaultOk=false;
@pentagonal
pentagonal / ob-map.js
Created March 21, 2018 11:45
Resolve Google Map v3 without API Key
/*
* Resolve Google Map v3 without API Key
* since june 22 2016
* Put on body and load before map render
*/
(function (window) {
if (!window.document) {
return;
}
@pentagonal
pentagonal / 2.json
Last active December 3, 2018 09:35
Contoh Per Provinsi ID (Provinsi id: 2)
{
"time": 1543829671,
"data": {
"id": 2,
"kode": "31",
"nama": "Provinsi DKI Jakarta",
"portal": "jakarta.prov",
"kabupaten": [
{
"id": 66,
@pentagonal
pentagonal / Invalid.json
Last active January 28, 2019 15:11
Contoh Result
{
"data": {
"sub_header": {
"head_of_household": "",
"sub_district": "",
"address": "",
"urban_village": "",
"city": "",
"rt_rw": "",
"postal_code": "",
@pentagonal
pentagonal / installer.sh
Last active March 17, 2019 19:47
Php Lambda Binary (placed on : /opt/)
#!/bin/bash
# Binary Compilation Placed on
# /opt/
# Please Make Sure no /opt/bin/ or /opt/lambda/ directory
# CENTOS x64 only
########################################################
#### NOTE PLEASE RUN #####
#$ rpm -Uvh https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm
#
@pentagonal
pentagonal / Request.json
Last active March 26, 2019 14:27
API RES
{
"uri": "(string:url:endpoint:follow the stage)",
"path": "/kk",
"method" : "POST",
"headers": {
"Content-Type": "application/json"
},
"body": {
"fileName": "(string:plain => FileName.jpeg)",
"image": "(string:base64Encoded => image binary)"

DOCUMENT API (LAMBDA APP / ServerLess)

REQUEST

REQUEST TO DOCUMENT (KK/KTP/NPWP)

Required Headers