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 December 22, 2023 08:12
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 / 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
@treetop1500
treetop1500 / FlatpickerDateTimeType.php
Last active September 10, 2022 08:52
Symfony3 Form Extension for use with Flatpickr javascript date/time pickers
<?php
namespace MyBundle\Form\Extension;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
/**
* Class FlatpickrDateTimeType
* @package MyBundle\Form\Extension
@treetop1500
treetop1500 / darkmode.js
Created March 17, 2022 21:45
Recaptcha and Mapkit Dark Mode swapping with Javascript
// Recaptcha HTML: <div class="g-recaptcha" data-sitekey="{{ site_key }}" data-theme="dark" id="recaptcha"></div>
// MapKit HTML: <div id="map" class="h-full"></div>
// (also requires installation of mapkit.js and recaptcha.js scripts)
var recpatcha = document.getElementById('recaptcha')
var mapKitColorMode = "light";
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
recpatcha.setAttribute('data-theme', 'dark');
mapKitColorMode = "dark"
@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 / BaseContent.php
Created September 12, 2016 16:54
Base Content Entity for Symfony 3 projects
<?php
namespace Common\ContentBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use DoctrineExtensions\Taggable\Taggable;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
use Gedmo\Mapping\Annotation as Gedmo;
Fix for FOUC :
**At the top of your HTML:**
<!doctype html>
<html>
<head>
<style>html{visibility: hidden;opacity:0;}</style>
@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 / issues.txt
Created November 7, 2018 19:12
Issue Label Master List
analytics
bug
ui/ux problem
enhancement
hold
duplicate
enhancement
help wanted
need client feedback
need client info