Skip to content

Instantly share code, notes, and snippets.

Avatar

guiguiboy

View GitHub Profile
@guiguiboy
guiguiboy / phpstorm php config ubuntu debugger
Created Jun 24, 2018
Configuring PHPSTORM debugger with ubuntu for CLI debugging
View phpstorm php config ubuntu debugger
config xdebug PHP
------------------------
xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_connect_back=1
xdebug.remote_port="9000"
xdebug.idekey="PHPSTORM"
xdebug.remote_log=/tmp/xdebug.log
@guiguiboy
guiguiboy / strict_type_add.sh
Created Jun 3, 2018
Adding declare strict_types=1 at the beginning of your PHP files
View strict_type_add.sh
#!/bin/bash
add()
{
sed -i '1 s/<?php/<?php\
declare(strict_types=1);/g' $1
}
@guiguiboy
guiguiboy / command.php
Last active Jun 25, 2017
Symfony command to quickly compare structure between DB and entities
View command.php
<?php
namespace AppBundle\Command;
use Doctrine\DBAL\Connection;
use Doctrine\ORM\EntityManager;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
View gist:0b390a61bc79e842706d
<?php
class MyContext extends \Behat\Behat\Context\BehatContext{
......
/**
* Allows to fill in a tinyMCE rich text textarea by disabling the control
*
* @Given /^I fill in rich text editor "([^"]*)" with "([^"]*)"$/
@guiguiboy
guiguiboy / gist:7113892
Last active Dec 26, 2015
firePHP example
View gist:7113892
<?php
$f = require_once('/var/www/myproject/vendors/FirePHPCore-0.3.2/lib/FirePHPCore/FirePHP.class.php');
$f = FirePHP::getInstance(true);
$f->fb('Hello FirePHP console', FirePHP::INFO);
?>
View pma.sh
#!/bin/bash
echo "Enable/Disable phpmyadmin on the server"
if [ "$#" -ne 1 ];then
echo "Usage pma.sh [up|down]"
exit 0
fi
if [ "$1" = "up" ];then
You can’t perform that action at this time.