Skip to content

Instantly share code, notes, and snippets.

View mdmitry1's full-sized avatar
:atom:
🦁

Dmitry Messerman mdmitry1

:atom:
🦁
View GitHub Profile
@mdmitry1
mdmitry1 / README.md
Last active December 2, 2021 18:54 — forked from mbleigh/README.md
Firebase Hosting Fetch All Files

Fetch All Files from Firebase Hosting

This script fetches all of the files from the currently deployed version of a Firebase Hosting site. You must be signed in via the Firebase CLI and have "Site Viewer" permission on the site in question to be able to properly run the script.

Running using node

 env FIREBASE_TOKEN=`cat <file_where_firebasetoken is saved>` fetchFiles.js <my-site>
@mdmitry1
mdmitry1 / LICENSE
Last active January 19, 2026 12:43
Pytest: Calling a program with command line parameters
https://opensource.org/licenses/MIT
Copyright 2021 Dmitry Messerman
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
Attribution-ShareAlike 4.0 International
=======================================================================
Creative Commons Corporation ("Creative Commons") is not a law firm and
does not provide legal services or legal advice. Distribution of
Creative Commons public licenses does not create a lawyer-client or
other relationship. Creative Commons makes its licenses and related
information available on an "as-is" basis. Creative Commons gives no
warranties regarding its licenses, any material licensed under their
@mdmitry1
mdmitry1 / Makefile
Last active June 7, 2025 09:12
Decimal, hexadecimal and binary bidirectional convertors
MODULES=bin2dec dec2bin bin2hex hex2bin dec2hex hex2dec
%: %.cpp
g++ -O2 -o $@ $<
strip $@
all: $(MODULES)
clean:
-rm -rf $(MODULES)
@mdmitry1
mdmitry1 / get_window_geometry
Last active December 6, 2025 11:45
Python Tkinter window running Tcl script
#!/usr/bin/tcsh -f
set w=`xdotool getwindowfocus`
set g=`xdotool getwindowgeometry $w | grep : \
| sort | awk '{print $2}' | tr '\012' ' ' | sed -e 's/ /+/' -e 's/,/+/' -e 's/$//'`
echo $g
@mdmitry1
mdmitry1 / decorator_callback_ex.py
Last active December 6, 2025 11:29
Decorator with parameters and color output
#!/usr/bin/python3.12
from os import environ
from sys import argv
def sortDecorator(x):
def decorator(func):
def wrapper(*args, **kwargs): return func(*args, **kwargs)
return wrapper
return decorator
@mdmitry1
mdmitry1 / match_ex.py
Last active December 6, 2025 11:36
Structural Pattern Matching example
#!/usr/bin/tcsh -f
"/usr/bin/true" '''\'
if(1 == `uname | grep ^MINGW | wc -l`) then
exec python3.10 $0
else
exec python3.14 $0
endif
'''
# https://realpython.com/python310-new-features/
from datetime import datetime
@mdmitry1
mdmitry1 / EilatBay.jpg
Last active December 6, 2025 16:46
Platform Independent Qt GUI example
EilatBay.jpg
#!/usr/bin/python3.14
import sys
from os.path import realpath, basename
from rich import print as rprint
from pandas import read_csv
from argparse import ArgumentParser, Namespace
from contextlib import redirect_stdout
def add_sort_arguments() -> ArgumentParser:
p = ArgumentParser()
#!/usr/bin/python3.14
'''
https://www.lihaoyi.com/post/BuildyourownCommandLinewithANSIescapecodes.html
https://www.codequoi.com/en/coloring-terminal-text-tput-and-ansi-escape-sequences
https://web.archive.org/web/20210226122732/http://ascii-table.com/ansi-escape-sequences.php
'''
from sys import argv
from argparse import ArgumentParser
def print_color(fg_bg_code, color):