Skip to content

Instantly share code, notes, and snippets.

View pentagonal's full-sized avatar

Pentagonal pentagonal

View GitHub Profile
@pentagonal
pentagonal / MultiBytesEntities.php
Last active April 2, 2016 09:57
Entities Non ASCII characters
<?php
/**
* Entities the Multibytes string
* Iconv must be enable to use this function work properly
*
* @param string $string the string to detect multibytes
* @param boolean $entities true if want to entity the output
* @return string
*/
function multibyteEntities($string, $entities = true)
@pentagonal
pentagonal / Slim-3-Rewrite-MiddleWare.php
Last active June 24, 2016 13:10
Slim 3 Framework to Handle Duplicate Route Request by file access
<?php
/**
* Add MiddleWare to fix URL Rewrites
* Prevent Duplicate Route Access for
* ^/indexfile.php/main === ^/main
* Slim variable is from context object of
* -----------------------------------
* $slim = new \Slim\App();
* -----------------------------
*/

Keybase proof

I hereby claim:

  • I am pentagonal on github.
  • I am pentagonal (https://keybase.io/pentagonal) on keybase.
  • I have a public key whose fingerprint is 8847 B4E4 5D0E 254F 1D2E 1550 ECB1 9699 9CF5 3FB0

To claim this, I am signing this object:

@pentagonal
pentagonal / MyApp.php
Last active June 24, 2016 13:54
Fix Scheme Problem & Rewrite Mode on Slim Frame Work 3
<?php
/**
* This only example usage of using slim as application
* By default Slim 3 only detect if environemnt https set not 'off'
* but on some case eg : cloudflare Flexible SSL / FULL SSL will be hide site behind
* the CloudFlare Secure Protocol.
* You could change anything namespace etc. to working with Slim 3 App
* @see {https://support.cloudflare.com/hc/en-us/articles/203487280--How-do-I-fix-the-infinite-redirect-loop-error-after-enabling-Flexible-SSL-with-WordPress-}
* on some case cloud flare use Environment (HTTP_X_FORWARDED_PROTO)
* to hide real site and serve on their secure protocol
@pentagonal
pentagonal / artboards.plist
Created July 11, 2016 08:21
Custom Artboards Presets For Sketch 3 @see https://www.sketchapp.com
<!--
Common presets for web design resolution
=== misc artboards
@see https://gist.github.com/fc-io/951592753248dd3ce5ab
=== social artboards
@see https://github.com/herrhelms/social-artboards-sketch
Put Into:
<?php
class Utility
{
/* --------------------------------------------------------------------------------*
| Serialize Helper |
| |
| Custom From WordPress Core wp-includes/functions.php |
|---------------------------------------------------------------------------------|
*/
@pentagonal
pentagonal / onion-gen.js
Created April 23, 2017 11:12 — forked from ttaubert/onion-gen.js
Generating custom .onion names with the WebCrypto API
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
/*
* thirty-two
* https://github.com/chrisumbel/thirty-two
*
<?php
/**
* Example Class
*/
class MyRoutes
{
/**
* @var \Slim\App $slim
*/
protected $slim;
@pentagonal
pentagonal / Example.php
Last active June 18, 2017 07:11
Custom Array Table Schema With SQL Migration (Use Doctrine DBAL { @link https://github.com/doctrine/dbal } )
<?php
/**
* prototype of Builder & Extending Doctrine DBAL
* please see { @link https://github.com/PentagonalProject/ProjectSeventh/tree/development }
*/
use Doctrine\DBAL\DriverManager;
/**
* List Scheme
@pentagonal
pentagonal / Collection.php
Created June 5, 2017 20:47
Just Simple Shell Arg Parser
<?php
namespace Pentagonal\RujakLegi;
/**
* Class Collection
* @package Pentagonal\RujakLegi
*/
class Collection implements \ArrayAccess, \IteratorAggregate, \Countable
{
/**