Skip to content

Instantly share code, notes, and snippets.

View slavafomin's full-sized avatar
✌️
Let's make this World a better place!

Slava Fomin II slavafomin

✌️
Let's make this World a better place!
View GitHub Profile
@slavafomin
slavafomin / 0-get-address-transactions.ts
Last active April 7, 2022 20:36
TON (TonWeb) — get address transactions in JavaScript (TypeScript)
import TonWeb from 'tonweb';
import {
BatchLoadedHandler,
getAddressTransactions,
HttpErrorHandler,
TransactionDiscoveredHandler,
} from './address-transactions';
import { Transformer } from 'grammy/out/core/client';
import { Cache } from './cache';
export function createCachingTransformer(options?: {
cacheTtl?: number;
}): Transformer {
@slavafomin
slavafomin / grammy-runner-graceful-shutdown.ts
Last active November 21, 2021 09:11
Grammy Runner Graceful Shutdown
const runner = run(bot);
['SIGTERM', 'SIGINT'].forEach(signal =>
process.once(signal, () => runner.isRunning() && runner.stop())
);
@slavafomin
slavafomin / autofocus.directive.ts
Created November 5, 2021 21:53
Angular 11+ autofocus directive
/**
* This smart directive accepts boolean value as an input and focuses the
* element based on the evaluated boolean expression.
*
* Also, the directive could be applied to the input/button/select/a elements
* directly or to any parent element as well. It will search the DOM for the first
* suitable element to focus automatically.
*/
@slavafomin
slavafomin / .gitignore
Created September 22, 2020 12:20
.gitignore template for JavaScript or Node.js projects
# IDEA-based IDEs
/.idea/
# Build files
**/dist/
# Dependencies
**/node_modules/
# Temp files
{
"name": "test",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"accepts": {
"version": "1.3.7",
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz",
"integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==",
{
"compilerOptions": {
"moduleResolution": "Node",
"esModuleInterop": true,
"module": "ES2015",
"target": "ESNext",
"lib": [
"ESNext",
"DOM"
],

Contributor License Agreement

This Agreement is made in the Russian and English languages. The English text of Agreement is for informational purposes only and is not binding for the Parties.

In the event of a conflict between the provisions of the Russian and English versions of this Agreement, the Russian version shall prevail.

This document represents the offer of “Sberbank real estate center”

{
"@type": "config.global",
"dht": {
"@type": "dht.config.global",
"k": 6,
"a": 3,
"static_nodes": {
"@type": "dht.nodes",
"nodes": [
{
function main() {
console.log('Hello World!');
}