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 / Makefile
Last active December 19, 2022 21:07
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 / match_ex.py
Last active January 28, 2023 14:10
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.11 $0
endif
'''
# https://realpython.com/python310-new-features/
from datetime import datetime
#!/usr/bin/python3.11
'''
https://www.pythonguis.com/tutorials/qtableview-modelviews-numpy-pandas/
'''
from sys import argv, exit
from rich import print as rprint
from pandas import read_csv
from os import name as osname, popen
from os.path import realpath, basename, splitext, split
from re import sub
@mdmitry1
mdmitry1 / decorator_callback_ex.py
Last active February 21, 2024 20:37
Decorator with parameters and color output
#!/usr/bin/python3.11
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
#!/usr/bin/python3.11
'''
https://octave.sourceforge.io/octave/function/sombrero.html
'''
from numpy import sin, sqrt, linspace,finfo, transpose
from re import search
from sys import version as python_version
#Workaround for matplotlib bug
if search('GCC UCRT', python_version): from PyQt5 import QtCore
from matplotlib import cm, pyplot as plt
@mdmitry1
mdmitry1 / get_window_geometry
Last active February 21, 2024 20:42
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 / sortdf.py
Last active February 21, 2024 20:52
#!/usr/bin/python3.11
import sys
from os.path import realpath, basename
from rich import print as rprint
import pandas as pd
import argparse
script_name = basename(realpath(sys.argv[0]))
parser = argparse.ArgumentParser()
parser.add_argument('--file', '-f', default="/dev/stdin")
parser.add_argument('--out', '-o', default=None)
@mdmitry1
mdmitry1 / EilatBay.jpg
Last active February 23, 2024 15:56
Platform Independent Qt GUI example
EilatBay.jpg