Skip to content

Instantly share code, notes, and snippets.

View Wegazz's full-sized avatar
🌴
On vacation

Wegas Noah Wegazz

🌴
On vacation
View GitHub Profile
@Wegazz
Wegazz / Dropdown Markdown.md
Last active January 20, 2024 12:21
Выпадающий список MarkDown
A dropdown list for markdown
  1. First item must be preceeded with an empty line.
  2. Markdown renders perfectly.
  3. Extra item.
@Wegazz
Wegazz / get_keyboard_language.py
Created July 7, 2019 13:59
Gets the keyboard language in use by the current active window process.
import ctypes # Required to obtain the keyboard layout
def get_keyboard_language():
"""
Gets the keyboard language in use by the current
active window process.
"""
# My keyboard is set to the English - United States keyboard
# For debugging Windows error codes in the current thread
user32 = ctypes.WinDLL('user32', use_last_error=True)
@Wegazz
Wegazz / test_yaml.py
Created November 9, 2019 08:16
Работа с YAML файлами настрек
# -*- coding: utf-8 -*-
import yaml
import io
configFile = 'test_yaml.yaml'
# Define data
data = {
'a list': [
@Wegazz
Wegazz / ProgressBar.py
Created November 27, 2019 15:45
Progress Bar in the Console python
# copy from https://stackoverflow.com/questions/3173320/text-progress-bar-in-the-console
# Print iterations progress
def printProgressBar (iteration, total, prefix = '', suffix = '', decimals = 1, length = 100, fill = '█', printEnd = "\r"):
"""
Call in a loop to create terminal progress bar
@params:
iteration - Required : current iteration (Int)
total - Required : total iterations (Int)
prefix - Optional : prefix string (Str)
suffix - Optional : suffix string (Str)
@Wegazz
Wegazz / color_print.py
Created March 13, 2020 13:31
Print colored text in terminal in Python - Цветной вывод текста в консоль
# Цветной вывод текста в консоль Python.
# print colored text in terminal in Python
# get from https://stackoverflow.com/questions/287871/how-to-print-colored-text-in-terminal-in-python
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
@Wegazz
Wegazz / AdbCommands
Created April 13, 2020 22:58 — forked from Pulimet/AdbCommands
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@Wegazz
Wegazz / .htaccess
Last active July 19, 2020 09:33
Стандартный .htaccess подходящий наверное для большинства случаев.
############################################################################
#### Cтандартный .htaccess ####
############################################################################
RewriteEngine On
# Директива включает редиректы.
RewriteBase /
# Без директивы (.*) = /$1 будет /var/wwww/site/web/$1 с директивой = /$1
Options +FollowSymLinks
# Разрешает переход по символическим ссылкам.
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
@Wegazz
Wegazz / htaccess-yo-jekyll
Created March 4, 2021 23:25 — forked from Lego2012/htaccess-yo-jekyll
htaccess - You Jekyll Generator #htaccess #jekyll
# Apache Configuration File
# (!) Using `.htaccess` files slows down Apache, therefore, if you have access
# to the main server config file (usually called `httpd.conf`), you should add
# this logic there: http://httpd.apache.org/docs/current/howto/htaccess.html.
# ##############################################################################
# # CROSS-ORIGIN RESOURCE SHARING (CORS) #
# ##############################################################################
@Wegazz
Wegazz / ping.py
Created April 12, 2021 13:32
Ping server from python and ping. Parse ttl from ping
import subprocess
import platform
import re
class ping():
server = 'ya.ru'
verbose = False
def __init__(self, server: str = 'ya.ru', verbose: bool = False):