Skip to content

Instantly share code, notes, and snippets.

View alekrutkowski's full-sized avatar

Alek Rutkowski alekrutkowski

View GitHub Profile
@alekrutkowski
alekrutkowski / Show-SelectizeDialog.ps1
Last active June 11, 2026 18:17
Show-SelectizeDialog PowerShell Function – inspired by selectize.js
# For usage instructions scroll down
function Show-SelectizeDialog {
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[AllowEmptyCollection()]
[object[]] $Items,
[string] $DisplayProperty,
@alekrutkowski
alekrutkowski / CallPlumberAPI.vba
Last active April 24, 2026 09:47
Calling arbitrary R code from Excel with easy data input and output (Excel↔R)
Sub CallPlumberAPI()
Dim SERVER_URL As String
Dim xmlhttp As Object
Dim ws As Worksheet
Dim inputRange As Range, dataRange As Range, outputRange As Range
Dim cellAddress As String, rCode As String, outputAddress As String
Dim i As Long, j As Long
Dim tsvData As String, processedData As String
Dim outputData() As String, outputRow() As String
@alekrutkowski
alekrutkowski / insheet_eurostat.ado
Last active April 17, 2026 15:20
Stata command to download and import a Eurostat dataset
// Usage example:
// • Either the parameter is Eurostat's "online data code":
// insheet_eurostat ilc_di11i
// • or the parameter is the custom URL generated with Eurostat GUI top right corner:
// go to e.g. https://ec.europa.eu/eurostat/databrowser/view/ilc_di11i/default/table?lang=en and
// do your selections by clicking the [⤓] Download button > selecting File format = "Tab separated values (.tsv)" and
// Data scope = "Only displayed dimensions" and unticking "Compress file (.gzip)" > clicking the [Copy API link ⧉] button
// insheet_eurostat "https://ec.europa.eu/eurostat/api/dissemination/sdmx/3.0/data/dataflow/ESTAT/ilc_di11i/1.0/*.*.*?c[freq]=A&c[unit]=RAT&c[geo]=EU27_2020,EA20,BE,BG,CZ,DK,DE,EE,IE,EL,ES,FR&c[TIME_PERIOD]=2019,2020,2021,2022,2023,2024,2025&compress=false&format=tsv"
// To use it like other commands, put it in your "personal" folder/directory
// (see: https://www.stata.com/support/faqs/programming/personal-ado-directory/ and https://www.stata.com/help.cgi?personal).
@alekrutkowski
alekrutkowski / lambdas.md
Last active April 14, 2026 08:21
Useful Excel lambda functions

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(
@alekrutkowski
alekrutkowski / R_logo.txt
Last active January 16, 2026 10:14
R language logo (https://www.r-project.org/logo/) as ASCII art
###############
#####################################
##################################################
########################################################
############################ ###############
##################### ##########
################### #######
################# ################################### ######
################# ###################################### #####
############### ####################################### #####
@alekrutkowski
alekrutkowski / _README.md
Last active November 7, 2025 10:50
Chrome/Edge addon/extension to translate the current web page to a pre-set language when the addon's icon is clicked
@alekrutkowski
alekrutkowski / app.R
Created November 6, 2025 15:05
R/Shiny app similar to Google Translate whole page translation (when you paste a URL)
#### 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
@alekrutkowski
alekrutkowski / app.R
Created November 3, 2025 09:38
R/Shiny app as a simple GET request handler
# 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)
@alekrutkowski
alekrutkowski / app.R
Last active October 31, 2025 13:39
R/Shiny app which (re)publishes an RSS feed
# Shiny app that serves a transformed RSS feed immediately at "/".
# It fetches the source RSS on every request, appends a single space to the end
# of each line, and returns it with the correct RSS content type so feed readers
# can subscribe directly.
# This particular app fixes the annoying problem in Inoreader, which concatenates
# the words in the descriptions of new R packages.
library(shiny)