Skip to content

Instantly share code, notes, and snippets.

View matteosavio's full-sized avatar

Matteo Savio matteosavio

View GitHub Profile
@matteosavio
matteosavio / testEmailServer.php
Created June 16, 2025 15:20 — forked from froemken/testEmailServer.php
Very simple PHP Script to test SMTP email server
<?php
// For port 24 host without scheme is just fine
// Add scheme, if using secure connection. Port 465 or 587
$host = 'ssl://smtp.strato.de';
//$host = 'tls://smtp.strato.de';
$port = 465;
//$port = 25;
$errorNumber;
$error;
$timeout = 10;
@matteosavio
matteosavio / DeletedFilter.php
Last active December 26, 2018 13:25 — forked from baptistedonaux/DeletedFilter.php
Soft Delete Symfony/Doctrine
<?php
namespace App\Repository\Filters;
use Doctrine\ORM\Mapping\ClassMetaData;
use Doctrine\ORM\Query\Filter\SQLFilter;
class DeletedFilter extends SQLFilter
{
public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias)
{
@matteosavio
matteosavio / .htaccess
Created April 15, 2018 13:02 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/