Skip to content

Instantly share code, notes, and snippets.

View mytja's full-sized avatar

Mitja Ševerkar mytja

View GitHub Profile
@mytja
mytja / getusb.sh
Created July 9, 2022 20:45
List all USB devices with names and /dev/* paths
#!/bin/bash
for sysdevpath in $(find /sys/bus/usb/devices/usb*/ -name dev); do
(
syspath="${sysdevpath%/dev}"
devname="$(udevadm info -q name -p $syspath)"
[[ "$devname" == "bus/"* ]] && exit
eval "$(udevadm info -q property --export -p $syspath)"
[[ -z "$ID_SERIAL" ]] && exit
echo "/dev/$devname - $ID_SERIAL"
@mytja
mytja / solution.py
Created January 5, 2021 12:04
Solution for The Cake Is Not A Lie (Google Foobar)
def substring_check(length, sub_str):
for i in range(0, length-1):
if(sub_str[i] == sub_str[i+1]):
if(i == length-2):
return length
else:
continue
else:
return 1
def solution(s):
@mytja
mytja / NixieClockCountdown.ino
Created December 31, 2020 20:20
Nixie Clock Countdown code based on GreatScott!'s code for nixie clock
#include <Wire.h>
#define A1 3
#define B1 4
#define C1 5
#define D1 6
#define A2 7
#define B2 8
#define C2 9
#define D2 10
#define A3 11