Skip to content

Instantly share code, notes, and snippets.

View pthiers's full-sized avatar

Philippe Thiers pthiers

  • RiskAmerica SPA
  • Puerto Octay, Chile
  • 02:14 (UTC -04:00)
View GitHub Profile
@pthiers
pthiers / docker.sh
Created August 3, 2022 15:03
Get list of gateway from docker container for xdebug
docker inspect -f='{{range .NetworkSettings.Networks}}{{println .Gateway}}{{end}}' <container-name>
@pthiers
pthiers / allow-port.sh
Last active July 21, 2021 16:42
allow blocked ports in google chrome in linux
sudo sed -i 's/^Exec.*/& --explicitly-allowed-ports=10080/' /usr/share/applications/google-chrome.desktop
@pthiers
pthiers / xdebug.ini
Created September 3, 2020 15:15
xdebug configuration for docker in linux
zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_connect_back=1
xdebug.remote_port=9001
xdebug.remote_autostart=1
xdebug.remote_host=172.17.0.1
xdebug.idekey=PHPSTORM
xdebug.default_enable=0
xdebug.profiler_aggregate=0
@pthiers
pthiers / xdebug.ini
Created September 3, 2020 15:13
xdebug configuration for docker in mac
zend_extension=xdebug.so
xdebug.idekey = "PHPSTORM"
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_connect_back=0
xdebug.remote_host=host.docker.internal
xdebug.remote_port=9005
xdebug.remote_autostart=1
xdebug.default_enable=0
xdebug.profiler_aggregate=0
zend_extension=xdebug.so
xdebug.idekey = "PHPSTORM"
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_connect_back= on
xdebug.remote_port=9000
xdebug.remote_autostart=on
xdebug.default_enable=0
xdebug.profiler_aggregate=0
xdebug.profiler_append=0
@pthiers
pthiers / gist:4accfe72b11c2086f3f4ccf00c930780
Created January 24, 2019 14:29
Find and Replace with capture group with alias intellij idea
Find: (?<col>.*?) [x] Regex
Replace: '${col}'
@pthiers
pthiers / MariaDB.php
Created October 23, 2017 14:05
Dynamic column mariadb array to column_create
namespace App\Utils;
use Illuminate\Support\Collection;
class MariaDB
{
/**
* @param $arr array|Collection
@pthiers
pthiers / Model.php
Last active July 31, 2017 14:12
'static' way for getting the table name in eloquent, Laravel > 5.2 .
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model as BaseModel;
abstract class Model extends BaseModel
{
protected static $tableName = [];
public static function table(){
$className = get_called_class();
@pthiers
pthiers / PHP-Array.groovy
Last active March 7, 2024 14:26
datagrip php array extractor
/*
* Available context bindings:
* COLUMNS List<DataColumn>
* ROWS Iterable<DataRow>
* OUT { append() }
* FORMATTER { format(row, col); formatValue(Object, col) }
* TRANSPOSED Boolean
* plus ALL_COLUMNS, TABLE, DIALECT
*
* where:
@pthiers
pthiers / fabfile.py
Created April 25, 2017 19:27
Fabric migration git bare folder to gitlab
from fabric.api import env, run, cd, local, sudo
from fabric.contrib import files
from fabric.context_managers import lcd
import gitlab
gitlab_key = 'key'
gitlab_host = 'http://192.168.x.x'
env.hosts = ["192.168.x.x"]
env.user = "usuario"