Skip to content

Instantly share code, notes, and snippets.

View sabapathygithub's full-sized avatar
🏠
Working from home

Sabapathy Kathiresan sabapathygithub

🏠
Working from home
View GitHub Profile
@sabapathygithub
sabapathygithub / background_worker_sample.py
Created July 14, 2021 08:15
Code to achieve multithreading with pyqt5 framework.
import sys
from time import sleep
import traceback
from PyQt5.QtCore import *
from PyQt5.QtWidgets import (
QApplication,
QLabel,
QMainWindow,
QPushButton,
@sabapathygithub
sabapathygithub / Autoscroll.js
Last active September 12, 2024 16:53
Auto scroll to bottom of the page in JavaScript with smooth scrolling based on time delay.
function scrollToBottom(timedelay=0) {
var scrollId;
var height = 0;
var minScrollHeight = 100;
scrollId = setInterval(function () {
if (height <= document.body.scrollHeight) {
window.scrollBy(0, minScrollHeight);
}
else {
clearInterval(scrollId);