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 speedtest python script | |
# wget https://raw.githubusercontent.com/rsvp/speedtest-linux/master/speedtest | |
# wget https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest_cli.py | |
while true; do ./speedtest --log; sleep 900; done |
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 | |
/** | |
* download latest posts from the Wordpress blog | |
* - will only return 3 latest posts with a $tag homepage by default | |
* | |
* you will need PHP Curl extension - I'm too lazy to use native php sockets :) | |
* and also xmlrpc so please: | |
* | |
* apt-get install php5-curl php5-xmlrpc |
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 if (!defined('BASEPATH')) die(); | |
/** | |
* This is a complete rewrite to use the Mandrill API instead of the | |
* weird thing that OpenCart people patched up in here. | |
* | |
* Inspired by Mindrill | |
* @link https://github.com/darrenscerri/Mindrill | |
* | |
* @author standa |
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 declare(strict_types=1); | |
namespace Maternia\Utils\Terminal; | |
error_reporting(E_ALL); | |
ini_set('display_errors', '1'); | |
ob_implicit_flush(); | |
const HOST = '192.168.0.176'; |
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 Mail | |
{ | |
// @author standa | additional features related to mailgun and logging | |
use MailgunTrait, LoggedEmailTrait; | |
public function send() | |
{ | |
// ... |
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 | |
function parse_mailgun_webhook_stdin(): array | |
{ | |
$raw = file_get_contents('php://input'); | |
$json = json_decode($raw, true); | |
$order_id = $json['event-data']['user-variables']['order_id'] ?? $json['event-data']['user-variables']['order-id'] ?? null; | |
$mail_id = $json['event-data']['user-variables']['mail_id'] ?? $json['event-data']['user-variables']['mail-id'] ?? null; | |
$recipient = $json['event-data']['recipient'] ?? null; |
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 | |
DomainChecker::checkDomains(); | |
/** | |
* @author standa <standa@jasa.name> | |
* @version 2014-11-25 | |
*/ | |
class DomainChecker | |
{ |
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 | |
namespace League\Framework\Server\Controller; | |
use League\Plates\Engine; | |
use Psr\Http\Message\ResponseInterface; | |
use Psr\Http\Message\ServerRequestInterface; | |
/** | |
* Example implementation of the default routing strategy (RequestResponseStrategy) |
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
var description = 'GoExpress delay of delivery for all the parcels from 3.04, because of Easter'; | |
$('.data-admin input[name="orderIds[]"]').each((k,v) => { | |
var orderId = v.value | |
var data = new FormData() | |
data.append('order-report-type', 7) // DELAY | |
data.append('order-report-description', description) | |
var request = new XMLHttpRequest(); | |
request.open("POST", "/admin/order-report/report/orderId/"+orderId); | |
request.send(data); |
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 | |
/** | |
* @see https://www.reddit.com/r/PHP/comments/7wu9w5/gsx_db_update_your_website_data_instantly_with_a/ | |
*/ | |
class Gsx_db { | |
var $google_page_id; | |
var $tables; |
NewerOlder