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
<?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 {}' |
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
#pragma once | |
#include <driver/adc.h> | |
template<adc1_channel_t... PINS> | |
class SmoothAdc { | |
private: | |
const adc1_channel_t pins[sizeof...(PINS)] = {PINS...}; | |
volatile uint32_t results[sizeof...(PINS)] = {}; | |
uint16_t reads[sizeof...(PINS)][256] = {}; | |
uint8_t position = 0; |
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 |
NewerOlder