Skip to content

Instantly share code, notes, and snippets.

chadrien /
Last active May 13, 2023 01:38
Debug PHP in Docker with PHPStorm and Xdebug

Debug your PHP in Docker with Intellij/PHPStorm and Xdebug

  1. For your local dev, create a Dockerfile that is based on your production image and simply install xdebug into it. Exemple:
FROM php:5

RUN yes | pecl install xdebug \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name" > /usr/local/etc/php/conf.d/xdebug.ini \
chadrien / AppController.php
Last active November 26, 2021 10:49
CakePHP force trailing slash
View AppController.php
App::uses('TrailingSlashUtil', 'Lib');
App::uses('Controller', 'Controller');
class AppCpontroller extends Controller {
public function redirect ($url, $status = null, $exit = true) {
$url = TrailingSlashRouter::url($url);
chadrien / Shadow.packages.config
Last active July 18, 2021 17:08
Shadow choco/scoop
View Shadow.packages.config
<?xml version="1.0" encoding="utf-8"?>
<!-- utils -->
<package id="googlechrome" />
<package id="discord" />
<package id="wincompose" />
<package id="geforce-experience" />
<!-- games -->
<package id="steam" />
<package id="epicgameslauncher" />
chadrien /
Last active March 19, 2019 00:50
Install mailcatcher on AlwaysData
git clone ~/.rbenv
git clone ~/.rbenv/plugins/ruby-build
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
rbenv install 1.9.3-p551
rbenv global 1.9.3-p551
gem install --no-ri --no-rdoc mailcatcher -v0.5.12
rbenv rehash
chadrien / Fake_DBM.toc
Created November 5, 2018 20:01
View Fake_DBM.toc
## Interface: 80000
## Title: Fake DBM
## Author: chadrien
## Version: 0.1
chadrien / .fishrc
Last active July 3, 2017 03:15
My fishrc
View .fishrc
# vim: ft=fish
function __fish_init_boot2docker_env
for dockerVar in (boot2docker shellinit 2>/dev/null | sed -e 's/export/set -xU/' -e 's/=/ /');
eval $dockerVar
function boot2docker
command boot2docker $argv
if test "$argv[1]" = "up"
chadrien / webpack.config.babel.js
Last active April 5, 2016 12:16
Basic webpack configuration for babel
View webpack.config.babel.js
import path from 'path'
let srcDir = 'src'
let distDir = 'dist'
export default {
context: path.join(__dirname, srcDir),
entry: {
app: './index.js'
chadrien / Makefile
Created June 3, 2015 12:21
Proxy commands in Makefile (useful for docker for instance)
View Makefile
SUPPORTED_COMMANDS := command1 command2
ifneq "$(SUPPORTS_MAKE_ARGS)" ""
# use the rest as arguments for the command
COMMAND_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
# ...and turn them into do-nothing targets
$(eval $(COMMAND_ARGS):;@:)
View .tigrc
set show-id = true
set show-refs = true
bind main P !git push origin
bind main p !git pull --rebase
bind main f !git fetch --all
View score.rb
# encoding: UTF-8
class Score
attr_accessor :rolls
def initialize(rolls)
@rolls = rolls.each_char