Frontend Engineer | AI & IoT
Контакты:
- Телефон: +7 (925) 834-55-30
- Email: [email protected]
- Telegram: mrbzzz
- GitHub: ivan-hilckov
- Instagram: helios_m42
import { BotContext } from '../../types/bot.types'; | |
/** | |
* Deletes all previous messages stored in session and the triggering message | |
*/ | |
export async function deletePreviousMessages(ctx: BotContext): Promise<void> { | |
try { | |
// Delete the triggering message (works for both commands and callback queries) | |
if (ctx.callbackQuery?.message) { | |
// For callback queries, use hydrate method |
Frontend Engineer | AI & IoT
Контакты:
After setting up docker to generate React app without installing node js in https://gist.github.com/przbadu/4a62a5fc5f117cda1ed5dc5409bd4ac1 It was confusing to some of the devs, how to run react app, so I am creating this as second step to the configuration.
cd my-react-app
touch Dockerfile Dockerfile.dev docker-compose.yml .dockerignore
import React, { useState } from 'react' | |
import ReactMapGL, { Marker, WebMercatorViewport } from 'react-map-gl' | |
const applyToArray = (func, array) => func.apply(Math, array) | |
const getBoundsForPoints = (points) => { | |
// Calculate corner values of bounds | |
const pointsLong = points.map(point => point.coordinates._long) | |
const pointsLat = points.map(point => point.coordinates._lat) | |
const cornersLongLat = [ |
//Что выведет код ниже?
let promise = new Promise(function(resolve, reject) {
resolve(1);
var emojis = [ | |
'😄','😃','😀','😊','☺','😉','😍','😘','😚','😗','😙','😜','😝','😛','😳','😁','😔','😌','😒','😞','😣','😢','😂','😭','😪','😥','😰','😅','😓','😩','😫','😨','😱','😠','😡','😤','😖','😆','😋','😷','😎','😴','😵','😲','😟','😦','😧','😈','👿','😮','😬','😐','😕','😯','😶','😇','😏','😑','👲','👳','👮','👷','💂','👶','👦','👧','👨','👩','👴','👵','👱','👼','👸','😺','😸','😻','😽','😼','🙀','😿','😹','😾','👹','👺','🙈','🙉','🙊','💀','👽','💩','🔥','✨','🌟','💫','💥','💢','💦','💧','💤','💨','👂','👀','👃','👅','👄','👍','👎','👌','👊','✊','✌','👋','✋','👐','👆','👇','👉','👈','🙌','🙏','☝','👏','💪','🚶','🏃','💃','👫','👪','👬','👭','💏','💑','👯','🙆','🙅','💁','🙋','💆','💇','💅','👰','🙎','🙍','🙇','🎩','👑','👒','👟','👞','👡','👠','👢','👕','👔','👚','👗','🎽','👖','👘','👙','💼','👜','👝','👛','👓','🎀','🌂','💄','💛','💙','💜','💚','❤','💔','💗','💓','💕','💖','💞','💘','💌','💋','💍','💎','👤','👥','💬','👣','💭','🐶','🐺','🐱','🐭','🐹','🐰','🐸','🐯','🐨','🐻','🐷','🐽','🐮','🐗','🐵','🐒','🐴','🐑','🐘','🐼','🐧','🐦','🐤','🐥','🐣','🐔','🐍','🐢','🐛','🐝','🐜','🐞','🐌','🐙','🐚','🐠','🐟','🐬','🐳','🐋','🐄','🐏','🐀','🐃','🐅','🐇','🐉','🐎','🐐','🐓','🐕','🐖','🐁','🐂','🐲','🐡','🐊','🐫','🐪','🐆','🐈','🐩','🐾', |
import axios, { AxiosError } from 'axios' | |
import { CANCEL, END } from 'redux-saga' | |
class DataError extends Error { | |
constructor(status: number, statusText: string, data?: any) { | |
super(`${status} ${statusText}`) | |
Object.setPrototypeOf(this, Object.assign({}, DataError.prototype, { status, statusText, data })) | |
} | |
} |
const user = { id: 100, name: 'Howard Moon' } | |
const password = 'Password!' | |
const userWithPassword = { | |
...user, | |
id: 100, | |
...(password && { password }) | |
} | |
userWithPassword //=> { id: 100, name: 'Howard Moon', password: 'Password!' } |
#!/usr/bin/env bash | |
# http://papers.ch/speeding-up-your-mac-osx-terminal-input/ | |
#echo "Disable press-and-hold for keys in favor of key repeat" | |
#defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false | |
echo "Set a blazingly fast keyboard repeat rate" | |
defaults write NSGlobalDomain KeyRepeat -int 0.02 |
import React, { useMemo } from "react"; | |
import useSubscription from "./useSubscription"; | |
// In this example, "source" is an event dispatcher (e.g. an HTMLInputElement) | |
// but it could be anything that emits an event and has a readable current value. | |
function Example({ source }) { | |
// In order to avoid removing and re-adding subscriptions each time this hook is called, | |
// the parameters passed to this hook should be memoized. | |
const subscription = useMemo( | |
() => ({ |