Skip to content

Instantly share code, notes, and snippets.

It's happening

Alex Rock Pierstoval

It's happening
Block or report user

Report or block Pierstoval

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Pierstoval / git-squash
Last active Aug 29, 2015
Git squash extension. Put this file on /usr/local/share/git-squash/git-squash on most unix distribs
View git-squash
# Author: Joel Nothman
# Optimized by Pierstoval
# Under BSD-2 license
# See
# See
usage() {
echo ""
echo Usage: git squash '[-m <commit msg>] [-a|--append] [-f|--full] <base>'
Pierstoval /
Last active Mar 20, 2017
Flux RSS suivis avec le plugin "Feeder"
Pierstoval /
Last active May 2, 2017
The plugins I use in PHPStorm

There are the plugins I use in PhpStorm

Plugin name Details
.ignore because it is easier to maintain .gitignore, .dockerignore and any *ignore file
BashSupport to have a better support of bash scripts
CamelCase because it's awesome to switch from lowerCamelCase to UPPER_SNAKE_CASE with one keymap combination
CMD Support because you know, windows 😀
composer to automatically handle PSR-0 and PSR-4 namespaces, have composer.json validation and version informations (better than to look in the composer.lock file)
Editorconfig because it allows to merge PHPStorm's config style with .editorconfig (which has precedence over PHPStorm)
Pierstoval / devices.php
Last active Aug 18, 2017
See the size of your website on most famous devices
View devices.php
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<style type="text/css">
* { margin: 0; padding: 0; box-sizing: border-box; }
iframe {
overflow: hidden;
border: solid 1px black;
View php-opcache-windows.ini
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
REM This is NOT an usual glob pattern.
REM This example matches 4 digits, like "DSC_0243".
ffmpeg.exe -r 24 -i %PATTERN%.%EXTENSION% -s hd720 -vcodec libx264 out.mp4
Pierstoval / imagemagick_geometry.php
Last active Aug 1, 2018
This enormous regexp matches any "Geometry" parameter for ImageMagick. See the docs about this:
View imagemagick_geometry.php
$number = "\d*(?:\.\d+)?"; // It's a reference to use in other cases that matches any kind of number/float
$width = "(?<w>(?:$number)?%?)?"; // This is the first part, the width
$height = "(?:x(?<h>(?:$number)?%?))?"; // Here is the height, the same as "width" but starting with an "x"
$aspect = "[!><@^]"; // These are the different filters one can use to stretch, shrink, etc.
$size = "$width$height"; // To match any size we need width and height at least (aspect comes later)
View weird.js
// LOOOTS of stuff there:
// From
[] + []; // empty string
[] + {}; // [object Object]
{} + []; // 0
{} + {}; // NaN
Array(16); // ,,,,,,,,,,,,,,,, (array with 16 undefined elements)
Array(16).join('wat'); // watwatwatwatwatwatwatwatwatwatwatwatwatwatwatwat (array with 16 "wat" strings)
Pierstoval / benchmark_outputs.txt
Last active Aug 23, 2018
Benchmarking array_key_last php function from version 7.3. | Script based on
View benchmark_outputs.txt
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.
You can’t perform that action at this time.