View SurfaceCalculator.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Class SurfaceCalculator | |
* | |
* This class provides methods to calculate the area of various shapes | |
* like polygons, triangles, rectangles, circles, trapezoids, and ellipses. | |
*/ | |
class SurfaceCalculator { | |
/** |
View send-email-test.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
php -r "\$from = \$to = 'testmail@awesome.ug'; \$x = mail(\$to, 'subject'.time(), 'Hello World', 'From: '. \$from); var_dump(\$x);" |
View php.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zend_extension="xdebug.so" | |
[xdebug] | |
xdebug.mode = debug | |
xdebug.start_with_request = yes |
View xdebug-switch.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" ]; |
View create-wp-user.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'init', function () { | |
$username = 'admin'; | |
$password = 'password'; | |
$email_address = 'mail@me.org'; | |
if ( ! username_exists( $username ) ) { | |
$user_id = wp_create_user( $username, $password, $email_address ); |
View send-iframe-height.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let get_document_height = function () { | |
var body = document.body, | |
html = document.documentElement; | |
var height = Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight ); | |
return height; | |
} | |
let send_document_height = function () { | |
var height = get_document_height(); |
View cloudSettings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2020-07-27T13:57:18.980Z","extensionVersion":"v3.4.3"} |
View self-written-protector-loader.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Adding the protector to Torro Forms. | |
* | |
* @param Module $protectors Action manager instance. | |
*/ | |
function add_protector( $protector_manager ) { | |
require __DIR__ . '/self-written-protector.php'; | |
$protector_manager->register( 'selfwrittenprotector', 'Self_Written_Protector' ); |
View filtering-element-wrap-classes.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Filters the element wrap classes. | |
* | |
* @param array $wrap_classes Array of wrap classes. | |
* @param Element $element Element object. | |
*/ | |
function add_element_wrapper_class( $wrapper_classes, $element ) { | |
// If wanted, selecting a specific element |
View self-written-protector.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Self written protector. | |
* | |
* To see a full working example, just take a look at the Torro Forms Timetrap Protector: | |
* https://github.com/awsmug/torro-forms/blob/master/src/src/modules/protectors/timetrap.php | |
*/ | |
class Self_Written_Protector extends awsmug\Torro_Forms\Modules\Protectors\Protector { | |
/** |
NewerOlder