Instantly share code, notes, and snippets.

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 ) )
View assetic.config.php
<?php
return [
'controllers' => [
\SilverStarMember\Controller\IndexController::class => [
'@member_css',
'@member_js',
],
],
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;
View doctrine_memcached.php
<?php
/*
* Typical database config
*/
// ....
'doctrine' => [
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
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},
View LazyControllerFactory.php
<?php
class LazyControllerFactory implements AbstractFactoryInterface
{
/**
* Determine if we can create a service with name
*
* @param ServiceLocatorInterface $serviceLocator
* @param $name
View AbstractControllerFactory.php
namespace Application\Factory\Controller;
use Zend\ServiceManager\AbstractFactoryInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
class AbstractControllerFactory implements AbstractFactoryInterface
{
/**
* Determine if we can create a service with name