Skip to content

Instantly share code, notes, and snippets.

View FabianSchmick's full-sized avatar
💭
¯\_(ツ)_/¯

Fabian Schmick FabianSchmick

💭
¯\_(ツ)_/¯
View GitHub Profile
@FabianSchmick
FabianSchmick / FormType.php
Last active November 13, 2019 10:23
Change Symfony Form-field in Form-event
$builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
$data = $event->getData();
$form = $event->getForm();
$config = $form->get('groups')->getConfig(); // get the field config
$name = $config->getName(); // get the name string
$type = get_class($config->getType()->getInnerType()); // get the type class
$options = $config->getOptions(); // get the options array
$options['label'] = "Login Name"; // e.g. change the label
@FabianSchmick
FabianSchmick / app.js
Created May 11, 2020 09:44
Reset radio - switch buttons
/**
* Initializes switch fields
*
* https://stackoverflow.com/a/8318129/5947371
*/
initSwitch() {
let selector = '.custom-control-input[type="radio"]';
$(selector).each((index, radio) => {
let $radio = $(radio),
@FabianSchmick
FabianSchmick / MapService.php
Created May 25, 2020 12:57
Map geo radius search
<?php
namespace App\Service;
use App\Entity\Address;
use Doctrine\ORM\EntityManagerInterface;
use Geocoder\Provider\Nominatim\Nominatim;
use Geocoder\Query\GeocodeQuery;
use Geocoder\StatefulGeocoder;
use Http\Adapter\Guzzle6\Client;
@FabianSchmick
FabianSchmick / Brokkolinudeln-mit-Ei.md
Last active November 4, 2024 10:03
Meine Lieblings-Koch-Rezepte

Brokkolinudeln mit Ei aus dem Wok (2 Portionen)

Zutaten

  • 125g Mie-Nudeln oder Wok-Nudeln
  • 250g Brokkolie
  • 2 Knoblauchzehen
  • 30g Mandeln
  • 3 Eier
  • 2 Tl Sambal Oelek
  • 1 El Zitronensaft
  • 3 El Sojasauce