Skip to content

Instantly share code, notes, and snippets.


kabr cutterkom

View GitHub Profile
cutterkom / save-df-as-xlsx-group-var-as-sheet.R
Last active Oct 14, 2021
R: Save a dataframe als xlsx with each group a separate sheet
View save-df-as-xlsx-group-var-as-sheet.R
# Save a dataframe als xlsx with each group a separate sheet
# plus formatting and highlighting
# some configs
filename <- "test.xlsx"
cutterkom / get_var.R
Created Dec 9, 2020
get column stored as variable in R, alternative zu eval()
View get_var.R
# get column stored as variable
# alternative to eval()
column <- "name"
df %>% filter(get(column)==1)
cutterkom /
Created Dec 9, 2020
how to delete shiny from a linux server
  • Delete/Remove Software/Package, Link

    1. Search in list of packages with dpkg --list
    2. Find name of package and delete sudo apt-get --purge remove shiny-server
    • --purge removes config files, too
    • --autoremove: delete unused packages
    • in combination sudo apt-get --purge --autoremove remove shiny-server
    1. maybe also look for all files with the package name and delete them: find -name shiny-server
  • Find all files with string in name: find -name string

  • Find all files with string and delete them: ``find . -name "FILE-TO-FIND" -exec rm -rf {} ;` (folder, too), link

cutterkom /
Created Nov 23, 2019
Measure humidity and temperature with a Raspberry Pi, save the result as a csv file and send a Telegram message
### Measure Temperature and Humidity very 30 secs and save it csv file
# code
### Create a Telegram Bot
# - create a bot by texting to BotFather `/newbot` and receive a token
# - go to ``
# - send a text to your bot
# - the JSON on `` will update and you get the `chat_id`
# send a message to chat: ``
# link: [Creating a Telegram bot for personal notifications](
cutterkom / r_to_nextcloud.R
Created Jun 22, 2019
Uploading a file to Nextcloud from R via webdav
View r_to_nextcloud.R
# webdav target and login
dav <- ""
username <- "<username>"
password <- "<password>"
# the file to upload
img <- "image.png"
cutterkom / redirect category to post
Last active Sep 20, 2020
WordPress: Redirect from category.php to first post in category
View redirect category to post
function strytllr_redirect_from_story_to_first_slide(){
global $wp_query;
if( is_archive() && $wp_query->query('showposts=1&order=ASC') ){
// Get permalink
$post_url = get_permalink();
// Redirect to post page
wp_redirect( $post_url );