Skip to content

Instantly share code, notes, and snippets.

View mahype's full-sized avatar

Sven Wagener mahype

  • Awesome UG
  • Hilden
View GitHub Profile
@mahype
mahype / xdebug-switch.php
Created February 24, 2021 09:49
Xdebug switch
#!/bin/bash
PHP_INI_LOCATION=$(php -r 'echo php_ini_loaded_file();')
if [ "$1" = "on" ];
then
`sed -i '' 's/^;zend_extension/zend_extension/g' $PHP_INI_LOCATION`
echo "Xdebug on in ${PHP_INI_LOCATION}"
valet restart
elif [ "$1" = "off" ];
@mahype
mahype / php.ini
Created February 26, 2021 11:39
Minimal xdebug config with Xdebug 3
zend_extension="xdebug.so"
[xdebug]
xdebug.mode = debug
xdebug.start_with_request = yes
@mahype
mahype / send-email-test.sh
Created February 9, 2023 11:00
Send Email Test
#!/usr/bin/bash
php -r "\$from = \$to = '[email protected]'; \$x = mail(\$to, 'subject'.time(), 'Hello World', 'From: '. \$from); var_dump(\$x);"
@mahype
mahype / SurfaceCalculator.php
Last active March 28, 2023 14:06
Surface Calculator
<?php
/**
* Class SurfaceCalculator
*
* This class provides methods to calculate the area of various shapes
* like polygons, triangles, rectangles, circles, trapezoids, and ellipses.
*/
class SurfaceCalculator {
/**