Skip to content

Instantly share code, notes, and snippets.

@gtataranni
gtataranni / findAndPlay.sh
Last active January 29, 2016 10:21
find the first closer match in your music folder and play it. The first word should be in the song filename, the others can be either in the filename or in the path, as for artist name
#!/bin/bash
MUSIC_DIR="/media/Volume/Musica personale/"
find "$MUSIC_DIR" -iname "*$1*.mp3" -o -iname "*$1*.wma" -type f | while read line; do
good=1;
for arg in $@ ; do
if [ $good -eq 1 ]; then
echo $line | grep -i -q "$arg"
if [ $? -eq 1 ] ; then
@gtataranni
gtataranni / transition.py
Last active May 24, 2020 14:38
Seven segments number transition
import time
from Adafruit_LED_Backpack import SevenSegment
# bit offset and corresponding led
# 0
# 5 1
# 6
# 4 2
# 3