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
View README.md

Native mocks versus PHPUnit mocks

Mock type Tests duration
Native mocks 160.10 seconds
Mockery 177.01 seconds (+10%)
PHPUnit mocks 232.29 seconds (+45%)
Prophecy 3868.80 seconds (+2416%)
@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
View GetHttpClientTestTrait.php
<?php
declare(strict_types=1);
namespace Tests;
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase as BaseWebTestCase;
use Symfony\Component\BrowserKit\Cookie;
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
@Pierstoval
Pierstoval / _PHP is_a() vs is_subclass_of().md
Last active Jul 3, 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 change_bg.bash
# Change the current background according to a distant URL.
# Needs the "feh" package to work.
DISPLAY=:0 XAUTHORITY=$HOME/.Xauthority feh --bg-center http://rammb.cira.colostate.edu/ramsdis/online/images/latest/himawari-8/full_disk_ahi_natural_color.jpg
# Source: https://twitter.com/docteur_klein/status/1130730930031779840
View AdminPostController.php
<?php
declare(strict_types=1);
/*
* (c) Alexandre Rock Ancelet <pierstoval@gmail.com> and Studio Agate.
*
* Licensed with MIT
*/
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:

@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 / Base_Gulpfile.md
Last active Apr 2, 2019
Configuration-based Gulpfile
View Base_Gulpfile.md
You can’t perform that action at this time.