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.
- Install and configure xdebug in Docker
<?php | |
namespace App\Console\Commands; | |
use Illuminate\Console\Command; | |
use Illuminate\Filesystem\Filesystem; | |
class CollectionCommand extends Command | |
{ | |
protected $signature = 'make:collection {model}'; |
{ | |
"Lavavel Model Getter and Setter": { | |
"prefix": "lgs", | |
"body": [ | |
"public function get$1(): $2 {", | |
"\treturn $$this->attributes['$3'];", | |
"}\n", | |
"public function set$1($2 $$value): void {", | |
"\t$$this->attributes['$3'] = $$value;", | |
"}" |
#!/usr/bin/env bash | |
if [[ -x $(which php) ]]; then | |
PHP_ICU_VERSION=$(php -r 'echo defined("INTL_ICU_VERSION") ? INTL_ICU_VERSION : "none";') | |
echo "PHP ICU version: $PHP_ICU_VERSION" | |
else | |
echo 'WARNING: PHP not installed' | |
PHP_ICU_VERSION=none | |
fi |
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.
#!/bin/bash | |
EXAMPLE="example default" | |
# Plugin variable description | |
PROGNAME=$(basename $0) | |
RELEASE="Revision 1.0.0" | |
AUTHOR="(c) 2020 Warlord0" | |
# Functions plugin usage |
<?php | |
/* | |
** Plugin Name: WordPress Permissions Fixer | |
** Plugin URI: https://endurtech.com/how-to-fix-wordpress-file-and-folder-permissions/ | |
** Description: Simple php script sets correct directory and file permissions on WordPress and others. Directories are 755, files are 644, wp-config.php is 444. | |
** Author: Manuel Rodrigues | |
** Author URI: https://endurtech.com | |
** Version: 1.1 | |
** Tags: wordpress, php, script, directory, directories, file, files, wp-config.php, chmod, fix | |
** License: GPL-2.0+ |
#!/bin/bash | |
## | |
# Name: GeoIP Firewall script | |
# Author: Pandry | |
# Version: 0.1.1 | |
# Description: This is a simple script that will set up a GeoIP firewall blocking all the zones excecpt the specified ones | |
# it is possible to add the whitelisted zones @ line 47 | |
# Additional notes: Usage of [iprange](https://github.com/firehol/iprange) is suggested | |
# for best performances |
{ | |
"presets": ["env"] | |
} |
#!/bin/bash | |
set -e | |
usage="$(basename "$0") [-h] [-i PROJECT] [-v VM] [-p PYTHON] [-d NOTEBOOKS] | |
Make a user provide SSH key and jupyter notebooks (in roles/bootstrap/files/notebooks) to each user listed in var/common.yml | |
where: | |
-h show this help text | |
-i google cloud project id | |
-v name of instance/virtual machine | |
-p python path |