Skip to content

Instantly share code, notes, and snippets.


Jitendra adhocore

View GitHub Profile
kirmorozov /
Last active Aug 23, 2021
Magento PHP7.4 Preload vs PHP 7.3

Current Magento 2.2.2 PHP 7.4 with preload is 10%+ faster

Comparison of means

PHP 7.4 with preload is 11.07% faster then PHP 7.3

PHP 7.4 with preload is 13.25% faster then PHP 7.1

Sample 1 PHP 7.4 with Preload

Mean: 0.458

Exposed headers
Service SSL status Response Type Allowed methods Allowed headers
adhocore / expand_array.php
Last active Dec 19, 2019
A helper function expand_array for PHP
View expand_array.php
* A helper function expand_array for PHP
* This is actually developed during the real need to develop JSON api
* I wanted to have JSON api response spitted properly expanded (with semantic nodes)
* But didnot want to do it by playing with arrays (looping, merging n' what not) time and again.
* So, After fetching single dimensional array data from database, with keys having
* some specific delimeter, this helper would do for me what i want to.
View examples.php
PHP takes the design of Perl (ugly), the interfaces
of C (low-level and clunky), and the OO of C++
(an impure mess). Some things are completely broken,
and every API is either inconsistent or just
Its only utility is its output of inline text, which
View base58.php
class base58
static public $alphabet = "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ";
public static function encode($int) {
$base58_string = "";
$base = strlen(self::$alphabet);
while($int >= $base) {
puneetkay / download.php
Created Oct 31, 2013
Force download with php
View download.php
function serve_file_resumable ($file, $contenttype = 'application/octet-stream') {
// Avoid sending unexpected errors to the client - we should be serving a file,
// we don't want to corrupt the data we send
// Make sure the files exists, otherwise we are wasting our time
if (!file_exists($file)) {
BlakeTurner / to-markdown.php
Created Jun 20, 2013
Convert HTML to Markdown in PHP. Great for migrating away from terrifying wysiwyg code.
View to-markdown.php
* to-markdown - an HTML to Markdown converter for PHP
* Copyright 2013, Blake Turner
* Licenced under the MIT licence
ihumanable / Excel.php
Last active Aug 2, 2022
Simple Excel Writer in PHP
View Excel.php
* Simple excel writer class with no external dependencies, drop it in and have fun
* @author Matt Nowack
* @link
* @license Unlicensed
* @version 1.0
class Excel {