Skip to content

Instantly share code, notes, and snippets.

View Yousuf28's full-sized avatar
🎯
Building R Shiny App

Yousuf Ali Yousuf28

🎯
Building R Shiny App
View GitHub Profile
@fast-90
fast-90 / quarto-setup.el
Last active February 1, 2024 11:44
My setup for Quarto in Emacs
(use-package python
:init
(defun python-comint-filter (output)
"Filter out '__PYTHON_EL_' when sending region to inferior Python shell.
See also: https://stackoverflow.com/questions/75103221/emacs-remove-python-el-eval-message"
(let* ((regexp "^.*__PYTHON_EL_\\(.*\\)\\(.*\\)[[:space:]]*$")
(lines (split-string output "\n"))
(filtered-lines (cl-remove-if (lambda (line)
(or (string-match-p regexp line)
@nanxstats
nanxstats / shiny-file-input-area.R
Created April 18, 2022 01:50
Shiny file input area (Bootstrap 5)
fileInputArea <- function(inputId, label, multiple = FALSE, accept = NULL,
width = NULL, buttonLabel = "Browse...", placeholder = "No file selected") {
restoredValue <- restoreInput(id = inputId, default = NULL)
# Catch potential edge case - ensure that it's either NULL or a data frame.
if (!is.null(restoredValue) && !is.data.frame(restoredValue)) {
warning("Restored value for ", inputId, " has incorrect format.")
restoredValue <- NULL
}
@d3noob
d3noob / .block
Last active April 26, 2023 02:18
Simple vertical tree diagram using v7
license: mit
@xvzftube
xvzftube / init.vim
Last active December 3, 2023 19:37
my vimrc
" Plugins
call plug#begin('~/.vim/plugged')
Plug 'rakr/vim-one' " vim-one color theme
Plug 'scrooloose/nerdtree' " side bar file tree
Plug 'itchyny/lightline.vim' " minmal status bar
Plug 'tpope/vim-fugitive' " allows git commands in vim session
Plug 'airblade/vim-gitgutter' " shows git changes in gutter
Plug 'easymotion/vim-easymotion' " go to any word quickly '\\w', '\\e', '\\b'
Plug 'KKPMW/vim-sendtowindow' " send commands to REPL
Plug 'yuttie/comfortable-motion.vim' " scrolling 'C-d' or 'C-u'
@rohitfarmer
rohitfarmer / nvimr-demo.md
Last active January 31, 2024 05:32
Nvim-R Demo

How to use Neovim or VIM Editor as an IDE for R

Note: This tutorial is written for Linux based systems.

Requirements

R >= 3.0.0

To install the latest version of R please flollow the download and install instructions at https://cloud.r-project.org/

Neovim >= 0.2.0

Neovim (nvim) is the continuation and extension of Vim editor with the aim to keep the good parts of Vim and add more features. In this tutorial I will be using Neovim (nvim), however, most of the steps are equally applicable to Vim also. Please follow download and installation instructions on nvim's GitHub wiki https://github.com/neovim/neovim/wiki/Installing-Neovim.

@nadya-p
nadya-p / pdf_to_text.py
Last active August 15, 2022 04:42
Extract text contents of PDF files recursively
from tika import parser
import os
def extract_text_from_pdfs_recursively(dir):
for root, dirs, files in os.walk(dir):
for file in files:
path_to_pdf = os.path.join(root, file)
[stem, ext] = os.path.splitext(path_to_pdf)
if ext == '.pdf':
anonymous
anonymous / .bashrc
Created November 13, 2016 14:10
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@evanwill
evanwill / gitBash_windows.md
Last active April 26, 2024 03:58
how to add more utilities to git bash for windows, wget, make

How to add more to Git Bash on Windows

Git for Windows comes bundled with the "Git Bash" terminal which is incredibly handy for unix-like commands on a windows machine. It is missing a few standard linux utilities, but it is easy to add ones that have a windows binary available.

The basic idea is that C:\Program Files\Git\mingw64\ is your / directory according to Git Bash (note: depending on how you installed it, the directory might be different. from the start menu, right click on the Git Bash icon and open file location. It might be something like C:\Users\name\AppData\Local\Programs\Git, the mingw64 in this directory is your root. Find it by using pwd -W). If you go to that directory, you will find the typical linux root folder structure (bin, etc, lib and so on).

If you are missing a utility, such as wget, track down a binary for windows and copy the files to the corresponding directories. Sometimes the windows binary have funny prefixes, so

@thegitfather
thegitfather / vanilla-js-cheatsheet.md
Last active May 6, 2024 14:31
Vanilla JavaScript Quick Reference / Cheatsheet
@jonlabelle
jonlabelle / regular_expression_cheatsheet.md
Last active November 8, 2023 23:25
Regular Expression Cheatsheet

Regular Expression Cheatsheet

Anchors

^   Matches at the start of string or start of line if multi-line mode is
	enabled. Many regex implementations have multi-line mode enabled by
	default.

$ Matches at the end of string or end of line if multi-line mode is enabled.