Skip to content

Instantly share code, notes, and snippets.

View hpatoio's full-sized avatar
:shipit:

Simone Fumagalli hpatoio

:shipit:
View GitHub Profile
@hpatoio
hpatoio / test-backstage.txt
Created September 1, 2023 14:13
test-backstage
here the content
@hpatoio
hpatoio / gist:4398399
Last active March 15, 2021 02:46
Create a MySQL database and create a user with all grant on it
CREATE USER 'DB_USERNAME'@'localhost' IDENTIFIED BY 'DB_PASSWORD';
GRANT USAGE ON * . * TO 'DB_USERNAME'@'localhost' IDENTIFIED BY 'DB_PASSWORD' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
CREATE DATABASE IF NOT EXISTS `DB_USERNAME` ;
GRANT ALL PRIVILEGES ON `DB_USERNAME` . * TO 'DB_USERNAME'@'localhost';
#For connection from everywhere
GRANT USAGE ON * . * TO 'DB_USERNAME'@'%' IDENTIFIED BY 'DB_PASSWORD' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0
GRANT ALL PRIVILEGES ON `DB_USERNAME` . * TO 'DB_USERNAME'@'%';
@hpatoio
hpatoio / yml
Created September 8, 2020 12:21
.spectral
#CONFIGURATION FILE FOR SPECTRAL SWAGGER/OPEANAPI FILE LINTER
extends: spectral:oas
functions: [enum-uppercase]
rules:
enum-uppercase:
message: "{{error}}"
given: "$.paths.*.parameters.*.schema.enum"
then:
function: "enum-uppercase"
@hpatoio
hpatoio / HpatoioForcepassupdateListener.php
Last active June 26, 2018 15:58
Event listener to force FOS user to change password
<?php
namespace Hpatoio\UserBundle\EventListener;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Bundle\FrameworkBundle\Routing\Router;
use Symfony\Component\HttpFoundation\Session\Session;
{
"children": {
"firstname": {
"value": "",
"type": "text",
"required": true,
"label": "Name"
},
"lastname": {
"value": "",
simone@ubuntu:~/workspace/sf2-demo$ composer update hpatoio/deploy-bundle
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing hpatoio/deploy-bundle (1.4)
Downloading: 100%
Writing lock file
Generating autoload files
Updating the "app/config/parameters.yml" file
simone@ubuntu:~/workspace/sf2-demo$ composer show hpatoio/deploy-bundle
PHP Warning: Xdebug MUST be loaded as a Zend extension in Unknown on line 0
name : hpatoio/deploy-bundle
descrip. : Easy deploy via rsync. Porting of Symfony 1 project:deploy command.
keywords : deploy, command
versions : dev-master, 1.4, 1.3, 1.2, 1.1, 1.0, * dev-local
type : symfony-bundle
license : CC-BY-SA-3.0
source : [git] /home/simone/workspace/local_bundles/DeployBundle 5244f7447d4283ebdf7b4c19c5e0dca67267a0f8
dist : []
simone@namazu:~/workspace/sf2-demo$ tail -n 1 vendor/hpatoio/deploy-bundle/Hpatoio/DeployBundle/README.md
simone@namazu:~/workspace/sf2-demo$ composer update hpatoio/deploy-bundle
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Removing hpatoio/deploy-bundle (1.4)
- Installing hpatoio/deploy-bundle (dev-local 5244f74)
Cloning 5244f7447d4283ebdf7b4c19c5e0dca67267a0f8
[..]
@hpatoio
hpatoio / change.sh
Last active December 31, 2015 03:19
simone@namazu:~/workspace/local_bundles/DeployBundle$ printf "\nMy new Line" >> README.md
simone@namazu:~/workspace/local_bundles/DeployBundle$ git add README.md
simone@namazu:~/workspace/local_bundles/DeployBundle$ git commit -m "Change on branch 'local'"
[local fc1aa1b] On branch 'local'
1 file changed, 2 insertions(+)