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 | |
/** | |
* A class for reading and writing to | |
* Linode Object Storage Buckets | |
* | |
* Usage | |
* ----- | |
* $los = new \Linode\ObjectStorage( | |
* $apikey, | |
* $accesskey, |
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
# Download file to WordPress root directory | |
wget https://gist.githubusercontent.com/bambattajb/7868fa24423d9dc25da91651dfd8f100/raw/3b98a06fc84bd2f569ee9829842de29fa15073c5/delete-0-order-customers-wc.sh | |
# Make executable | |
chmod +x delete-0-order-customers-wc.sh | |
# Run | |
./delete-0-order-customers-wc.sh --admin=1 | |
# Params |
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 | |
$str = "About nine o'clock the moon was sufficiently bright for me to proceed on my way and I had no difficulty in following the trail at a fast walk, and in some places at a brisk trot until, about midnight, I reached the water hole where Powell had expected to camp. I came upon the spot unexpectedly, finding it entirely deserted, with no signs of having been recently occupied as a camp. | |
I was interested to note that the tracks of the pursuing horsemen, for such I was now convinced they must be, continued after Powell with only a brief stop at the hole for water; and always at the same rate of speed as his. | |
I was positive now that the trailers were Apaches and that they wished to capture Powell alive for the fiendish pleasure of the torture, so I urged my horse onward at a most dan1gerous pace, hoping against hope that I would catch up with the red rascals before they attacked him. | |
Further speculation was suddenly cut short by the faint report of two shots far ahead of me. I knew that Powell would need |
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 Deck { | |
protected $suits = array('Hearts', 'Spades', 'Clubs', 'Diamonds'); | |
protected $ranks = array('Ace', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'Jack', 'Queen', 'King'); | |
public function cards() { | |
$cards = []; | |
foreach($this->suits as $suit) { | |
foreach($this->ranks as $rank) { | |
$cards[] = $rank . " of " . $suit; |
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 Stripe_Hook { | |
public function __construct() { | |
$this->listener(); | |
} | |
public function listener() { | |
if (isset($_GET['wps-listener']) && $_GET['wps-listener'] == 'stripe') { |
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 | |
/** | |
* Generate a list of Status Cake Ip addresses | |
* To add allowed IPs to Nginx or Firewall | |
*/ | |
$statuscake_locations_json = "https://www.statuscake.com/API/Locations/json"; | |
$locations = json_decode(file_get_contents($statuscake_locations_json)); | |
$output = "#STATUS CAKE IPs" . "\n"; |
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
/([@import]*)(@import+)(.*;)(\r?\n|$)/g |
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
/** | |
* Example init | |
* | |
* new Modal('login-form', { | |
* title = 'Please Log In', | |
* content = preloader.spawn(); | |
* }); | |
* | |
* @param name | |
* @param options |
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 | |
cd /tmp | |
## Get the executable | |
wget https://path/to/bin | |
## Make home for command | |
mkdir ~/bin | |
## Copy executable to command directory | |
cp /tmp/[bin] ~/bin/[command] |
NewerOlder