<?php
# src/Controller/ParentController.php
namespace App\Controller;
use App\Entity\Product;
use Doctrine\ORM\EntityManagerInterface;
use Psr\Log\LoggerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @Author Andrea Bergamasco <andrea@bergamasco.me> | |
* Inspired by @leotiger: https://gist.github.com/leotiger/ca496d1b16c30afea060904bd5e78714 | |
* | |
* Usage: | |
* $token = $this->security->getToken(); | |
* $this->accessChecker->userTokenCanAccessRoute($token, 'admin.index'); | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Kudos to OMOTI | |
https://community.adobe.com/t5/illustrator/script-to-sort-artboard-list-alphabetically/m-p/9558396?page=1#M77799 | |
*/ | |
function sortArtboard() { | |
var doc = app.activeDocument, | |
properties = [], | |
i, | |
max; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Entity workflow - object names redacted | |
# A SuperUser can send an Entity to an Evaluator | |
# The Evaluator decides to optIn or optOut the request. They can change their mind until a timeout defined in the Entity. | |
# If Evaluator opts in, the Entity is then sent to the Recipient. | |
# The Recipient finally decides to accept or refuse | |
framework: | |
workflows: | |
Entity: | |
type: workflow | |
metadata: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ composer require --dev friends-of-behat/symfony-extension:^2.0 | |
./composer.json has been updated | |
Loading composer repositories with package information | |
Updating dependencies (including require-dev) | |
Restricting packages listed in "symfony/symfony" to "4.3.*" | |
Nothing to install or update | |
Generating autoload files | |
ocramius/package-versions: Generating version class... | |
ocramius/package-versions: ...done generating version class | |
Executing script cache:clear [OK] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo Removing .DS_STORE... | |
DEL /S ".DS_STORE" | |
@echo ...OK | |
@echo. | |
@echo Removing Thumbs.db... | |
DEL /S /AH "Thumbs.db" | |
@echo ...OK | |
@echo. | |
@echo Removing __MACOSX... | |
for /f "tokens=* delims=" %%i in ('dir /s /b /a:d __MACOSX') do ( rd /s /q "%%i") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import glob | |
import re | |
import os | |
path = 'puntata*/**/BLOCCO*/*.mp3' | |
def repair_filename(filename): | |
repair = { | |
'´╝ê': '(', # U+0028 LEFT PARENTHESIS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
I am struggling to find the best way to nest quotes while developing grandma2 plugins in LUA | |
This example shows the best solution i've found so far (ESCAPED SiNGLE QUOTES), but unfortunately | |
the command line doesn't like single quotes either. Any suggestion? | |
--]] | |
function quote_escaping_example() | |
gma.echo("Quote escaping example") | |
gma.cmd('Store Sequence 1.1 "QUOTE ESCAPING"'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, re, sys | |
# setup | |
path = './' | |
separator = '-' # this implies a filename as "iconname_somewords-16x16.png" | |
# runtime | |
current_folder = "" | |
files = sorted(os.listdir(path)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"text":"Don't worry about what anybody else is going to do. The best way to predict the future is to invent it.","author":"Alan Kay"},{"text":"Premature optimization is the root of all evil (or at least most of it) in programming.","author":"Donald Knuth"},{"text":"Lisp has jokingly been called \"the most intelligent way to misuse a computer\". I think that description is a great compliment because it transmits the full flavor of liberation: it has assisted a number of our most gifted fellow humans in thinking previously impossible thoughts.","author":"Edsger Dijkstra, CACM, 15:10"},{"text":"Keep away from people who try to belittle your ambitions. Small people always do that, but the really great make you feel that you, too, can become great.","author":"Mark Twain"},{"text":"What Paul does, and does very well, is to take ideas and concepts that are beautiful in the abstract, and brings them down to a real world level. That's a rare talent to find in writing these days.","author":"Jeff \"hemos\" Bates, Dire |
NewerOlder