Skip to content

Instantly share code, notes, and snippets.

View cderv's full-sized avatar

Christophe Dervieux cderv

View GitHub Profile
@cderv
cderv / update-pandoc.sh
Last active December 1, 2023 16:38
Update scripts - Ubuntu
#! /bin/bash
# Using gh cli
# check tool requirement
if [[ -z $(command -v gh) ]]
then
echo "Github CLI tool (gh) needs to be installed. See https://cli.github.com/"
exit 1
fi
@cderv
cderv / README
Last active May 30, 2023 12:12
Get some component out of a Qmd document
* Set `lang-out` to the language to ignore
* Use the LUA filter to remove the element mark with the language
```
quarto pandoc --to markdown -L lang-out.lua test.qmd
```
@cderv
cderv / update-org.ps1
Last active June 27, 2022 14:24
Update all repos from an organisation on github
$repos = gh repo list 'quarto-journals' --no-archived --source --json owner,name,defaultBranchRef -q '.[] | {org: .owner.login, repo: .name, branch: .defaultBranchRef.name}' | ConvertFrom-Json
foreach($row in $repos) {
echo "Looking for $($row.repo) folder"
if (Test-Path -Path $row.repo) {
git -C "$($row.repo)" checkout $row.branch
git -C "$($row.repo)" pull origin $row.branch
} else {
gh repo clone "$($row.org)/$($row.repo)"
@cderv
cderv / notes.md
Last active May 5, 2022 16:43
Connect to AZURE VM to test some R stuff

AZURE VM notes

Install azure CLI

Scoop

scoop install azure-cli
@cderv
cderv / custom-reveal-config.html
Last active April 20, 2022 12:23
[ReveaJS] Set code output content dynamically based on remaining space
<script type="text/javascript">
Reveal.on('slidechanged', event => {
getNodes = function(slide) {
var level1 = slide.querySelectorAll(":scope > *")
childs = []
for (let e of level1) {
if (e.nodeName === "DIV" && e.className.includes('cell')) {
var level2 = e.querySelectorAll(":scope > *:not(div.cell-output)")
childs.push(...level2)
@cderv
cderv / compare-hash.ps1
Last active March 30, 2022 08:57
Compare hash of Rstudio daily
$wc = [System.Net.WebClient]::new()
$pkgurl = $(curl -s https://dailies.rstudio.com/rstudio/latest/index.json | jq -r '.products.desktop.platforms[\"windows-xcopy\"].link')
$pkgurl
$publishedHash = $(curl -s https://dailies.rstudio.com/rstudio/latest/index.json | jq -r '.products.desktop.platforms[\"windows-xcopy\"].sha256')
$publishedHash
$FileHash = Get-FileHash -InputStream ($wc.OpenRead($pkgurl))
$FileHash.Hash -eq $publishedHash
$FileHash.Hash
$publishedHash
@cderv
cderv / notes.md
Last active January 21, 2022 15:25
Notes on Pandoc's version minimal requirements
@cderv
cderv / README.md
Last active February 21, 2024 15:56
revdepcheck helpers

Script that helps me with revdepcheck

Getting setup

Download the scripts

get_gist <- function(where = "revdep/tools") {
  gist_id <- "7018c926b14ec45d1a34e70e018db2d5"
 fs::dir_create(where)
@cderv
cderv / update-rstudio.sh
Last active October 26, 2021 13:07
Update RStudio Server Open Source
#! /bin/bash
# Using new API https://dailies.rstudio.com/json-api/
url=$(curl -s https://dailies.rstudio.com/rstudio/latest/index.json | jq -r '.products.server.platforms.bionic.link')
wget $url
sudo dpkg -i $(basename $url)
rm $(basename $url)
@cderv
cderv / keybase.md
Created October 11, 2021 07:25
keybase identity

Keybase proof

I hereby claim:

  • I am cderv on github.
  • I am cderv (https://keybase.io/cderv) on keybase.
  • I have a public key ASAE8lFNAkDnHi-n8qB7OSMzLrI61m9NU4sNfoKkMjjyYQo

To claim this, I am signing this object: