Skip to content

Instantly share code, notes, and snippets.

View Patrikios's full-sized avatar
🎯
carpe diem

Patrik Patrikios

🎯
carpe diem
View GitHub Profile
@Patrikios
Patrikios / App1.R
Last active April 16, 2023 11:10
R Shiny modal outputs render on input change strategies (previously rendered plot on input change visible VS plot render does not show previoous plot)
# This app.R demonstrates how R Shiny rerenders a unique output id
# the previously renred plot is initially visible, afterwards changed
# that is how shiny is designed to work
library(shiny)
library(ggplot2)
app <- shinyApp(
ui = fluidPage(
selectInput(
@Patrikios
Patrikios / pipable_chatgGPT_commands.R
Last active April 16, 2023 11:36
chatGPT interactions, as well to help you generate and evaluate code
# an example of using package 'chatgpt' to help you generate pipaeble code
# I used here code that I have seen on twitter
# however I cannot locate it anymore, no pun intended, will update the sources once I found it
# my package loader (installs packages if they are not installed)
if (!require(attachee)) {
if (!require(devtools)) {
install.packages(devtools)
} else {
install_github("patrikios/attachee")
@Patrikios
Patrikios / powershell.ps1
Last active April 29, 2023 11:51
poweshel alias function to delete and add new value to path
Set-Alias delp Remove-EnvironmentPath
function Remove-EnvironmentPath {
$toRemove = ($args -join " ").TrimEnd("\")
$userPath = [Environment]::GetEnvironmentVariable("PATH", "User")
$changedUserPath = $userPath.Split(";") |
ForEach-Object { $_.TrimEnd("\").Trim() } |
Where-Object { $_ -ne $toRemove }
$changedUserPath = $changedUserPath -Join ";"