Skip to content

Instantly share code, notes, and snippets.

View weaverryan's full-sized avatar

Ryan Weaver weaverryan

View GitHub Profile
@weaverryan
weaverryan / ideas.md
Last active December 20, 2023 14:32
Sharing Twig Components & Stimulus Controllers

Possible Components

  • Modal
  • Tooltip/Popover
  • Button
  • Tabs
  • Toast
  • Dropdown
  • Trix
  • (video player)
@weaverryan
weaverryan / ideas.md
Created December 9, 2023 14:35
Live Coding Ideas / Trying out Interesting / Hard stuff!
@weaverryan
weaverryan / CheeseNormalizer.php
Created June 30, 2020 19:43
inlining children of a self-referencing to an IRI in API Platform
<?php
namespace App\Serializer\Normalizer;
use App\Entity\CheeseListing;
use Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface;
use Symfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait;
@weaverryan
weaverryan / console.php
Last active May 14, 2018 18:13
working on console
#!/usr/bin/env php
<?php
use App\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Debug\Debug;
use Symfony\Component\Dotenv\Dotenv;
set_time_limit(0);
@weaverryan
weaverryan / deets.md
Created February 8, 2018 12:15
PhpStorm Users with Symfony!

PhpStorm has some AWESOME plugins for Symfony.

To install them:

  1. Open the PhpStorm "Preferences"
  2. Search "Symfony" and select the top-level Plugin menu item
  3. Near the bottom, click the "Browse Repositories" button

Browse Repositories

@weaverryan
weaverryan / Comment.php
Last active February 8, 2018 02:50
Symfony Demo with make:entity --regenerate --overwrite
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@weaverryan
weaverryan / test-maker.md
Created February 8, 2018 01:34
How to help test the new make:entity Command
  1. In your composer.json file, add the weaverryan fork:
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/weaverryan/maker-bundle"
        }
    ],
<?php
namespace App\Controller;
use App\Repository\ProdutoRepository;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class ProdutoController extends Controller
{
@weaverryan
weaverryan / the_form.html.twig
Last active January 13, 2018 19:48
fosU registration form
{# ... #}
{% block body %}
{{ form_start(form, {'method': 'post', 'action': path('fos_user_registration_register'), 'attr': {'class': 'fos_user_registration_register'}}) }}
{{ form_row(form.email, {
attr: { class: 'some-custom-class'}
}) }}
{{ form_row(form.username) }}
{{ form_row(form.plainPassword) }}
<div>
@weaverryan
weaverryan / framework.yml
Last active January 7, 2018 15:32
different caching
framework:
# ...
cache:
app: cache.adapter.apcu
# or you could use cache.adapter.redis
# and configure below via
# default_redis_provider: redis://localhost