Skip to content

Instantly share code, notes, and snippets.

View cderv's full-sized avatar

Christophe Dervieux cderv

View GitHub Profile
@nanxstats
nanxstats / check-url.R
Last active January 23, 2024 09:37
A general-purpose link checker for R Markdown and Quarto projects https://nanx.me/blog/post/rmarkdown-quarto-link-checker/
#' Flatten copy
#'
#' @param from Source directory path.
#' @param to Destination directory path.
#'
#' @return Destination directory path.
#'
#' @details
#' Copy all `.Rmd`, `.qmd`, and `.md` files from source to destination,
#' rename the `.qmd` and `.md` files with an additional `.Rmd` extension,
@doggy8088
doggy8088 / README.md
Last active June 5, 2024 14:53 — forked from Trenly/README.md
Install Winget to the Windows Sandbox Base Image

This powershell script modifies the Base Image, or the Virtual Hard Disk, which the Windows Sandbox launches upon startup. It will copy the required files to the sandbox and add a registry key which will install them upon startup. By default the script will install the latest stable release of Winget. You can specify to use the latest pre-release with the -PreRelease switch.

When a new version of Winget is released, run this script again to update the installation in the sandbox to the latest version

@tarleb
tarleb / custom-markdown.lua
Last active June 27, 2023 23:55
Custom Lua writer, using the `layout` module to produce nicely layed-out Markdown.
-- This is a sample custom writer for pandoc, using Layout to
-- produce nicely wrapped output.
local layout = pandoc.layout
local text = pandoc.text
local type = pandoc.utils.type
local l = layout.literal
-- Table to store footnotes, so they can be included at the end.
@atusy
atusy / tabset.Rmd
Created January 10, 2021 04:10
Navigate tabsets from ToC (tabs must be named uniquely)
---
title: "minidown::mini_document"
author: "Atsushi Yasumoto"
date: "`r Sys.Date()`"
output:
html_document:
toc: true
toc_float: true
self_contained: false
pandoc_args: ["--lua-filter", "tabset.lua"]
@matusnovak
matusnovak / README.md
Last active July 16, 2024 13:34
GPG + Git SSH Authentication and Signing on Windows 10

GPG + Git SSH Authentication and Signing on Windows 10

Introduction

This simple Gist will explain how to settup your GPG key to work for SSH authentication (with Git) and Git commit signing on Windows 10. This may seem straightforward on Linux, but there are certain tweaks needed on Windows.

No Cygwin, no MinGW, no Git Bash or any other Linux emulated environment. This works in pure Windows 10.

Software needed

@tarleb
tarleb / latex-logo.lua
Last active April 8, 2021 10:33
Lua filter to render TeX and LaTeX as logos like the \TeX and \LaTeX{} macros do.
-- Render TeX and LaTeX like the `\TeX` and `\LaTeX{}` macros do.
-- Copyright © 2020 Albert Krewinkel <albert+pandoc@zeitkraut.de>
-- License: MIT License
-- Style inspired by https://tess.oconnor.cx/2007/08/tex-poshlet
local style = pandoc.RawBlock('html', [[
<style>
.tex-logo sub, .latex-logo sub {
font-size: 100%;
margin-left: -0.1667em;
@cderv
cderv / 00-New setup.md
Last active May 12, 2024 17:29
New computer setup
# installed by winget
winget install PowerShell-Preview
winget install git
git config --global user.name "Christophe Dervieux"
git config --global user.email christophe.dervieux@gmail.com
winget install rstudio
winget install vscode
winget install -e R
winget install Github.GithubDesktop
/* rs-theme-name: Idle Eyes */
/* rs-theme-is-dark: TRUE */
.ace_gutter {
background: #3b3b3b;
color: rgb(153,153,153)
}
.ace_print-margin {
width: 1px;
background: #555;
}
@Ryo-N7
Ryo-N7 / epl_goal_contribution_matrix_18-19.r
Last active April 1, 2021 14:19
Goal contribution matrix for Premier League 2018-2019
# pkgs
pacman::p_load(tidyverse, polite, scales, ggimage, ggforce,
rvest, glue, extrafont, ggrepel, magick)
loadfonts()
## add_logo function from Thomas Mock
add_logo <- function(plot_path, logo_path, logo_position, logo_scale = 10){
# Requires magick R Package https://github.com/ropensci/magick
@kellobri
kellobri / app.R
Last active April 10, 2023 09:20
How-To: Leverage R Markdown output files to create simple ETL processes on RStudio Connect (These are two separate data assets)
library(shiny)
library(DT)
data <- read.csv('https://colorado.rstudio.com/rsc/content/2352/data.csv')
ui <- fluidPage(
titlePanel("Basic Data Filter Application"),
hr(),
h4("This application presents data generated by a scheduled R Markdown process: ", tags$a(href="https://colorado.rstudio.com/rsc/content/2352", "See it here!")),
p("Use this framework to build out your own R Markdown-based ETL jobs hosted on RStudio Connect."),