Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View Pierstoval's full-sized avatar
🌖

Alex Rock Pierstoval

🌖
View GitHub Profile
@Pierstoval
Pierstoval / benchmark_outputs.txt
Last active August 23, 2018 10:12
Benchmarking array_key_last php function from version 7.3. | Script based on http://www.php-benchmark-script.com
---------------------------------------------------
| 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.
// 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 July 14, 2018 12:42
Timelapse from imges with FFMPEG and ImageMagick
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 March 1, 2023 13:02
`is_a()` vs `is_subclass_of()`

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

Git gc script to save space

Place this at the "root" of your git repos, or even your projects directory.

Like /var/www/git_gc.bash for example, if you save many projects under this dir.

This script will run git reflog expire and git gc with extra options to save some space when working with heavy & often rebased projects.

@Pierstoval
Pierstoval / devices.php
Last active August 18, 2017 11:20
See the size of your website on most famous devices
<!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;
@Pierstoval
Pierstoval / _ChromeSnippets.md
Last active August 8, 2019 15:14
Chrome snippets

My Chrome snippets

pierstoval@PIERSTOVAL /mnt/e/dev/www/sandbox $ ./test.bash
KO for key ALLUSERSPROFILE
KO for key APPDATA
KO for key CLINK_DIR
KO for key CommonProgramFiles
KO for key CommonProgramW6432
KO for key COMPUTERNAME
KO for key ComSpec
KO for key FPS_BROWSER_APP_PROFILE_STRING
@Pierstoval
Pierstoval / keybase.md
Last active April 21, 2019 19:44
keybase.md

Keybase proof

I hereby claim:

  • I am pierstoval on github.
  • I am pierstoval (https://keybase.io/pierstoval) on keybase.
  • I have a public key ASDMqGJzpJ2OMQa9tDDwznVYnbzPVW7K4oDlKUBliBawWAo

To claim this, I am signing this object:

@Pierstoval
Pierstoval / FluxRssSuivis.md
Last active March 20, 2017 06:58
Flux RSS suivis avec le plugin "Feeder"