Skip to content

Instantly share code, notes, and snippets.

View binarybrat's full-sized avatar

Cloei binarybrat

View GitHub Profile
@binarybrat
binarybrat / Pagination_walkthrough.md
Created July 25, 2024 23:48 — forked from InterStella0/Pagination_walkthrough.md
A walkthrough on action based pagination in discord.py

Pagination Walkthrough in discord.py

In this tutorial I will go through the entire length of pagination in discord.py

I kindly ask you to go through the entire thing, as it is not recommended to skip the subtopics because they are interconnected in some way.

Table Content

@binarybrat
binarybrat / log.py
Created January 6, 2024 07:12 — forked from nguyenkims/log.py
Basic example on how setup a Python logger
import logging
import sys
from logging.handlers import TimedRotatingFileHandler
FORMATTER = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
LOG_FILE = "my_app.log"
def get_console_handler():
console_handler = logging.StreamHandler(sys.stdout)
console_handler.setFormatter(FORMATTER)
@binarybrat
binarybrat / exampleuse.py
Created December 22, 2023 03:23
Current logging setup file
import cfg
import error
import dbsrc
# Each of these below hell everything in dbsrc also should be logged.
from dbsrc import cmmentmodel, colorinfomodel, modlgmodel, mentionmodel, postmodel, snapshotmodel
import filetils
iport fmtutils
import logutils
from logutils import rainbowlogger
import reddtutils
@binarybrat
binarybrat / config.ini
Created December 22, 2023 03:17
Msstly working submodule logging config example
[loggers]
keys = root, main_app, first_library, second_library
[handlers]
keys = console
[formatters]
keys = generic, full, brief
[logger_root]
@binarybrat
binarybrat / streamingprocesses.py
Last active August 10, 2020 13:35
Current streaming processes setup - adding logger
import sys
import time
import traceback
import peewee as pw
import multiprocessing
from datetime import datetime
from ago import human
import logging.handlers
from loggingTesting import Log
@binarybrat
binarybrat / redditscript.py
Created February 14, 2020 01:32
current main script
import os, sys, traceback
import ri0t
import dbthelper
from reddit.utils.counters import *
from reddit.utils._company_rgx import *
from utils.log import init_logger
from models import BaseModel, init_db
from models.blah import TaggingPatterns, WayBackTutorials, SpookyLinks, SewUser
from models.messagemodel import *
from models.companymodel import *
@binarybrat
binarybrat / commentmodel.py
Created February 14, 2020 01:24
my comment model
import tldextract
from datetime import datetime, timedelta
from models import BaseModel
from peewee import *
from models.blah import YoutubeLogging, Tutorials
import time
from reddit.utils.globalvars import *
from reddit.utils.randomhelpershit import *
from reddit.utils._company_rgx import *
from models.detailsmodel import *
@binarybrat
binarybrat / includepostrelationshipTesting.py
Created January 11, 2020 09:20
issues with trying to insert
from sqlalchemy import Column, ForeignKey, String, create_engine, Text, Integer, DateTime, Table
from sqlalchemy.orm import relationship, sessionmaker
from sqlalchemy.ext.declarative import declarative_base
import datetime
engine = create_engine('mysql+pymysql://riotdorque:*******@****:3306/patternHelperTests', echo=True)
Base = declarative_base()
metadata = Base.metadata
@binarybrat
binarybrat / listingthings.txt
Created January 6, 2020 18:25
fabric type list (and maybe other lists?)
acrylic
aertex
alençon lace
alpaca
angora
antique satin
argentan lace
argentella lace
argyle
armenian needlelace
@binarybrat
binarybrat / lnmtraffic.py
Created December 28, 2018 00:43
sillyness
lnmtraffic = lnmsub.traffic()
lnmtraffic
{'day': [[1545955200, 0, 0, 0], [1545868800, 0, 0, 0], [1545782400, 45591, 209289, 897], [1545696000, 22710, 140015, 568], [1545609600, 31501, 203868, 1068], [1545523200, 30325, 201102, 1372], [1545436800, 50562, 196430, 586], [1545350400, 28371, 152100, 493], [1545264000, 27915, 169510, 564], [1545177600, 29165, 206699, 673], [1545091200, 37247, 246506, 3470], [1545004800, 30517, 179841, 626], [1544918400, 47701, 255416, 1614], [1544832000, 23294, 132005, 574], [1544745600, 35341, 157553, 379], [1544659200, 32891, 158506, 423], [1544572800, 24795, 144517, 417], [1544486400, 29780, 166853, 400], [1544400000, 33405, 185996, 467], [1544313600, 25364, 144906, 428], [1544227200, 24719, 149883, 406], [1544140800, 21780, 138060, 337], [1544054400, 23973, 140207, 634], [1543968000, 36938, 185288, 427], [1543881600, 126346, 368129, 1232], [1543795200, 38275, 219496, 608], [1543708800, 227435, 602011, 2013], [1543622400, 20266, 119778, 347], [1543536000, 26642, 148950, 359], [1