Simple implementations (2 variants) of the reconnection mechanism for CURL in PHP.
tihoho, 07.2019
Telegram: https://t.me/tihoho
PayPal for beer: [email protected]
<?php | |
/** | |
* Docx Replacer | |
* | |
* @author Not me | |
* @param string $input Input file path | |
* @param string $output Output file path | |
* @param string $replacements Assoc array of replaces placeholders Ex: ['{NAME}' => 'Alex', ...] | |
*/ |
Simple implementations (2 variants) of the reconnection mechanism for CURL in PHP.
tihoho, 07.2019
Telegram: https://t.me/tihoho
PayPal for beer: [email protected]
server { | |
set $cors_origin ""; | |
set $cors_cred ""; | |
set $cors_header ""; | |
set $cors_method ""; | |
if ($http_origin ~* "^http.*\.yourhost\.com$") { | |
set $cors_origin $http_origin; | |
set $cors_cred true; | |
set $cors_header $http_access_control_request_headers; |
Stopping spam is a constant fight and due to this, your account has restrictions specifically on port 25. However, you are be able to use mail services using ports 587, 993, 995 and 465. You will need to open these ports in your firewall. Here is our guide to common iptables commands: | |
https://www.digitalocean.com/community/tutorials/iptables-essentials-common-firewall-rules-and-commands#service-mail | |
We realize this is inconvenient, but many customers in your position move their mailing activities to a third party service such as SendGrid or similar which processes such mail separately from their droplet. I'm sorry for the frustration but we're not able to lift this port restriction at this time. | |
In terms of a workaround, here are a few alternatives: | |
1. Utilize port 587 for SMTP relay via another mail provider, for example G Suite/Gmail, Mailgun, etc. We have a guide on doing so using Postfix here: |
/* | |
##Device = Desktops | |
##Screen = 1281px to higher resolution desktops | |
*/ | |
@media (min-width: 1281px) { | |
//CSS | |
<?php | |
function backSide($lat, $lon) { | |
$lat *= -1; | |
$lon = $lon < 0 ? $lon + 180 : $lon - 180; | |
return [$lat, $lon]; | |
} |
<?php | |
namespace common\models; | |
use Yii; | |
use yii\base\Model; | |
use yii\data\ActiveDataProvider; | |
use common\models\User; | |
use common\models\Balance; |
delete from MYTABLE where id in ( | |
select id from ( | |
select id, count(*) 'c' from MYTABLE where 1 group by MYFIELD having count(`c`) > 1 | |
) as `items` | |
) |
<?php | |
// Входящие данные | |
$article = 'hp'; // артикул товара | |
$sum = 3563; //Сумма (для теста тут принтер hp + 4 катриджа: hpb*3 + hpr*1) | |
// принтеры | |
$printersPrice = [ | |
'canon' => 1000, | |
'hp' => 2000, |
-- юзеры | |
CREATE TABLE `users` ( | |
`id` INT(11) NOT NULL AUTO_INCREMENT, | |
`firstname` VARCHAR(32) NULL DEFAULT 'No_name', | |
PRIMARY KEY (`id`) | |
) | |
ENGINE=InnoDB | |
; | |
-- хобби |