Skip to content

Instantly share code, notes, and snippets.

View medvedev's full-sized avatar

Slava medvedev

View GitHub Profile
medvedev / Notebook code cell
Created May 29, 2024 10:14
Clone private GitHub repository from within a Kaggle notebook
import os
from pathlib import Path
from kaggle_secrets import UserSecretsClient
# Note: Key should be already configured at Github side and
# added as a secret, excluding lines "BEGIN .. KEY" and "END .. KEY" to your notebook
private_key_content = UserSecretsClient().get_secret("GITHUB_SSH_KEY")
medvedev / otp-menu
Last active October 12, 2023 15:48
Linux quick OTP generator
# 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 /
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 /
Created July 3, 2023 19:32
Get all the URLs from a top (pinned) chat (channel) in Telegram
medvedev /
Last active June 25, 2024 10:25
Googla App Script: Automatically invite to Calendar event based on Google Form data
// Code below looks a bit complicated for such 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 = ''
// How to get event ID:
// 1. Open event editor in Calendar Web UI
medvedev /
Created October 13, 2022 09:51
Shell script for batch convertation of HEIC images to JPEGs
# 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: <filename1.heic> <filename2.heic> ..."
exit 1;
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() {