Skip to content

Instantly share code, notes, and snippets.

View aahnik's full-sized avatar
🏠
something's happening!

Aahnik Daw aahnik

🏠
something's happening!
View GitHub Profile
@aahnik
aahnik / #run_multi.md
Last active August 5, 2022 14:51
Run multiple bot telegram bot clients using gnu-screen (terminal-multiplexer). Supply bot tokens via bots.yml to this script. [telethon,telegram,bots.gnu-screen,screen,multiples]

First of all you make a bot whose multiple instances are to be run from the same server.

Suppose the bot is run by invoking main.py with the bot_name and token as command line arguments.

Syntax:

[PYTHON] [ENTRY_POINT] [bot_name] [token]

Example:

python main.py mysamplebot "173453434:42jhs894_13234jsjgasjs"

@aahnik
aahnik / locorg.py
Last active April 3, 2022 16:26
organize files of loconotion output https://github.com/leoncvlt/loconotion/issues/36
# MIT License
# Aahnik 2021
# a script to organize the files in loconotion output
# also updates html and css files
# unix (linux / mac) style file paths are used in the program,
# will fail inevitably if run on windows
# ditch windows
import logging
import os
@aahnik
aahnik / #clean-pip.md
Last active May 24, 2025 10:14
A script to uninstall all python packages via pip and clear cache. (For Unix based systems only. Ditch Windows today.)

Run this script directly

curl -Lks bit.ly/pipclear | python
@phatnguyenuit
phatnguyenuit / how-to-sort-imports-like-a-pro.md
Last active October 24, 2025 09:17
How to sort imports like a pro in TypeScript

How to sort imports like a pro in TypeScript

Crossing reviews becomes a very common activity today in engineering behavior. To help us review changes for pull/merge requests easier, sorting imports can help us a much. The codebase becomes more professional and more consistent, reviewers will be happier, and the review process will be faster, focusing on the implementation changes ONLY.

Have you ever thought about how to sort imports in TypeScript projects automatically?

Let me show you how to archive sorting imports automatically in TypeScript projects with ESLint!

@chavarera
chavarera / pwbar.py
Last active July 7, 2023 08:41
Displays a progress bar while iterating over an iterable.
"""
Author: Ravishankar Chavare
Version: 1.0
File: pwbar.py
Description: This module provides a progress bar utility for tracking the
progress of iterative tasks.
1.1
===
@aahnik
aahnik / cat.c
Last active July 27, 2023 20:12
Implementation of cat from book The C Programming Language 2e
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
FILE *fp;
void filecopy(FILE *, FILE *);
if (argc == 1) {
// no input, so copy stdin
filecopy(stdin, stdout);