Skip to content

Instantly share code, notes, and snippets.

View althaus's full-sized avatar
🏠
Working from home

Matthias Althaus althaus

🏠
Working from home
View GitHub Profile
@adrienpoly
adrienpoly / upgrade.md
Created September 24, 2021 09:32
Upgrade to Stimulus 3 recommandations

To upgrade to Stimulus 3.0 and minimize the side effects of the npm package name change here is my suggestion

# add the proxy package
yarn add stimulus

# add the new @hotwired/stimulus package
yarn add @hotwired/stimulus

# add the dedicated package for the Webpack helpers
@sbyx
sbyx / notify-or-do-something-when-an-appliance-like-a-dishwasher-or-washing-machine-finishes.yaml
Last active May 9, 2024 07:15
Home Assistant Blueprint: Notify or do something when an appliance like a dishwasher or washing machine finishes
blueprint:
name: Appliance has finished
description: Do something when an appliance (like a washing machine or dishwasher)
has finished as detected by a power sensor.
domain: automation
input:
power_sensor:
name: Power Sensor
description: Power sensor entity (e.g. from a smart plug device).
selector:
powershell (Add-Type '[DllImport(\"user32.dll\")]^public static extern int PostMessage(int hWnd, int hMsg, int wParam, int lParam);' -Name a -Pas)::PostMessage(-1,0x0112,0xF170,2)
@webbertakken
webbertakken / DtoUniqueEntity.php
Last active May 2, 2024 10:21
DataTransferObject-UniqueEntityConstraint
<?php
namespace App\Validator\Constraints;
use Symfony\Component\Validator\Constraint;
/**
* @Annotation
*/
class DtoUniqueEntity extends Constraint
@giansalex
giansalex / docker-php-ext-install.md
Last active October 3, 2023 10:02
docker-php-ext-install Reference
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ 
@Raphhh
Raphhh / ContextualOptionsFormListener.php
Last active August 2, 2023 13:45
Symfony form: set options according to the data
<?php
namespace AppBundle\Form\EventListener;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
class ContextualOptionsFormListener implements EventSubscriberInterface
{
/**
@benck
benck / x-editable-bs4.js
Last active January 21, 2021 08:44
A fix for x-editable to be compatible with bootstrap 4.0.0 alpha 5 and jQuery 3.1.1. Make sure you include Tether for bootstrap 4. (The button is changed to Fontawesome, you may change the $.fn.editableform.buttons to your desired buttons.)
/*! X-editable - v1.5.1
* In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
* http://github.com/vitalets/x-editable
* Copyright (c) 2013 Vitaliy Potapov; Licensed MIT */
/**
Form with single input element, two buttons and two states: normal/loading.
Applied as jQuery method to DIV tag (not to form tag!). This is because form can be in loading state when spinner shown.
Editableform is linked with one of input types, e.g. 'text', 'select' etc.
@class editableform
@mickaelandrieu
mickaelandrieu / upgrade2.3-to-2.7.md
Last active April 26, 2022 11:56
Complete migration guide from Symfony 2.3 LTS to Symfony 2.7 LTS

From Symfony 2.3 to Symfony 2.7: the complete guide

Objectives

  • assume your code doesn't use any deprecated from versions below Symfony 2.3
  • update dependencies from 2.3 to 2.7
  • do not support "deprecated", be "Symfony3-ready"
  • list tasks component by component, bundle by bundle.
@waja
waja / README.md
Last active December 15, 2021 10:50
Migration from Debian Wheezy to Jessie
<?php
namespace My\AppBundle\Listener;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\Security\Core\SecurityContextInterface;
use Symfony\Component\Security\Core\User\UserProviderInterface;
use Symfony\Component\Security\Core\User\UserCheckerInterface;
use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;