This file contains hidden or 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
{ | |
"AdditionalFilter": { | |
"NotificationsTemplates": [ | |
{ | |
"NotificationType": { | |
"Code": "Post" | |
}, | |
"NotificationSearchType": { | |
"Id": null | |
}, |
This file contains hidden or 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
// http://digitrode.ru/computing-devices/mcu_cpu/1806-arduino-i-datchik-rashoda-vody.html | |
const int watermeterPin = 2; | |
volatile int pulse_frequency; | |
unsigned int literperhour; | |
unsigned long currentTime, loopTime; | |
byte sensorInterrupt = 0; | |
void setup() |
This file contains hidden or 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
#include <SoftwareSerial.h> | |
SoftwareSerial SIM800(8, 9); // 8 - RX Arduino (TX SIM800L), 9 - TX Arduino (RX SIM800L) | |
void setup() { | |
Serial.begin(9600); // Скорость обмена данными с компьютером | |
Serial.println("Start!"); | |
SIM800.begin(9600); // Скорость обмена данными с модемом | |
SIM800.println("AT"); | |
} | |
void loop() { |
This file contains hidden or 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
// библиотека для работы с дисплеем | |
#include <TroykaTextLCD.h> | |
// библиотека для работы с датчиками MQ (Troyka-модуль) | |
#include <TroykaMQ.h> | |
// имя для пина, к которому подключен датчик | |
#define PIN_MQ135 A0 | |
// имя для пина, к которому подключен нагреватель датчика | |
#define PIN_MQ135_HEATER 11 |
This file contains hidden or 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
declare module '@types/yandex-maps' { | |
import {IEvent} from '@types/yandex-maps'; | |
declare namespace ymaps { | |
interface IEventManager { | |
once(types: string[][] | string[] | string, callback: (event: object | IEvent) => void, context?: object, priority?: number): this; | |
} | |
} | |
export = ymaps; | |
export as namespace ymaps; | |
} |
This file contains hidden or 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, {FunctionComponent, ReactElement, Fragment, cloneElement} from 'react'; | |
/** | |
* Решение проблемы типа 'Providers Hell'. | |
* @link https://gist.github.com/khusamov/58da3cebde3913aacf3e0b4fdfd48b70 | |
*/ | |
const ApplicationProviders: FunctionComponent<{providers: ReactElement[]}> = ( | |
({children, providers}) => { | |
return ( | |
[...providers, <Fragment>{children}</Fragment>] |
This file contains hidden or 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 preval from 'preval.macro'; | |
const buildDate = new Date(Number(preval`module.exports = new Date().getTime();`)); | |
/** | |
* Дата сборки. | |
* @link https://stackoverflow.com/questions/53028778/how-to-show-build-datetime-on-my-react-web-app-using-create-react-app | |
* @link https://gist.github.com/khusamov/2a9ce98bd1e5eff247502bdadaa4443a | |
*/ | |
export default function getBuildDate(): Date { |
This file contains hidden or 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, {FunctionComponent} from 'react'; | |
import makeStyles from '@material-ui/core/styles/makeStyles'; | |
import cn from 'classnames'; | |
const useNoPrintStyles = ( | |
makeStyles({ | |
root: { | |
'@media print': { | |
display: 'none' | |
} |
This file contains hidden or 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 {useEffect, useRef} from "react"; | |
/** | |
* Хук возвращающий предыдущее состояние | |
* @param value | |
*/ | |
export const usePrevious = (value: any) => { | |
const ref = useRef(null); | |
useEffect(() => { |
This file contains hidden or 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 Mailbox(props) { | |
const unreadMessages = props.unreadMessages; | |
return ( | |
<div> | |
<h1>Здравствуйте!</h1> | |
{renderIf(unreadMessages.length > 0, ( | |
<h2> | |
У вас {unreadMessages.length} непрочитанных сообщений. | |
</h2> | |
)} |
NewerOlder