Skip to content

Instantly share code, notes, and snippets.

View renekreijveld's full-sized avatar

Rene Kreijveld renekreijveld

View GitHub Profile
@renekreijveld
renekreijveld / xdebug
Last active July 19, 2024 08:20
XDebug script to switch xdebug on or off
#!/bin/bash
#
# Xdebug switcher for Homebrew based NginX, MariaDB, PHP development stack
# Written by: René Kreijveld, 18/07/2027
# Based on the work of Djamil Legato and Andy Miller
app="$(basename "$0")"
command="$1"
options="$2"
@renekreijveld
renekreijveld / ext-xdebug.ini
Created July 18, 2024 12:05
PHP Xdebug configuration
[xdebug]
zend_extension = "xdebug.so"
xdebug.mode = develop,debug
xdebug.start_with_request = yes
xdebug.client_host = 127.0.0.1
xdebug.discover_client_host = 1
xdebug.client_port = 9003
@renekreijveld
renekreijveld / nginx.conf
Last active July 22, 2024 15:00
NginX config for Homebrew based NginX, MariaDB, PHP development stack
# user setting for this machine
user <your_username> staff;
# you must set worker processes based on your CPU cores, nginx does not benefit from setting more than that
worker_processes auto;
# only log critical errors
error_log /opt/homebrew/var/log/nginx/error.log crit;
events {
#!/bin/bash
# PHP switcher for Homebrew based NginX, MariaDB, PHP development stack
# Written by: René Kreijveld, 17/07/2027
# Based on the work of Phil Cook and Andy Miller.
homebrew_path=$(brew --prefix)
brew_array=("7.4","8.1","8.2","8.3","8.4")
php_array=("php@7.4" "php@8.1" "php@8.2" "php@8.3" "php@8.4")
php_version="php@$1"
requested_version=$1
@renekreijveld
renekreijveld / j5cli.php
Created May 28, 2024 10:36
Joomla 5 CLI
<?php
use \Joomla\CMS\Factory;
const _JEXEC = 1;
define( 'JDEBUG', false );
define( 'JPATH_BASE', dirname( dirname( __FILE__ ) ) );
require_once JPATH_BASE . '/includes/defines.php';
require_once JPATH_BASE . '/includes/framework.php';
@renekreijveld
renekreijveld / listusers.php
Last active March 15, 2023 09:17
Simple Joomla 4 CLI script
<?php
// listusers.php - simple cli script to dump users on CLI
// Written by René Kreijveld
// Version history:
// 1.0, 2023-03-09: Initial version
use Joomla\CMS\Factory;
const _JEXEC = 1;
@renekreijveld
renekreijveld / cleanjoomla
Last active August 26, 2021 07:03
Bash script to cleanup all Joomla files and folders
#!/bin/bash
# cleanjoomla -- Script to delete all Joomla files and folders
#
# This scripts supports Joomla versions 2.5 - 3.x
#
# Copyright 2021 Rene Kreijveld - email@renekreijveld.nl
# This program is free software; you may redistribute it and/or modify it.
#
# Version history
@renekreijveld
renekreijveld / sphp
Last active September 5, 2024 12:17
Easy PHP version switching command-line script for devilbox
#!/bin/bash
# sphp - Easy PHP version switching command-line script for devilbox
# Written by: René Kreijveld, email[at]renekreijveld.nl
# Version
version=1.1
# Available PHP versions in devilbox
php_array=(5.2 5.3 5.4 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0)
# Devilbox folder
devilbox=/Users/yourusername/devilbox
@renekreijveld
renekreijveld / .bash_profile
Created April 23, 2020 07:19
Bash profile
HOST_NAME=macmini
shopt -s autocd
shopt -s histappend
export PATH=$PATH:$HOME/bin
export HISTSIZE=5000
export HISTFILESIZE=10000
@renekreijveld
renekreijveld / yearlist.php
Last active September 9, 2019 08:11
Custom form field to create a select list with year numbers
<?php
/**
* @version 1.0.0
* @author Rene Kreijveld <r.kreijveld@dsd.nl>
* @copyright 2019 DSD Business Internet
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* Example form xml definition:
* <field name="established"
* type="yearlist"