This file contains hidden or 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 | |
| if (!defined("WHMCS")) | |
| die("This file cannot be accessed directly"); | |
| use WHMCS\Database\Capsule; | |
| function wb_mark_zero_invoices_paid(){ | |
| //get all unpaid invoices | |
| $unpaid_invoices = Capsule::table('tblinvoices')->where('status', 'Unpaid')->get(); | |
| foreach( $unpaid_invoices as $inv ){ |
This file contains hidden or 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 | |
| require 'vendor/autoload.php'; | |
| $mpesa = new \Karson\MpesaPhpSdk\Mpesa(); | |
| $mpesa->setPublicKey('Your public key'); | |
| $mpesa->setApiKey('Your Api key'); | |
| $mpesa->setEnv('test'); | |
This file contains hidden or 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 | |
| /** | |
| * Cloudflare IP Sync | |
| * | |
| * This hook syncs the Cloudflare IPs with WHMCS's trusted | |
| * proxy list. | |
| * | |
| * https://www.cloudflare.com/ips/ | |
| * | |
| * @version 1.0 |
This file contains hidden or 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
| //https://stackoverflow.com/questions/55921442/how-to-fix-referenceerror-primordials-is-not-defined-in-node | |
| //These fixes enable you to use Node.js 12 with gulp@3.9.1 by overriding graceful-fs to version 4.2.3. | |
| //Create a npm-shrinkwrap.json file containing this: | |
| { | |
| "dependencies": { | |
| "graceful-fs": { | |
| "version": "4.2.3" | |
| } | |
| } |
This file contains hidden or 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 | |
| /** | |
| * @package Custom_queries | |
| * @version 1.0 | |
| */ | |
| /* | |
| Plugin Name: Custom queries | |
| Plugin URI: http://wordpress.org/extend/plugins/# | |
| Description: This is an example plugin | |
| Author: Carlo Daniele |
This file contains hidden or 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 | |
| // command line | |
| // curl --data "text=foobar" http://localhost:3001/api/decrypt | |
| // File sockets | |
| function http_request($url, $data, $a = null, $b = null) { | |
| $opts = array('http' => | |
| array( | |
| 'method' => 'POST', |
This file contains hidden or 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
| #no recursive | |
| sed -i -- 's/foo/bar/g' * | |
| perl -i -pe 's/foo/bar/g' ./* | |
| #######Recusive | |
| find . -type f -name 'xa*' -exec sed -i 's/asd/dsg/g' {} \; | |
| #Alternatively, one could use xargs, which will invoke fewer processes: | |
| find . -type f -name 'xa*' | xargs sed -i 's/asd/dsg/g' | |
| #Or more simply use the + exec variant instead of ; in find to allow find to provide more than one file per subprocess call: |
This file contains hidden or 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
| #In terminal, log into MySQL as root. | |
| sudo mysql -p -u root | |
| #Create pmauser | |
| CREATE USER 'pmauser'@'%' IDENTIFIED BY 'password_here'; | |
| #Now we will grant superuser privilege to our new user. | |
| GRANT ALL PRIVILEGES ON *.* TO 'pmauser'@'%' WITH GRANT OPTION; |
This file contains hidden or 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
| text = ''; for( el of document.querySelectorAll('.account-name') ) { text+=el.innerHTML+"\n"; }; console.log(text) |
This file contains hidden or 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 | |
| public function register() | |
| { | |
| $this->app->bind('path.public', function() { | |
| realpath(base_path().'/../public_html'); | |
| }); | |
| } |