Skip to content

Instantly share code, notes, and snippets.

@Bibo-Joshi
Bibo-Joshi / asyncio_loop_in_thread.py
Created March 8, 2022 19:12 — forked from dmfigol/asyncio_loop_in_thread.py
Python asyncio event loop in a separate thread
"""
This gist shows how to run asyncio loop in a separate thread.
It could be useful if you want to mix sync and async code together.
Python 3.7+
"""
import asyncio
from datetime import datetime
from threading import Thread
from typing import Tuple, List, Iterable
@Bibo-Joshi
Bibo-Joshi / cloudsend.sh
Created December 27, 2020 17:26 — forked from tavinus/cloudsend.sh
Send files to Nextcloud/Owncloud shared folder using curl
#!/usr/bin/env bash
############################################################
# MIGRATED TO REPOSITORY
# https://github.com/tavinus/cloudsend.sh
#
# This gist will NOT be updated anymore
############################################################
############################################################
@Bibo-Joshi
Bibo-Joshi / create_ptb_test_bot.py
Last active November 6, 2022 20:55 — forked from jsmnbom/create_ptb_test_bot.py
Put in python-telegram-bot/tests with API_ID and API_HASH (from my.telegram.org) as envvars. Customize the bot to be created in main(). Doesn't create video sticker set yet. Tested with `python-telegram-bot==20.0a4` and `telethon==1.25.4`. ⚠️ The script needs to be updated to make the bot also an admin in the forum test group (chat id -100161915…
import asyncio
import itertools
import json
import os
import re
import urllib.parse
import itertools
from telethon import TelegramClient
from telethon.utils import get_input_peer
@Bibo-Joshi
Bibo-Joshi / lirc-pi3.txt
Created January 30, 2018 10:49 — forked from prasanthj/lirc-pi3.txt
Getting lirc to work with Raspberry Pi 3 (Raspbian Stretch)
Notes to make IR shield (made by LinkSprite) work in Raspberry Pi 3 (bought from Amazon [1]).
The vendor has some documentation [2] but that is not complete and sufficient for Raspbian Stretch.
Following are the changes that I made to make it work.
$ sudo apt-get update
$ sudo apt-get install lirc
# Add the following lines to /etc/modules file
lirc_dev
lirc_rpi gpio_in_pin=18 gpio_out_pin=17