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 cn from 'clsx'; | |
import * as React from 'react'; | |
import { useEffect, useRef } from 'react'; | |
import { InjectedFormikProps, Form, Field, withFormik, FormikActions } from 'formik'; | |
import { Button, Loader, Icon, colors } from 'vue-components'; | |
import { AnimatedInput } from 'components'; | |
import { ISignInFormValues } from 'models/internal'; | |
import { useSubmitOnEnter } from 'hooks/useSubmitOnEnter'; | |
export interface ISignInFormProps { |
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 { configure, addDecorator } from '@storybook/react'; | |
import { addParameters } from '@storybook/react'; | |
import { create } from '@storybook/theming'; | |
import { withInfo } from '@storybook/addon-info'; | |
import { withKnobs } from '@storybook/addon-knobs'; | |
import '../src/style.sass'; | |
addParameters({ | |
options: { | |
theme: create({ |
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
const path = require('path'); | |
const TSDocgenPlugin = require('react-docgen-typescript-webpack-plugin'); | |
const HardSourceWebpackPlugin = require('hard-source-webpack-plugin'); | |
// --- Full control mode --- | |
module.exports = async ({ config }) => { | |
config.module.rules.push({ | |
test: /\.stories\.tsx?$/, | |
loaders: [ | |
{ |
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
var matrixExample = [ | |
[ 1, 2, 3, 4 ], | |
[ 4, 5, 6, 5 ], | |
[ 7, 8, 9, 7 ], | |
[ 7, 8, 9, 7 ] | |
]; | |
function sumUpDiagonals(matrix) { | |
var diagonals = []; | |
for (var i=0; i < matrix.length; 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 requests | |
from bs4 import BeautifulSoup as BS | |
PY_PAGE = 'https://www.python.org' | |
def get_page(url): | |
page_html = requests.get(url).text | |
return page_html |
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 unittest | |
def is_even(number): | |
""" Returns True if **number** is even or False if it is odd. """ | |
return number % 2 | |
class TestNumberIsEven(unittest.TestCase): | |
""" |
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
from django.db import models | |
from django.db.models import Q | |
from django.http import JsonResponse | |
class Product(models.Model): | |
categories = models.ManyToManyField(Category, | |
related_name='products', | |
blank=True, verbose_name=u"категории") | |
related_products = models.ManyToManyField('Product', |