Skip to content

Instantly share code, notes, and snippets.

Avatar

Alexandre Lemaire Saeven

View GitHub Profile
@Saeven
Saeven / behat.yml
Last active Oct 17, 2018
Behat test configuration
View behat.yml
# behat.yml
default:
autoload: [ %paths.base%/../contexts ]
suites:
core_features:
paths: [ %paths.base%/../features ]
contexts: [ FeatureContext ]
extensions:
shvetsgroup\ParallelRunner\Extension:
process_count: 4
@Saeven
Saeven / container.meta.php
Created Mar 23, 2018
Install PHPStorm Autocomplete for Zend Framework Container (ServiceManager)
View container.meta.php
<?php
/**
* Install this in your base PHPStorm 2018+ folder under .phpstorm.meta.php/container.meta.php and
* your $container->get(ThatClass::class) calls will now yield autocomplete magic.
*/
namespace PHPSTORM_META {
View samplerank.php
/**
* Retrieve a particular user's rank and details, considering descending sort order on that column
* @param $column The column name used for sorting
* @param $user_id The user ID whose rank we want to obtain
* @return array
* @throws \Exception
*/
public function getUserRank( $column, $user_id )
{
if( !is_numeric( $user_id ) )
@Saeven
Saeven / assetic.config.php
Created Apr 6, 2017
Same controller-based gist for Assetic
View assetic.config.php
<?php
return [
'controllers' => [
\SilverStarMember\Controller\IndexController::class => [
'@member_css',
'@member_js',
],
],
@Saeven
Saeven / MultibyteGuard.php
Created Mar 23, 2017
MultibyteGuardFilter
View MultibyteGuard.php
<?php
namespace LDP\Form\Filter;
class MultibyteGuard implements \Zend\Filter\FilterInterface
{
public function filter($value)
{
if (!mb_check_encoding($value, 'utf-8')) {
$value = '';
View IndexControllerSpec.php
<?php
namespace Spec\Application\Controller;
use Application\Controller\Plugin\JsonWrapper;
use Application\Entity\User;
use Application\Mapper\ConfigurationMapper;
use Application\Mapper\CouponMapper;
use Application\Mapper\UserServerPlanMapper;
use Application\Service\CartService;
@Saeven
Saeven / doctrine_memcached.php
Last active Feb 25, 2017
Doctrine & Memcached
View doctrine_memcached.php
<?php
/*
* Typical database config
*/
// ....
'doctrine' => [
@Saeven
Saeven / # php70 - 2016-09-26_21-45-45.txt
Created Sep 27, 2016
php70 (josegonzalez/php/php70) on macOS 10.11.6 - Homebrew build logs
View # php70 - 2016-09-26_21-45-45.txt
Homebrew build logs for josegonzalez/php/php70 on macOS 10.11.6
Build date: 2016-09-26 21:45:45
@Saeven
Saeven / saeven.lua
Last active Feb 12, 2020
Hammerspoon script to launch and tile apps
View saeven.lua
local workApplications = { 'Mail','HipChat','PhpStorm','Safari','Charles'}
local workApplicationWatcher;
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "H", function()
hs.notify.new({title="Hammerspoon", informativeText="Setting home layout"}):send()
local homeMonitor = "LG ULTRAWIDE"
local windowLayout = {
{"PhpStorm", nil, homeMonitor, {x=0, y=0, w=0.6, h=1}, nil, nil},
{"Charles", nil, homeMonitor, {x=0.6, y=0.6, w=0.4, h=0.4}, nil, nil},
@Saeven
Saeven / LazyControllerFactory.php
Last active Apr 11, 2016
Lazy controller factory that auto-injects dependencies based on controller params.
View LazyControllerFactory.php
<?php
class LazyControllerFactory implements AbstractFactoryInterface
{
/**
* Determine if we can create a service with name
*
* @param ServiceLocatorInterface $serviceLocator
* @param $name
You can’t perform that action at this time.