Skip to content

Instantly share code, notes, and snippets.

View simonebaracchi's full-sized avatar

Simone Baracchi simonebaracchi

View GitHub Profile
@simonebaracchi
simonebaracchi / power_saving.ino
Created August 18, 2015 17:20
Routines for power saving on the Arduino. Posted at http://simonebaracchi.eu/posts/arduino-power-cutter/
#include <avr/sleep.h>
#include <avr/power.h>
#include <avr/wdt.h>
// watchdog interrupt
ISR (WDT_vect)
{
wdt_disable(); // disable watchdog
}
@simonebaracchi
simonebaracchi / temperature_example.ino
Created October 5, 2015 21:03
Temperature beacon example with Arduino and BTLE library
/*
* Emulates a nRF8001 temperature beacon;
* reads temperature from a DHT11 and sends it via BTLE.
* Compatible with Nordic Semiconductor apps such as
* nRF Master Control Panel or nRF Temp 2.0.
*/
#include <BTLE.h>
#include <SPI.h>
#!/bin/bash
# logwalk.sh is a log file browser
# Usage: logwalk.sh <logfile>
# input strings you want to filter out
# and then "open" when you want to see the full (filtered) results
# add multiple filters at once by separating them with pipes, e.g. filter1|filter2|etc
GREP=
FILTER=
@simonebaracchi
simonebaracchi / recently_played_to_playlist.sh
Created March 3, 2024 17:28
Export Spotify "Recently played" to a new playlist
#!/bin/bash
# Usage:
# - open https://developer.spotify.com/documentation/web-api/reference/get-recently-played
# - open inspector and get bearer token 1
# - open https://developer.spotify.com/documentation/web-api/reference/add-tracks-to-playlist
# - open inspector and get bearer token 2
# - create a new spotify playlist and get the ID
# currently spotify APIs are limited to the last 50 played songs