Skip to content

Instantly share code, notes, and snippets.

View thoughthollow's full-sized avatar

Andrew ("Andy") Tait thoughthollow

View GitHub Profile
@thoughthollow
thoughthollow / Text_Macros.bas
Created February 20, 2023 13:04
Macros which convert text of selected cells to all upper or lower case. Can be added to ribbon for quick use.
Sub Uppercase()
Dim cel As Range
Dim selectedRange As Range
Set selectedRange = Application.Selection
' Loop to cycle through each cell in the specified range.
For Each cel In selectedRange.Cells
' Change the text in the range to uppercase letters.
@thoughthollow
thoughthollow / OpenAthens_htmltable2df_ResourceByAttribute.R
Created January 13, 2023 21:28
Wrangle a OpenAthens statistics HTML table with sub-headers
#####
# TITLE: Wrangle a OpenAthens statistics HTML table with sub-headers
#
# Purpose:
# --------
# OpenAthens allows you to view statistics of resource usage,
# however sometimes it's not possible to download the results as a .csv file, such as
# for daily use over a year of resources by email address
# (probably because of the data frame size).
# But! It is possible to view and download them as a HtmL table.
@thoughthollow
thoughthollow / configValues.R
Last active November 23, 2022 16:37
Get the configuration values from a .csv file
# Get the configuration info
{
config <- read_csv("config.csv",
locale = locale(encoding = "UTF-8"),
trim_ws=TRUE)
for (i in 1:ncol(config)) {
assign(names(config)[i], as.character(config[,i]))
}
rm(i)