Skip to content

Instantly share code, notes, and snippets.


Tin Benjamin Matuka tbmatuka

View GitHub Profile
tbmatuka / DoubleImage.php
Last active Sep 26, 2021
Blurry lazy loading placeholder SVGs
View DoubleImage.php
function generatePlaceholderSvg(string $originalImageBinary, string $placeholderImageBinary, ?string $idSuffix = null): string
$originalImageSizeInfo = getimagesizefromstring($originalImageBinary);
if (!is_array($originalImageSizeInfo) || !isset($originalImageSizeInfo[3])) {
throw new \RuntimeException('Unable to get image size info.');
tbmatuka / PlaceholderOutlineFilter.php
Created Sep 26, 2021
LiipImagineBundle placeholder outline filter
View PlaceholderOutlineFilter.php
namespace App\Service;
use Imagine\Image\Box;
use Imagine\Image\ImageInterface;
use Imagine\Image\Point;
use Liip\ImagineBundle\Imagine\Filter\Loader\LoaderInterface;
class PlaceholderOutlineFilter implements LoaderInterface
userName="John Doe"
if [[ $1 =~ ^[1-9][0-9]*$ ]]
View base.mjml
<mj-all font-family="Helvetica"></mj-all>
<mj-body background-color="#f6f6f6">
{% trans_default_domain 'email' %}
<!-- Company Header -->