Skip to content

Instantly share code, notes, and snippets.

View nghiaht's full-sized avatar

Huỳnh Trọng Nghĩa nghiaht

View GitHub Profile
@nghiaht
nghiaht / force_exit_telegraf_bot.js
Last active November 12, 2023 06:43
Auto restart Telegram bot using telegraf
const Telegraf = require("telegraf");
const bot = new Telegraf("TOKEN");
bot.catch((err) => {
console.error('Ooops', err);
process.exit(1); // I choose exit, you should use PM (Process Manager) and let them automatically restart the bot
// Or sth else
})
@nghiaht
nghiaht / gist:6fc19596453e325bce7586e2e5f0c432
Created November 23, 2020 06:56
Source directory containing current symlinked script
SCRIPT_REAL_DIR=$(dirname $(realpath "$0"))
echo ${SECRIPT_REAL_DIR}
@nghiaht
nghiaht / responsive-table-ant-design.js
Created August 31, 2021 09:54
Responsive table with Ant Design
import { Table } from "antd";
...
<Table
...
scroll={{ x: "max-content" }}
/>
...