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
// this is a hacky and brutal polyfill to somewhat implement zoom in firefox | |
// https://caniuse.com/#feat=css-zoom | |
// it allows to use jQuery's $('.element').css({zoom: 1.5}); | |
// there is no effort to actually implement a normal css polyfill | |
// this polyfill also doesn't work when the zoomed element has margins since they are used to fake the new size. | |
$.cssNumber.zoom = true; | |
if (!("zoom" in document.body.style)) { | |
$.cssHooks.zoom = { | |
get: function(elem, computed, extra) { |
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
function SortableSelect<ValueType extends Array<unknown>, OptionType>( | |
props: SelectProps<ValueType, OptionType> | |
) { | |
return ( | |
<DndProvider backend={HTML5Backend}> | |
<Select<ValueType, OptionType> | |
{...props} | |
tagRender={({ label, ...tagProps }) => ( | |
<DraggableTag | |
{...tagProps} |
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
#!/bin/bash | |
# this results in a wasm file that is | |
# 5.2 mb (1.8 mb gzip) | |
set -euo pipefail | |
source $(dirname $0)/var.sh | |
FLAGS=( | |
"${FFMPEG_CONFIG_FLAGS_BASE[@]}" |
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
<template name="bool:default" value="/** * @var bool * @ORM\Column(type="boolean", options={"default": $default$}) */ private bool $$$name$ = $default$; $END$ public function is$method$(): bool { return $this->$name$; } public function set$method$(bool $$$name$): void { $this->$name$ = $$$name$; }" description="boolean column" toReformat="false" toShortenFQNames="true"> | |
<variable name="name" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="default" expression="enum("false", "true")" defaultValue="" alwaysStopAt="true" /> | |
<variable name="method" expression="capitalize(name)" defaultValue="" alwaysStopAt="false" /> | |
<context> | |
<option name="PHP Class Member" value="true" /> | |
</context> | |
</template> | |
<template name="bool:nullable" value="/** * @var bool|null * @ORM\Column(type="boolean", nullable=true) */ private ?bool $$$name$ = nul |
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 | |
namespace App\Security; | |
use Doctrine\ORM\QueryBuilder; | |
use Symfony\Component\Security\Core\Exception\AccessDeniedException; | |
use Symfony\Component\Security\Core\Security; | |
/** | |
* Allows access control to be defined within an entity. |
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 | |
namespace App\Serializer; | |
use Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer; | |
/** | |
* This normalizer will normalize all properties of an object, regardless of visibility. | |
* It will not use methods, just reflection access to properties. | |
* |
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
api_platform: | |
# [...] leave the default configuration | |
defaults: | |
# only use pagination if explicitly requested | |
# otherwise, you'll just ignore it and have a broken application once you have more than 10 items | |
pagination_enabled: true |
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 | |
namespace App\Command; | |
use App\Entity\Order; | |
use App\Service\TickService; | |
use Doctrine\DBAL\LockMode; | |
use Doctrine\ORM\EntityManagerInterface; | |
use Symfony\Component\Console; | |
use Symfony\Component\Workflow\WorkflowInterface; |
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 | |
namespace App\Search; | |
use ApiPlatform\Core\DataProvider; | |
use FOS\ElasticaBundle\Index\IndexManager; | |
use Symfony\Component\Serializer\Serializer; | |
/** | |
* This class is based on API Platforms elasticsearch implemenation. |
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
#!/usr/bin/env sh | |
# run phpunit to trigger download in symfony | |
bin/phpunit --version | |
if [ $1 ] | |
then | |
find tests/ -name '*Test.php' \ | |
| grep -i "$1" \ | |
| vendor/bin/fastest -vv --no-errors-summary 'bin/phpunit {}' |
NewerOlder