- Per tenir un cercador personalitzat a firefox, pots instal·lar l'extensió: https://addons.mozilla.org/ca/firefox/addon/add-custom-search-engine/
- Per afegir google.cat en català com a cercador limitat a resultats en català, indica aquesta URL a la "Search URL": "https://www.google.cat/search?q=%s&&tbs=lr:lang_1ca&lr=lang_ca&hl=ca"
This file contains 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
library(tidyverse) | |
library(rvest) | |
sess <- read_html_live("https://analytics.zoho.com/open-view/your-zoho-table") | |
sess$view() | |
try({ | |
sess$type("#passwordValue", "yourpassword") | |
sess$click("#submitButton") | |
}) |
This file contains 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
# NOTE: It's not working on Posistron because of rJava, it works on RStudio. | |
if(!"rlang" %in% installed.packages()){ | |
if(!interactive()) { stop("The package \"rlang\" is required.") } | |
cat("The package \"rlang\" is required.\n✖ Would you like to install it?\n\n1: Yes\n2: No\n\nSelection:") | |
if (readLines(n = 1) == "1"){ | |
install.packages("rlang") | |
} | |
} | |
rlang::check_installed( |
This file contains 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
if(!"rlang" %in% installed.packages()){ | |
if(!interactive()) { stop("The package \"rlang\" is required.") } | |
cat("The package \"rlang\" is required.\n✖ Would you like to install it?\n\n1: Yes\n2: No\n\nSelection:") | |
if (readLines(n = 1) == "1"){ | |
install.packages("rlang") | |
} | |
} | |
rlang::check_installed( | |
"jrrosell (>= 0.0.0.9006)", | |
action = \(pkg,...) { |
This file contains 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
debug <- FALSE | |
#' @noRd | |
preparations <- \() { | |
cat(glue::glue("preparations")); cat("\n") | |
if(!"rlang" %in% installed.packages()){ | |
if(!interactive()) { stop("The package \"rlang\" is required.") } | |
cat("The package \"rlang\" is required.\n✖ Would you like to install it?\n\n1: Yes\n2: No\n\nSelection:") | |
if (readLines(n = 1) == "1"){ | |
install.packages("rlang") |
This file contains 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
# Ubuntu/debian: sudo apt-get install musescore | |
# pak::pak("flujoo/gm") | |
Sys.setenv(MUSESCORE_PATH = "/usr/bin/musescore") | |
library(gm) | |
(Music() + | |
Meter(4, 4) + | |
Line( | |
pitches = c( | |
c("G4", "A4", "G4", "F#4"), |
This file contains 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
--- | |
title: "robo violencia" | |
output: html_document | |
date: "2024-06-19" | |
editor_options: | |
chunk_output_type: console | |
--- | |
## CCAA |
This file contains 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_mode <- \(x) { | |
r <- table(x) | |
names(r[r == max(r)]) | |
} | |
# For example: | |
# > get_mode(c(1,2,2,3,3,4)) | |
# 2 3 |
This file contains 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 Rscript | |
cat("==========================================================================\n") | |
cat("Example of strategy patern in R: Multiple ways to show routes. \n") | |
# Problem: | |
# You build a navigation app for casual travelers and help users quickly orient themselves in any city. | |
# | |
# - The first only build the routes over roads. | |
# - Next update, you added an option to build walking routes. |
This file contains 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
library(shiny) | |
library(shinyjs) | |
ui <- fluidPage( | |
useShinyjs(), | |
hidden( | |
textInput("my_input", label = "my_input", value = "Initial value") | |
), | |
textOutput("my_output"), | |
actionButton("my_js_button","Update from JavaScript"), |
NewerOlder