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 / FroalaS3Service
Last active October 3, 2017 16:15
A helper service for uploading to S3 via Froala
<?php
/**
* Created by PhpStorm.
* User: rwade@grayloon.com
* 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 rwade@grayloon.com
* 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
@treetop1500
treetop1500 / index.html.twig
Created March 15, 2017 14:44
Copy to clipboard with javascript and Foundation input groups and tooltips
{# 1: Setup --------------------------------- #}
{# https://clipboardjs.com/ #}
{# 2: Input group -------------------------- #}
<div class="input-group">
<label for="vcsRepo" class="input-group-label">{{ entity.vcsSystem }}:</label>
<input type="text" class="input-group-field" id="vcsRepo" name="vcsRepo" value="{{ entity.vcsRepo }}" />
<div class="input-group-button">
<button id="copyRepo"
data-clipboard-target="#vcsRepo"
@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 / symfony_accessible_breadcrumbs
Last active November 8, 2016 18:04
Accessible Symfony Breadcrumbs
// app/resources/views/breadcrumbs.html.twig
// this file will be included with the 'breadcrumbs' variable
<nav aria-label="You are here:" role="navigation">
<ul class="breadcrumbs">
<li>
<a href="/">
<i class="fa fa-home"></i>
</a>
</li>
{% for crumb in breadcrumbs %}
@treetop1500
treetop1500 / config_dev.yml
Last active October 3, 2016 15:50
Monolog Config
monolog:
handlers:
main:
type: rotating_file
path: %kernel.logs_dir%/%kernel.environment%.log
level: error
max_files: 10
action_level: error
bubble: true
grouped:
@treetop1500
treetop1500 / config_prod.yml
Last active October 7, 2016 12:13
Monolog Config
monolog:
handlers:
main:
type: rotating_file
path: %kernel.logs_dir%/%kernel.environment%.log
level: error
max_files: 10
action_level: error
bubble: true
slack: