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 AppBundle\DependencyInjection; | |
use Symfony\Component\Config\Definition\Builder\TreeBuilder; | |
use Symfony\Component\Config\Definition\ConfigurationInterface; | |
class Configuration implements ConfigurationInterface | |
{ | |
public function getConfigTreeBuilder() |
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
<!--file: src/AppBundle/Resources/rdf-mappings/AppBundle.Document.StaticContent.xml--> | |
<type | |
xmlns:schema="http://schema.org/" | |
typeof="schema:WebPage" | |
> | |
<children> | |
<property property="schema:headline" identifier="title" tag-name="h1"/> | |
<property property="schema:text" identifier="body" /> | |
<property property="schema:text" identifier="group" /> | |
</children> |
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 AppBundle\EventSubscriber; | |
use Sylius\Component\Channel\Context\ChannelContextInterface; | |
use Sylius\Component\Core\Locale\LocaleStorageInterface; | |
use Sylius\Component\Locale\Context\LocaleContextInterface; | |
use Sylius\Component\Locale\Provider\LocaleProvider; | |
use Sylius\Component\Locale\Provider\LocaleProviderInterface; | |
use Symfony\Component\EventDispatcher\EventSubscriberInterface; |
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
// src/AppBundle/Resources/config/doctrine/ProductCategory.orm.xml | |
<?xml version="1.0" encoding="UTF-8"?> | |
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping | |
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> | |
<mapped-superclass name="AppBundle\Entity\ProductCategory" table="app_product_category" repository-class="AppBundle\Entity\Repository\ProductCategoryRepository"> | |
<id name="id" column="id" type="integer"> |
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
// components/Any.ts | |
import * as React from 'react'; | |
import { FormattedMessage, InjectedIntlProps } from 'react-intl'; | |
export interface AnyMapStateToProps { | |
// your state actions here | |
} | |
export interface AnyMapDispatchToProps { | |
// your dispatch actions here |
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
// ./.storybook/addons.js | |
import '@storybook/addon-actions/register'; | |
import '@storybook/addon-links/register'; | |
import '@storybook/addon-knobs/register'; | |
import 'storybook-addon-intl/register'; |
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
// Avoid anonymous functions | |
// Don't do this! | |
function Component(props) { | |
return <AnotherComponent onChange={() => props.callback(props.id)} /> | |
} | |
// Do this instead :) | |
function Component(props) { | |
const handleChange = useCallback(() => props.callback(props.id), [props.id]); |
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 React from 'react'; | |
import { Button } from '../../../components/UI/new/Button'; | |
import { Modal, ModalBody, ModalFooter, ModalHeader } from 'reactstrap'; | |
import { ButtonsContainer } from '../../../components/UI/new/ButtonsContainer'; | |
import { FormattedMessage } from 'react-intl'; | |
export interface ConfirmationOptions { | |
title: string | React.ReactNode; | |
confirmLabel: string | React.ReactNode; | |
description: string | React.ReactNode; |
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 { createSelector, createSelectorCreator, defaultMemoize } from 'reselect'; | |
// only care about height, lat & lng | |
export const FlightPlanSelector = createSelectorCreator( | |
defaultMemoize as any, | |
(a: FlightPlanPoint, b: FlightPlanPoint) => a.height === b.height && a.lat === b.lat && a.lng === b.lng | |
); | |
// use the new defined selector FlightPlanSelector | |
export const selectNotamTrajectoryPoints = FlightPlanSelector( | |
selectMapValueFP('flightPlan'), | |
(flightPlan) => flightPlan.map(fp => ({ |
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
Show hidden characters
{ | |
"extends": ["react-app", "eslint:recommended", "plugin:react/recommended", "plugin:@typescript-eslint/recommended"], | |
"parser": "@typescript-eslint/parser", | |
"plugins": ["react", "@typescript-eslint", "react-hooks", "import"], | |
"env": { | |
"browser": true, | |
"jasmine": true, | |
"jest": true | |
}, | |
"rules": { |