Skip to content

Instantly share code, notes, and snippets.

@antfroger
antfroger / README.md
Last active March 2, 2024 15:47
Using xdebug with Windows 10, WSL2, Docker and VS Code

Configuring xdebug to work with Windows 10 (WSL2), Docker and VS Code

Configuring your dev environment to be able to use xdebug when you're working on Windows 10 (with WSL2) and Docker with VS Code can be (a bit) tricky.
This is a quick reminder of how I've done that.

Configuring the environment

  1. Install and configure xdebug in Docker

Install xdebug according to the Docker image you're using

# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@antfroger
antfroger / Makefile
Created August 22, 2017 09:21
Go makefile
IGNORED_PACKAGES := /vendor/
PACKAGES := $(shell ( go list ./... | grep -v -e "^$$" $(addprefix -e ,$(IGNORED_PACKAGES)) ))
DIRS := $(shell ( go list -f '{{.Dir}}' ./... | grep -v -e "^$$" $(addprefix -e ,$(IGNORED_PACKAGES)) ))
.PHONY: test
test:
go test $(PACKAGES)
.PHONY: fmt
# Run gofmt on all source files
@antfroger
antfroger / alias_php.bash
Last active August 22, 2017 09:24
useful_alias.sh
xphp='php -dxdebug.remote_enable=1 -dxdebug.remote_autostart=On -dxdebug.idekey=PHPSTORM'
@antfroger
antfroger / git-grep-over-time.sh
Last active August 22, 2017 09:25
Git grep in all merges/commits into the current branch since a specific date
#!/usr/bin/env bash
if [ $# -eq 0 ]
then
self=$(basename $0)
echo "Usage: $self pattern directory"
exit 1
fi
pattern=$1
since="--since=2015-12-01"
@antfroger
antfroger / forum_php_2014.md
Last active October 21, 2017 12:53
Forum PHP 2014
@antfroger
antfroger / post.md
Last active July 18, 2023 09:13 — forked from kbond/post.md
Ubuntu LAMP Development Environment Setup

Install apache/php:

sudo apt-get install apache2 php5 php5-cli libapache2-mod-php5 php5-dev

Ensure this worked by visiting http://localhost/. You should see It works!.

Install useful php modules:

sudo apt-get install php5-mcrypt php5-xdebug php5-curl php5-sqlite php5-xsl php-pear php-apc php5-intl
sudo pear install --alldeps PHP_CodeSniffer