Skip to content

Instantly share code, notes, and snippets.

🌖
It's happening

Alex Rock Pierstoval

View GitHub Profile
View mysql_docker.bash
docker run \
--name=mysql_host \
-dit -e MYSQL_ROOT_PASSWORD=mysql \
-p 3306:3306 \
mysql:5.7
@Pierstoval
Pierstoval / Makefile
Last active Apr 2, 2019
RequestTracker bootstraping makefile
View Makefile
RTDIR = ${REQUEST_TRACKER_DIR}
echo:
@echo "${WOW}"
##
## RequestTracker
## --------------
##
View .php_cs
<?php
$finder = PhpCsFixer\Finder::create()
->exclude([
'vendor',
])
->in([
__DIR__.'/src/',
__DIR__.'/tests/'
])
View img_to_output_via_memory.php
<?php
$h = fopen('php://memory', 'ab+');
$gd = @imagecreate(110, 20);
if (false === $gd) {
throw new \RuntimeException('GD image is invalid');
}
@Pierstoval
Pierstoval / benchmark_outputs.txt
Last active Aug 23, 2018
Benchmarking array_key_last php function from version 7.3. | Script based on http://www.php-benchmark-script.com
View benchmark_outputs.txt
---------------------------------------------------
| PHP BENCHMARK SCRIPT |
---------------------------------------------------
Start : 2018-08-23 08:37:29
PHP version : 7.3.0beta2
Platform : Linux
Each test executed 10000 times
---------------------------------------------------
test_array_reverse 650.660 sec.
test_array_key_last 0.049 sec.
View weird.js
// LOOOTS of stuff there: https://github.com/denysdovhan/wtfjs
// From https://www.destroyallsoftware.com/talks/wat
[] + []; // empty string
[] + {}; // [object Object]
{} + []; // 0
{} + {}; // NaN
Array(16); // ,,,,,,,,,,,,,,,, (array with 16 undefined elements)
Array(16).join('wat'); // watwatwatwatwatwatwatwatwatwatwatwatwatwatwatwat (array with 16 "wat" strings)
@Pierstoval
Pierstoval / timelapse.cmd
Last active Jul 14, 2018
Timelapse from imges with FFMPEG and ImageMagick
View timelapse.cmd
REM Batch file for Windows only
REM This script takes images from a
SET EXTENSION=jpg
REM This is NOT an usual glob pattern.
REM This example matches 4 digits, like "DSC_0243".
SET PATTERN=DSC_%04d"
ffmpeg.exe -r 24 -i %PATTERN%.%EXTENSION% -s hd720 -vcodec libx264 out.mp4
@Pierstoval
Pierstoval / _PHP is_a() vs is_subclass_of().md
Last active Apr 16, 2019
`is_a()` vs `is_subclass_of()`
View _PHP is_a() vs is_subclass_of().md

PHP is_a() vs is_subclass_of()

To compute the results, just use Melody and run the script:

melody run https://gist.github.com/Pierstoval/ed387a09d4a5e76108e60e8a7585ac2d
View php-opcache-windows.ini
zend_extension=php_opcache.dll
[opcache]
opcache.enable=1
opcache.enable_cli=1
opcache.memory_consumption=256
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=20000
opcache.use_cwd=1
You can’t perform that action at this time.