Skip to content

Instantly share code, notes, and snippets.

@jimbrig
jimbrig / r67.R
Created April 2, 2026 17:00 — forked from JosiahParry/r67.R
Experimentation with R6 and S7 hybrid. Allows for the creation of mutable objects with type-safe properties as well as self-referential methods.
# What do i want from an object oriented R class system?
# opt-in public immutability - neither. Accomplished with private property with active binding in R6
# interior mutability - R6
# type safety - S7
# self-referential methods - R6
# private methods don't have any type safety they can be whatever you want.
# immutables can only be set at creation and class doesn't matter
# Each .public & .private element must be named
@jimbrig
jimbrig / request.json
Created October 15, 2025 20:41
Jacksonville Search
{
"size": 50,
"polygon": [
{
"lon": -80.81854409832198,
"lat": 30.33370156189275
},
{
"lon": -80.81976090733492,
"lat": 30.29569956621614
@jimbrig
jimbrig / Remove videos from Youtube Watch Later playlist.md
Created September 10, 2025 04:06 — forked from astamicu/Remove videos from Youtube Watch Later playlist.md
Script to remove all videos from Youtube Watch Later playlist

UPDATED 22.11.2022

It's been two years since the last update, so here's the updated working script as per the comments below.

Thanks to BryanHaley for this.

setInterval(function () {
    video = document.getElementsByTagName('ytd-playlist-video-renderer')[0];

 video.querySelector('#primary button[aria-label="Action menu"]').click();
@jimbrig
jimbrig / user-prefs.json
Created July 29, 2025 01:47
{rsprefs} RStudio Preferences Sync
{
"default": {
"always_save_history": false,
"copilot_enabled": true,
"copilot_indexing_enabled": true,
"editor_theme": "rscodeio",
"load_workspace": false,
"pdf_previewer": "none",
"restore_last_project": false,
"restore_source_documents": false,
@jimbrig
jimbrig / DevAssociations.xml
Last active June 22, 2025 17:25
Development Related Windows 11 Default File Associations
<?xml version="1.0" encoding="UTF-8"?>
<DefaultAssociations>
<!-- Web Protocols -->
<Association Identifier="http" ProgId="ChromeSSHTM.KRNFTZRS7HSWQNPYUD3H3UQ74E" ApplicationName="Google Chrome Canary" />
<Association Identifier="https" ProgId="ChromeSSHTM.KRNFTZRS7HSWQNPYUD3H3UQ74E" ApplicationName="Google Chrome Canary" />
<!-- Web Files -->
<Association Identifier=".htm" ProgId="ChromeSSHTM.KRNFTZRS7HSWQNPYUD3H3UQ74E" ApplicationName="Google Chrome Canary" />
<Association Identifier=".html" ProgId="ChromeSSHTM.KRNFTZRS7HSWQNPYUD3H3UQ74E" ApplicationName="Google Chrome Canary" />
<Association Identifier=".svg" ProgId="VSCodeInsiders.svg" ApplicationName="Visual Studio Code - Insiders" />
@jimbrig
jimbrig / ascii_banner.R
Created June 11, 2025 01:18
R Banner Generator
ascii_banner <- function(text, font = "slant") {
if (Sys.which("figlet") == "") stop("figlet is not installed.")
system(sprintf("figlet -f %s \"%s\"", font, text), intern = TRUE) |> cat(sep = "\n")
}
@jimbrig
jimbrig / export-chatgpt-md.js
Created June 5, 2025 19:24
Export ChatGPT to Markdown JS
function h(html) {
return html.replace(/<p>/g, '\n\n')
.replace(/<\/p>/g, '')
.replace(/<b>/g, '**')
.replace(/<\/b>/g, '**')
.replace(/<i>/g, '_')
.replace(/<\/i>/g, '_')
.replace(/<code[^>]*>/g, (match) => {
const lm = match.match(/class="[^"]*language-([^"]*)"/);
return lm ? '\n```' + lm[1] + '\n' : '```';
{"name":"Default","settings":"{\"settings\":\"{\\n // ------------------------------------------------\\n // Updates\\n // ------------------------------------------------\\n \\\"update.mode\\\": \\\"start\\\",\\n \\\"update.showReleaseNotes\\\": true,\\n // ------------------------------------------------\\n // Security\\n // ------------------------------------------------\\n \\\"security.workspace.trust.enabled\\\": false,\\n \\\"security.workspace.trust.banner\\\": \\\"never\\\",\\n \\\"security.workspace.trust.emptyWindow\\\": true,\\n \\\"security.workspace.trust.startupPrompt\\\": \\\"never\\\",\\n \\\"security.workspace.trust.untrustedFiles\\\": \\\"open\\\",\\n // ------------------------------------------------\\n // Telemetry\\n // ------------------------------------------------\\n \\\"telemetry.telemetryLevel\\\": \\\"off\\\",\\n \\\"redhat.telemetry.enabled\\\": false,\\n // ------------------------------------------------\\n // Proxy\\
@jimbrig
jimbrig / mcp_client_demo.R
Created May 20, 2025 23:48 — forked from simonpcouch/mcp_client_demo.R
A demo implementation of the MCP client protocol in R
# an example server: acquaint's MCP server for R sessions
r_process <- callr::r_bg(
function() acquaint::mcp_server(),
stdout = "|",
stdin = "|"
)
Sys.sleep(1)
log_cat_client <- function(x, append = TRUE) {