Skip to content

Instantly share code, notes, and snippets.

View dlizcano's full-sized avatar
💻
Working hybrid. Some days home, some days office

Diego J. Lizcano dlizcano

💻
Working hybrid. Some days home, some days office
View GitHub Profile
@dlizcano
dlizcano / automation.yaml
Created October 20, 2025 14:41
Add this automation in Home Assistant. For that go to: Settings → Automations → Create Automation → Edit in YAML, then paste the automation code
alias: BirdNET Audio Data to CSV
description: Capture audio frequency data from BirdNET-Go MQTT and save to CSV
trigger:
- platform: mqtt
topic: birdnet-go/soundlevel
mode: queued
max: 10
action:
- service: shell_command.save_audio_data_csv
data:
# extract data from JSON make it CSV
# made with claude.ai for Diego Lizcano
import json
import csv
import sys
from pathlib import Path
from datetime import datetime
def save_audio_data_to_csv(json_data):
# Parse the JSON
@dlizcano
dlizcano / compliments.json
Last active March 5, 2025 21:46 — forked from E3V3A/compliments.json
MagicMirror compliments file
{
"anytime" : [
"Hey there sexy!",
"I hope your day is as nice as your face!",
"Have you been working out?",
"I'm lucky to be your mirror!",
"The Force is strong with you",
"If I could high five you... I would!",
"On a scale from 1 to 10, you're an 15!",
"Being awesome is hard, but you'll manage",
@dlizcano
dlizcano / Ejemplo_1temp.R
Created September 2, 2016 18:03
Occupancy_SingleSeason
##########################
## Ejemplo de una temporada (single season)
##########################
### Installar el paquete de "unmarked"
# install.packages("unmarked")
library(unmarked)
### Vamos a simular unos datos de observaciones de presencia/ausencia
ejemplo<- data.frame(animal= c("perro", "gato", "pato", "anemona"),
peso= c(45, 10, 5, 0.5),
textura= c("pelo", "pelo", "pluma", "nematocisto"))
str(ejemplo) # ver esructura
ejemplo[1,2] # ver fila 1 columna2
ejemplo$nueva <- ejemplo$peso / 2 # crear una columna nueva
dim(ejemplo) # dimensiones de mi data frame
colnames(ejemplo) # ver los nombres de las columnas
@dlizcano
dlizcano / get_exif.R
Created May 23, 2016 19:07
Código para obtener los datos exif, a partir del nombre de una foto en flickr
#' flickrlist - Get metadata for items available on Flickr for the picture
#' @import XML
#' @import RCurl
#' @param apikey - API key provided by Flickr.com website. (Refer http://www.flickr.com/services/api/misc.api_keys.html for more details.)
#' @param picture_id - Test to search: ="17966004672"
#' @examples \dontrun{
#' get_exif("05bdd790fdcd89f9344003e0f47d7c86","17966004672")
#' }
#' @export
get_exif <- function (apikey="05bdd790fdcd89f9344003e0f47d7c86", picture_id=NA){
@dlizcano
dlizcano / flicker_get_all_pic_in_a_set.R
Last active May 23, 2016 19:10
Código para bajar un álbum completo (set) y obtener los datos de cada foto en una tabla usando R.
#-------------------------------------------------------------------
# Downloading all Flickr pictures for a set (album)
# Diego J. Lizcano, 2016
# Modified from: Benedikt Koehler, 2013
# @furukama
#-------------------------------------------------------------------
library(RCurl)
library(rjson)
library(dplyr)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dlizcano
dlizcano / gist:fad4a9317f374e8b443e
Created May 1, 2014 21:07
Mountain tapir points
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<iframe width=620 height=300 frameborder="0"
src="http://dl.dropbox.com/u/7586336/RSS2012/line.html">
Your browser does not support iframe
</iframe>