Skip to content

Instantly share code, notes, and snippets.

View angelotrivelli's full-sized avatar

Angelo Trivelli angelotrivelli

View GitHub Profile
@angelotrivelli
angelotrivelli / Microsoft.PowerShell_profile.ps1
Last active February 10, 2024 17:06
alias to invoke quarto and also set $QUARTO_PYTHON path correctly for poetry .venv's
function Invoke-QuartoWithPythonEnv {
$env:QUARTO_PYTHON=(Get-Command python).Source
echo "using python from $env:QUARTO_PYTHON"
&"C:\Program Files\Quarto\bin\quarto.exe" $args
}
Set-Alias -Name quarto -Value Invoke-QuartoWithPythonEnv
@angelotrivelli
angelotrivelli / apply_filter_to_a_list_of_tibbles.R
Last active August 26, 2023 23:51
pmap is confusing part 2
library(tidyverse)
bdr <- tcm_files |>
distinct(batch, device, run)
walk(unique(bdr$batch), ~ dir.create(file.path(pipeline_step_02, .),
recursive = TRUE,
showWarnings = FALSE))
library(tidyverse)
d <- tibble(batch = c('one', 'two', 'three'),
device = c('a','b','c'),
num = c(1,2,3))
myfunc1 <- function(batch, device, num) {
return(paste0(batch, '_', device, '_', 10+num))
}
@angelotrivelli
angelotrivelli / poetry.toml
Last active July 15, 2023 16:41
poetry.toml file to force poetry to put venv in project root
[virtualenvs]
create = true
in-project = true
prefer-active-python = true
#!/usr/bin/env bash
set -e
set -x
java -version
yes | sudo yum install -y java-1.8.0-openjdk-devel
sudo /usr/sbin/alternatives --set java /usr/lib/jvm/jre-1.8.0-openjdk.x86_64/bin/java
sudo /usr/sbin/alternatives --set javac /usr/lib/jvm/java-1.8.0-openjdk.x86_64/bin/javac
yes | sudo yum remove java-1.7.0-openjdk
java -version
#!/usr/bin/env bash
set -e
set -x
cd ~
# some prerequisites
yes | sudo yum update
yes | sudo yum install git
yes | sudo yum groupinstall "Development tools"
yes | sudo yum install ncurses-devel
;;; Uncomment the modules you'd like to use and restart Prelude afterwards
;; Emacs IRC client
(require 'prelude-erc)
;; (require 'prelude-ido) ;; Super charges Emacs completion for C-x C-f and more
(require 'prelude-ivy) ;; A mighty modern alternative to ido
;; (require 'prelude-helm) ;; Interface for narrowing and search
;; (require 'prelude-helm-everywhere) ;; Enable Helm everywhere
(require 'prelude-company)
;; (require 'prelude-key-chord) ;; Binds useful features to key combinations