Skip to content

Instantly share code, notes, and snippets.

View treetop1500's full-sized avatar

Robert Wade treetop1500

  • Gray Loon Marketing Group
  • Salt Lake City, Utah
View GitHub Profile
@treetop1500
treetop1500 / _meta.html.twig
Last active August 31, 2024 21:28
Twig template for meta tags, titles and other head element meta data.
{#
Relies mostly on a meta array containing appropriate values.
site_name is a parameter set as a Twig Global
default_share_image is a fallback parameter set as a Twig Global
#}
<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="robots" content="index, follow" />
<meta property="og:type" content="website" />
@treetop1500
treetop1500 / .adding-wkhtmltopdf-to-symfony-on-platform-with-knpsnappy-bundle
Last active December 30, 2018 10:09
KNP Snappy wkhtmltopdf configuration for Platform.sh
# This file means nothing. It's just here to give the Gist a name I can understand.
# This configuration requires the KNP Snappy Bundle [https://github.com/KnpLabs/KnpSnappyBundle]
@treetop1500
treetop1500 / 1. composer.json
Created March 21, 2018 18:34
Doctrine Fetch Any Number of Random Results
{
...
"require": {
"luxifer/doctrine-functions": "~1.4",
}
}
@treetop1500
treetop1500 / 1. composer.json
Last active January 19, 2022 08:26
Amazon S3 Force Download of Remote File with Symfony (AWS S3 PHP SDK V.3)
{
},
"require": {
"aws/aws-sdk-php": "3.*"
}
}
@treetop1500
treetop1500 / BaseFileType.php
Last active March 29, 2021 23:19
Vich Uploader Twig Fields
<?php
namespace AppBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Vich\UploaderBundle\Form\Type\VichFileType;
@treetop1500
treetop1500 / FroalaS3Service
Last active October 3, 2017 16:15
A helper service for uploading to S3 via Froala
<?php
/**
* Created by PhpStorm.
* User: [email protected]
* Date: 10/2/17
* Time: 12:18 PM
*/
namespace Hoyt\UtilBundle;
@treetop1500
treetop1500 / AmazonS3Service.php
Last active October 3, 2017 15:39
A class for communicating uploads via the Amazon AWS PHP SDK
<?php
namespace Hoyt\UtilBundle;
use Aws\S3\S3Client;
/**
* Class AmazonS3Service
*
* @package Hoyt\UtilBundle
*/
@treetop1500
treetop1500 / RsyncCommand.php
Last active April 26, 2017 16:33
Rsync Console Command
<?php
/**
* Created by [email protected]
* User: rwade
* Date: 4/26/17
* Time: 9:53 AM
* @todo update output to be buffered realtime output
* @todo colored output
*/
namespace AppBundle\Command;
@treetop1500
treetop1500 / MarkDownTransformer.php
Created March 24, 2017 17:20
DataTransformer for Markdown Syntax and custom Markdown input field
<?php
namespace Common\ContentBundle\DataTransformer;
use Symfony\Component\Form\DataTransformerInterface;
/**
* Class MarkdownTransformer
* @package Common\ContentBundle\DataTransformer
*/
class MarkdownTransformer implements DataTransformerInterface
@treetop1500
treetop1500 / ProductCategory.php
Created March 22, 2017 14:12
Sortable Drag and Drop Entities with Symfony and HTML5
<?php
namespace Common\ContentBundle\Entity;
...
use Gedmo\Mapping\Annotation as Gedmo;
class ProductCategory
{
...
/**
* @var integer $position