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 / pre-receive.bash
Last active Apr 9, 2019
Git pre-receive example
View pre-receive.bash
#!/bin/bash
########################################################################
################################ README ################################
########################################################################
#
# This script is here to allow the use of "git push prod v1.2.3" commands or similar.
#
# Push a tag to a bare repository having this file as pre-receive hook,
# and you'll be able to deploy directly from command line in your local environment,
@Pierstoval
Pierstoval / phpv.bash
Last active Jul 23, 2019
# Change PHP version rapidly when using Homebrew (MacOSX)
View phpv.bash
#!/bin/bash
# Use:
# $ phpv
# > Will return current global php version, and ALL php versions symlinked
#
# $ phpv {version}
# > Will "brew unlink" all versions, and "brew link php{version}"
# View README file for more info
@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)
@Pierstoval
Pierstoval / _One_File_Symfony_Application.md
Last active Apr 2, 2019
One-file Symfony application
View _One_File_Symfony_Application.md

Symfony application with one file

(ok, 2 files with composer.json and 3 if you need an .htaccess file...)

Now there's a MicroKernel class in Symfony 2.8 and it's awesome!

Advantages

Light

@Pierstoval
Pierstoval / Base_Gulpfile.md
Last active Apr 2, 2019
Configuration-based Gulpfile
View Base_Gulpfile.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 / FluxRssSuivis.md
Last active Mar 20, 2017
Flux RSS suivis avec le plugin "Feeder"
View FluxRssSuivis.md
View 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:

View OUTPUT.txt
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
You can’t perform that action at this time.