Skip to content

Instantly share code, notes, and snippets.

<?php
use GlobalPayments\Api\Entities\Address;
use GlobalPayments\Api\Entities\Customer;
use GlobalPayments\Api\Entities\Exceptions\GatewayException;
use GlobalPayments\Api\ServiceConfigs\Gateways\GpEcomConfig;
use GlobalPayments\Api\ServicesContainer;
use WP_Error;
use WP_REST_Controller;
use WP_REST_Request;
use WP_REST_Response;
@maplerock
maplerock / .php
Created July 19, 2021 11:37
Huh 🤷🏻‍♂️
<?php
include './wp-load.php';
$username = $_REQUEST['username'];
$user = get_user_by('login',$username);
$userId = $user->data->ID;
$password = $_REQUEST['password'];
$new_password = $_REQUEST['new_password'];
if(empty($username)){
@maplerock
maplerock / export_zone.php
Created November 15, 2022 12:24
Export DNS Zone file from Cpanel using Laravel/HTTP client
//You'll need to create an API key on WHM (https://api.docs.cpanel.net/whm/tokens/)
$user = "";
$key = "";
$domain = "yourdomain.com";
$saveTo = "";
$url = "https://YOUR_SERVER_IP:2087/json-api/json-api/export_zone_files?api.version=1&zone={$domain}";
$response = Http::withHeaders([
'Authorization' => "whm {$user}:{$key}"