Skip to content

Instantly share code, notes, and snippets.

View pentagonal's full-sized avatar

Pentagonal pentagonal

View GitHub Profile
@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 / 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 / Database.php
Created December 1, 2017 05:27
Phalcon Database Class Setup for confusing configuration
<?php
/**
* MIT License
*
* Copyright (c) 2017, Pentagonal
*
* 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
@pentagonal
pentagonal / Cache.php
Last active December 1, 2017 06:05
Phalcon Cache Class Setup for confusing configuration
<?php
/**
* MIT License
*
* Copyright (c) 2017, Pentagonal
*
* 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
@pentagonal
pentagonal / DesktopUserAgent.php
Created November 6, 2017 21:41
Php User Agent Generator - The *GBLK* way
<?php
/**
* MIT License
*
* Copyright (c) 2017, Pentagonal
*
* 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
@pentagonal
pentagonal / WhoisRegexDataGetter.php
Last active September 25, 2023 16:28
Get Detail Data From Whois Domain Result (#PCRE REGULAR EXPRESSION)
<?php
// result data
$resultString = 'Fill With Whois Result';
// Domain .be fixer
$resultString = str_replace("\r", "", $resultString);
if (strpos($resultString, ":\n\t")) {
$arr = explode("\n", $resultString);
$currentKey = null;
foreach ($arr as $key => $value) {
@pentagonal
pentagonal / Task.php
Last active September 14, 2017 19:41
Task State Base
<?php
declare(strict_type=1);
namespace Pentagonal\Gist\Task\Abstracts;
use Pentagonal\Gist\Task\Interfaces\TaskInterface;
use InvalidArgumentException;
/**
* class TaskAbstract
@pentagonal
pentagonal / installer.sh
Last active February 21, 2019 20:14
Ubuntu MySQL + Php (7.1) + Nginx (+Redis) Automated Installer
#!/bin/bash
#
# Pentagonal
# Ubuntu (Based) Php, Nginx, MariaDB Installer
# youtube: https://www.youtube.com/pentagonalOrg
# email: [email protected]
#
isDefaultOk=false;
@pentagonal
pentagonal / domainCheck.js
Created July 29, 2017 15:42
Just Test Validate email & Domain (Include Domain List Json)
/*!
* Domain Check
* // gTLD
* {link: https://data.iana.org/TLD/tlds-alpha-by-domain.txt}
* // assign full TLD + sTLD
* {top: https://publicsuffix.org/list/effective_tld_names.dat}
* @author pentagonal <[email protected]>
* @date 29th july 2017
*/
(function (global, factory) {
@pentagonal
pentagonal / DatabaseBackup.php
Created June 18, 2017 12:14
Dump Database Using Doctrine -> Without `MYSQL DUMP`
<?php
/**
* (MYSQL EXPORT WITHOUT DUMP USE DOCTRINE DBAL)
*
*
*
* NOTE : ONLY WORKS WITH `MYSQL` ONLY
*
* This Class Using Doctrine DBAL to instantiate connection
* {@link : https://github.com/doctrine/dbal}