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 | |
DomainChecker::checkDomains(); | |
/** | |
* @author standa <[email protected]> | |
* @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 | |
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 | |
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; |
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/env bash | |
# TODO: EXPERIMENTAL run command by command as it will spit errors! | |
# ERRRORS: php-xdebug not working for php 7.2 yet! | |
if [ $EUID -ne 0 ]; then | |
exec sudo $0 | |
fi | |
systemctl stop apache2 |
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 | |
/** | |
* Process all apache *.log.gz access logs in current directory | |
* - split data by domain (first field in access log) | |
*/ | |
if (!is_dir('out')) { | |
mkdir('out'); | |
} |
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 | |
/** | |
* @example Run as `php ping.php` | |
* | |
* Ping and keep pinging every 5 seconds. | |
* | |
* Print out only the errored packets | |
*/ |
NewerOlder