f <- function(x, y) {
r <- sqrt(x^2 + y^2)
ifelse(r == 0, 10, 10*sin(r) / r)
}
stl_md_surface <- functionToSTL(
f,
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
| # clipboard-qr-v5.ps1 | |
| # | |
| # Self-contained clipboard-to-QR utility for PowerShell 7 on Windows. | |
| # No modules, package repositories, proxy access, or network connection needed. | |
| # | |
| # The QR encoder is implemented directly in this script and writes an SVG file. | |
| # It uses QR Code Model 2, byte mode with UTF-8 ECI, error-correction level L, | |
| # and mask pattern 0. | |
| # Made by GPT-5.6 Extra High |
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
| build_windows_binary <- function(src_tar_gz, | |
| out_dir = dirname(normalizePath(src_tar_gz, winslash = "/", mustWork = TRUE)), | |
| lib = file.path(tempdir(), "r-win-bin-lib"), | |
| install_deps = FALSE, | |
| dep_fields = c("Depends", "Imports", "LinkingTo"), | |
| repos = { | |
| r <- getOption("repos") | |
| if (is.null(r) || identical(unname(r["CRAN"]), "@CRAN@")) { | |
| c(CRAN = "https://cloud.r-project.org") | |
| } else { |
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
| # For usage instructions scroll down | |
| function Show-SelectizeDialog { | |
| [CmdletBinding()] | |
| param( | |
| [Parameter(Mandatory)] | |
| [AllowEmptyCollection()] | |
| [object[]] $Items, | |
| [string] $DisplayProperty, |
See also https://github.com/alekrutkowski/ExcelLambdaTools
Convert 1-column range monthly dates in the format yyyy-mm, e.g. 2023-11, to 2-column range:
- 1st column: year number if it's January, otherwise empty
- 2nd column: the 3-character month code, e.g. "Nov"
=LAMBDA(rng,
LET(
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
| ############### | |
| ##################################### | |
| ################################################## | |
| ######################################################## | |
| ############################ ############### | |
| ##################### ########## | |
| ################### ####### | |
| ################# ################################### ###### | |
| ################# ###################################### ##### | |
| ############### ####################################### ##### |
- Chrome: https://webkul.com/blog/how-to-install-the-unpacked-extension-in-chrome/
- Edge: https://learn.microsoft.com/en-us/microsoft-edge/extensions/getting-started/extension-sideloading
Click the extension button to translate text inside paragraphs, headings (h1–h6), and list items into the language defined in MY_LANG while preserving inline markup and links.
Made with ChatGPT 5 (after a few iterations).
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
| #### Prerequisites -- in Linux terminal: | |
| # Once: | |
| # pipx install libretranslate | |
| # Run in the background: | |
| # libretranslate | |
| #### Test: | |
| # Open the following page in a web browser | |
| # (but first modify your.shiny-server.domain and your_translate_app_name): | |
| # https://your.shiny-server.domain/your_translate_app_name/?url=https://example.com/&from=en&to=fr |
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
| # Save it as /srv/shiny-server/your_app_name/app.R | |
| library(shiny) | |
| ui <- function(request) { | |
| query <- parseQueryString(request$QUERY_STRING) | |
| txt <- query$txt | |
| a <- as.numeric(query$a) | |
| b <- as.numeric(query$b) |
NewerOlder