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
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
#!/bin/bash
# Author: Joel Nothman
# Optimized by Pierstoval
# Under BSD-2 license
# See https://github.com/jnothman/git-squash
# See https://github.com/Pierstoval/git-squash
usage() {
echo ""
echo Usage: git squash '[-m <commit msg>] [-a|--append] [-f|--full] <base>'
@Pierstoval
Pierstoval / FluxRssSuivis.md
Last active Mar 20, 2017
Flux RSS suivis avec le plugin "Feeder"
View FluxRssSuivis.md
@Pierstoval
Pierstoval / phpstorm_plugins.md
Last active May 2, 2017
The plugins I use in PHPStorm
View phpstorm_plugins.md

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
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">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style type="text/css">
* { margin: 0; padding: 0; box-sizing: border-box; }
iframe {
overflow: hidden;
border: solid 1px black;
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
@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 / imagemagick_geometry.php
Last active Aug 1, 2018
This enormous regexp matches any "Geometry" parameter for ImageMagick. See the docs about this: http://www.imagemagick.org/script/command-line-processing.php#geometry
View imagemagick_geometry.php
<?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: 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 / 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.
You can’t perform that action at this time.