Skip to content

Instantly share code, notes, and snippets.

View Hrissimir's full-sized avatar

Hrissimir Hrissimir

  • HEDSolutions
  • Bulgaria
View GitHub Profile
@Hrissimir
Hrissimir / .editorconfig
Created August 17, 2023 09:04
Personal .editorconfig settings
# ======================================================================================================================
# EditorConfig is awesome: https://EditorConfig.org
# ----------------------------------------------------------------------------------------------------------------------
#
# Must be specified in the preamble. Set to "true" to stop the .editorconfig file search on the current file. The value is case insensitive.
# root = true
#
# Set to "latin1", "utf-8", "utf-8-bom", "utf-16be" or "utf-16le" to control the character set. Use of "utf-8-bom" is discouraged.
# charset = utf-8
#
@Hrissimir
Hrissimir / yt-dlp.conf
Created August 17, 2023 06:34
Instructions: How to install and configure 'yt-dlp' on Windows 10 machine
# =========================================================================
# Instructions: How to install and configure 'yt-dlp' on Windows 10 machine
#
# NOTE: Lines starting with # are treated as comments
# -------------------------------------------------------------------------
#
#
# =========================================================================
# Part I. "Install Prerequisites"
# -------------------------------------------------------------------------
"""Encoders for 'any' type of data that is not supported by default (+tests)."""
import datetime
import decimal
import enum
import inspect
import ipaddress
import json
import pathlib
import sqlite3
import textwrap
@Hrissimir
Hrissimir / Installing_Python3_on_Windows10.md
Last active March 12, 2023 17:40
Guide for installing Python3 on Winows10 (dev) machine.

Installing Python3 on Windows10

...the proper way


Prerequisites

Stuff in the following sections should be done prior installing Python on the machine.

- Insert a USB flash drive into a running computer.
- Open a Command Prompt window as an administrator.
- Type `diskpart`.
- In the new command line window that opens, to determine the USB flash drive number or drive letter, at the command prompt, type `list disk`, and then click ENTER.
The list disk command displays all the disks on the computer. Note the drive number or drive letter of the USB flash drive.
- At the command prompt, type `select disk <X>`, where X is the drive number or drive letter of the USB flash drive, and then click ENTER.
@Hrissimir
Hrissimir / start_chrome_clean.bat
Created March 19, 2021 18:13
Starts clean Google Chrome instance by redirecting all possible work-folders paths to timestamped directory in %TMP%
@echo off
SETLOCAL
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set STAMP_DATE=%%c-%%a-%%b)
For /f "tokens=1-4 delims=./" %%a in ("%TIME%") do (set STAMP_TIME=%%a%%b)
set STAMP=%STAMP_DATE%_%STAMP_TIME%
set STAMP=%STAMP::=_%
set CHROME_TMP=%TMP%\chrome_tmp_%STAMP%
@Hrissimir
Hrissimir / cli_program.py
Created December 13, 2020 13:16
Simple CLI program base
import atexit
import logging
import sys
from abc import ABC
from abc import abstractmethod
from argparse import ArgumentParser
from argparse import FileType
from argparse import Namespace
from typing import Optional

Linux post-install instructions (USE AT YOUR OWN RISK)

Tested on Ubuntu Linux: Mint 20 Ulyana 20.04 focal

End-User Commons

// build.gradle -> dependencies:
// implementation 'org.slf4j:slf4j-api:1.7.30'
// implementation 'org.slf4j:slf4j-log4j12:1.7.30'
// implementation 'org.apache.commons:commons-lang3:3.10'
// implementation 'commons-io:commons-io:2.7'
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.slf4j.Logger;
@Hrissimir
Hrissimir / log4j.properties
Created April 27, 2020 06:16
Sample log4j properties
# Root logger option
log4j.rootLogger=DEBUG, file, stdout
# Direct log messages to a log file
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File= execution.log
log4j.appender.file.MaxFileSize=10MB
log4j.appender.file.MaxBackupIndex=10
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %t [%c{1}:%L] %m%n
# Direct log messages to stdout