Skip to content

Instantly share code, notes, and snippets.

View pentagonal's full-sized avatar

Pentagonal pentagonal

View GitHub Profile
<?php
// file name to put json
$fileName = '/path/to/data.json';
/**
* This just sample stmt
* @var \PDO $pdo
* @var \PDOStatement $stmt
*/
$stmt = $pdo
->query("SELECT * FROM XXXXXXXX");
<?php
// sample HTML
$url = 'https://www.shunt-magetan.org/wp-content/uploads/wordpress-popular-posts/1904-featured-75x75.jpg?test=1';
$url2 = 'https://www.shunt-magetan.org/wp-content/uploads/wordpress-popular-posts/1904-featured-2-75x75.jpg?test=2';
$html = <<<HTML
<!DOCTYPE html>
<html>
<head>
<meta charset="utf8">
<title>SAMPLE</title>

DOCUMENT API (LAMBDA APP / ServerLess)

REQUEST

REQUEST TO DOCUMENT (KK/KTP/NPWP)

Required Headers

@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)"
@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 / 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 / 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 / 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 / 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 / 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;