Egor Gorbachev
@alteregor
8 posts

How to integrate Telegram Stars Payment to your bot

Telegram Stars is a new in-app currency introduced by Telegram for purchasing digital goods and services. Users can buy Stars directly within Telegram using Apple Pay or Google Pay. This article is a step-by-step guide on how to connect Stars payments to your bot. While the example will be in Node.js, I'll show you the general ideas for accepting Stars payments so you can apply them to any language and framework.

How I built a project for myself and won a prize from Telegram

It's the translation of my own article initially published on habr.com that gained over 20000 views.

Configure multiple entry points for Create React App without the eject

Create React App is an opinionated and officially supported tool to set up a React application with no configuration. It comes with some tradeoffs - the build configuration is hidden and you have to use npm run eject script to edit this configuration. In this case, you'll stay one-on-one with fighting build configuration and dependencies mismatch during an upgrade.

A simple Mobx under 50 LOC to understand observer pattern

Mobx uses observer pattern. The classic observer pattern requires users to manually subscribe for changes. Mobx uses a smart approach to create subscriptions implicitly. Some developers claimed it as "magic" of Mobx. The goal of the article is to describe you how implicit subscriptions work under the hood. Knowing this you can always find the reason why a component isn't updating/re-rendering when store changes. In this article I won't use proxy, decorators, classes to keep things simple. I expect you to be familiar with Mobx basics like observable, observer and autorun.

Display calendar using SQL

Do you like solving SQL puzzles? There is a fun exercise you can try if you love racking your brain with tough SQL tasks - write a query to display current month in calendar format. The solution should work with months that have different week count. For example 2010-02-01 includes only 4 weeks, but 2017-10-01 includes 6 weeks. Here is the example SQL output:

Configure HTTPS for wildcard domains with Nginx and Certbot

Certbot allows to automatically install Letsencrypt certificates on a server. For a regular website with only 1 domain, the process of installing can be described as ordinary "Next next install". Things are getting complicated if you need to create a wildcard certificate. Suppose you are creating a white-label website and each company should have its own unique subdomain.

Разница между типом и интерфейсом в TypeScript

Тип и интерфейс в TypeScript часто вызывают путаницу по причине поверхностной схожести. Ситуацию усугубляют устаревшие статьи, необъективные сравнения и style-guid'ы некоторых фреймворков. Например, в Angular по умолчанию включено tslint правило interface-over-type-literal, которое требует использовать интерфейсы вместо типов везде, где возможно. В этой статье разберём разницу между типом и интерфейсом в TypeScript и определимся что же использовать.

Reasons to avoid default exports in JavaScript

Why named exports should be used instead of default exports in JavaScript