Skip to content

Instantly share code, notes, and snippets.

View medvedev's full-sized avatar
🇺🇦

Slava medvedev

🇺🇦
View GitHub Profile
@medvedev
medvedev / otp-menu
Last active October 12, 2023 15:48
Linux quick OTP generator
#!/bin/bash
# Displays a list of environments in a middle of a screen, allowing to select one.
# After an item is selected, a corresponding OTP code is copied to the clipboard.
# Requires zenity and copiq installed (Flatpak does not count)
choice=$(zenity --list --column="Env" "Env1" "Env2" --title="Pick OTP")
# Perform actions based on user choice
case $choice in
@medvedev
medvedev / emax-mount.nc
Created July 6, 2023 12:12
GCode to cut mounting holes for the EMAX MT1806 motor
; Tested with NEJE 3 and 4mm plywood from the Skywalker Mini set
G21 ; Set units to millimeters
G90 ; Set positioning to absolute coordinates
G00 X1 Y6.2
G02 X1 Y7.8 I0. J0.8
G02 X1 Y6.2 I0. J-0.8
G00 X9 Y12.2
@medvedev
medvedev / telegram-chat-links.py
Created July 3, 2023 19:32
Get all the URLs from a top (pinned) chat (channel) in Telegram
@medvedev
medvedev / script.gs
Created January 18, 2023 22:09
Googla App Script: Automatically invite to Calendar event based on Google Form data
// Code below looks a bit complicated for suc a simple action
// It's purpose is to add a guest to an event AND send email notification to a new guest.
// If email notification is optional, you can use simple apporach with CalendarApp
// Trigger type for the script should be "On Form submit"
// If it's your primary google calendar, use your email as ID
const calendarId = 'john.smith@gmail.com'
// How to get event ID:
// 1. Open event editor in Calendar Web UI
@medvedev
medvedev / heic-to-jpg.sh
Created October 13, 2022 09:51
Shell script for batch convertation of HEIC images to JPEGs
#!/bin/bash
# Batch convert provided heic photos to jpeg
hash heif-convert 2>/dev/null || { printf >&2 "heif-convert is required.\nTry installing it with: \nsudo apt install libheif-examples\n"; exit 1; }
if [ $# -eq 0 ] ; then
echo >&2 "usage: heic-tojpg.sh <filename1.heic> <filename2.heic> ..."
exit 1;
fi
@medvedev
medvedev / build.gradle
Last active October 23, 2023 16:56
Gradle task that prints total dependencies size and (dependency+(size in kb)) list sorted by size desc
...
/* Tested with Gradle 6.3 */
tasks.register("depsize") {
description = 'Prints dependencies for "default" configuration'
doLast() {
listConfigurationDependencies(configurations.default)
}
}