Skip to content

Instantly share code, notes, and snippets.

View guiyomh's full-sized avatar
😀

Guillaume Camus guiyomh

😀
View GitHub Profile
#!/usr/bin/env sh
case "$XDEBUG_ENABLED" in
'')
XDEBUG_ENABLED=0;;
0|1)
;;
*)
>&2 printf 'value for XDEBUG_ENABLED is not allowed. Set it to 0 to'
>&2 printf ' disable or 1 to enable xdebug.\n'
@guiyomh
guiyomh / docker-compose.patch
Created October 19, 2018 12:43
Xdebug with PhpStorm and Docker 2
--- docker-compose.yml (date 1539952509000)
+++ docker-compose.yml (date 1539952509000)
@@ -6,7 +6,10 @@
services:
slim:
- image: php:7-alpine
+ build:
+ context: docker/php
+ dockerfile: Dockerfile
@guiyomh
guiyomh / Dockerfile
Last active October 19, 2018 12:41
Xdebug with PhpStorm and Docker
FROM php:7-alpine
RUN set -xe \
&& apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS \
&& pecl install xdebug \
&& docker-php-ext-enable --ini-name 90-xdebug.ini xdebug
#!/bin/sh
#
# Run the hook command.
# Note: this will be replaced by the real command during copy.
#
CONTAINER="php"
ROOT_DIR="/var/www/app"
GIT_USER=$(git config user.name)
GIT_EMAIL=$(git config user.email)
@guiyomh
guiyomh / docker.md
Created February 20, 2018 13:39 — forked from f3l1x/aliases
Docker - installation, tips, commands, aliases

Docker

Shortcuts

$ curl -fsSL https://raw.github.com/tcnksm/docker-alias/master/zshrc >> ~/.bashrc && source ~/.bashrc
# ------------------------------------
@guiyomh
guiyomh / iterm2-solarized.md
Created February 19, 2018 19:36 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@guiyomh
guiyomh / yosemite ntfs read+write.txt
Created September 21, 2017 12:28 — forked from bjorgvino/yosemite ntfs read+write.txt
osxfuse + ntfs-3g + Yosemite = NTFS R/W
Remove osxfuse if installed via homebrew:
> brew uninstall osxfuse
Install osxfuse binary and choose to install the MacFUSE compatibility layer:
http://sourceforge.net/projects/osxfuse/files/latest/download?source=files
Reboot (optional but recommended by osxfuse)
Install ntfs-3g via homebrew:
> brew update && brew install ntfs-3g
@guiyomh
guiyomh / .bashrc
Created June 26, 2017 07:43
Show Git branch name on the Linux prompt
# Add git branch if its present to PS1
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\]$(parse_git_branch)\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(parse_git_branch)\$ '
fi
unset color_prompt force_color_prompt
@guiyomh
guiyomh / mysql_backup.sh
Created January 12, 2017 09:12
Mysql Backup data and schema
#!/bin/bash
# Configuration de base: datestamp e.g. YYYYMMDD
DATE=$(date +"%Y%m%d")
# Dossier où sauvegarder les backups (créez le d'abord!)
BACKUP_DIR="/backup/mysql"
@guiyomh
guiyomh / Builder.php
Created July 24, 2016 21:39 — forked from fsevestre/ README.md
Symfony 2 breadcrumbs based on KnpMenuBundle (KnpMenu 2.1)
<?php
namespace AppBundle\Menu;
use Knp\Menu\FactoryInterface;
class Builder
{
/**
* @var FactoryInterface