This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
res <- fs::dir_ls("R", regexp = "\\.R$") |> | |
purrr::map(tools::showNonASCIIfile) |> | |
purrr::compact() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Monitor continuo di vcgencmd pmic_read_adc con aggiornamento, calcolo dei valori live, min/max, totali, potenza e alert. | |
Questo script esegue periodicamente il comando "vcgencmd pmic_read_adc" per estrarre le letture di voltaggio e corrente | |
per ciascun rail (sensore) e, per ogni sensore, calcola: | |
- I valori live di voltaggio, corrente e potenza (calcolata come voltaggio_live * corrente_live). | |
- Il valore minimo di voltaggio (Voltage min) e il valore massimo di corrente (Max Current) registrati negli ultimi PEAK_PERIOD secondi, | |
utilizzati per calcolare il "Power max" come il massimo istantaneo (volt * current) registrato nel periodo. | |
- Un alert basato sul confronto tra il voltaggio live e il valore nominale. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
update_windows <- function() { | |
pb <- progress::progress_bar$new( | |
total = 100, | |
format = "(:spin) :what [:bar] :perc", | |
clear = FALSE, | |
width = 80 | |
) | |
i <- 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# functions ------------------------------------------------------- | |
separated_event_fup <- function(db) { | |
db |> | |
dplyr::mutate( | |
fup_id = .data[["ev_id"]] |> | |
stringr::str_extract("(?<=fup_)\\d") |> | |
as.integer(), | |
ev_id = .data[["ev_id"]] |> | |
stringr::str_extract("(?<=ev_)\\d") |> | |
as.integer() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_R_CHECK_LENGTH_1_CONDITION_ = TRUE | |
_R_CHECK_LENGTH_1_LOGIC2_ = TRUE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# This is a Shiny web application. You can run the application by | |
# clicking the 'Run App' button above. | |
# | |
# Find out more about building applications with Shiny here: | |
# | |
# http://shiny.rstudio.com/ | |
# | |
library(shiny) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
devices: ( | |
{ | |
name: "Wireless Mouse MX Master"; | |
smartshift: | |
{ | |
on: true; | |
threshold: 20; | |
}; | |
hiresscroll: | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'All installed by. | |
USAGE: | |
all_installed_by.R [-d] [-s] [-f=<FILE>] <PKG>... | |
all_installed_by.R [-d] [-s] [-f=<FILE>] -i | |
all_installed_by.R [-d] [-s] [-f=<FILE>] -c | |
all_installed_by.R (-h | --help) | |
OPTIONS: | |
-h --help Show this screen. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' Get domain | |
#' | |
#' @param url (chr) url from which extract the domain | |
#' @param include_suffix (lgl, default TRUE) would you like to get the | |
#' suffix too (dot included)? | |
#' | |
#' @seealso https://stackoverflow.com/questions/19020749/function-to-extract-domain-name-from-url-in-r | |
#' @export | |
#' @examples | |
#' get_domain("www.example.com") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## You should have {Hmisc} to check what it produce :-) | |
requireNamespace("Hmisc", quietly = TRUE) | |
## If you would run the tests (you do not have to), you need {testthat}. | |
## TL;DR: passing tests won't produce any output! | |
can_test <- requireNamespace("testthat", quietly = TRUE) | |
## Note: for easy of notation I will call an object of class "describe" | |
## in the Harrell's world as "Hdesc" object (w/ capital H, in his | |
## honour). |
NewerOlder