Skip to content

Instantly share code, notes, and snippets.

@TheZetner
TheZetner / snipnsketch_shift-straight-mouse.ahk
Created November 22, 2023 19:30
AHK2 script to force straight horizontal lines when holding SHIFT and working in Snip & Sketch
SendMode("Input") ; Recommended for new scripts due to its superior speed and reliability
SetTitleMatchMode(2) ; Allows for partial matches in window titles
; Commands specific to when Snipping Tool is open
#HotIf WinActive("Snip & Sketch")
$*Shift::
{ ; V1toV2: Added bracket
Send("{Shift Down}")
CoordMode("Mouse", "Screen")
MouseGetPos(&SetX, &SetY)
@TheZetner
TheZetner / escBrowse.R
Created February 28, 2023 21:42
Browse your shiny app by hitting Esc at any time by adding 1 function call to the UI and 2 to the server
library(shiny)
escUI <- function(id) {
ns <- NS(id)
js <- sprintf('$(document).on("keydown", function (e) { Shiny.onInputChange("%s", e.code); }); $(document).on("keyup", function (e) { Shiny.onInputChange("%s", null); });',
ns("key"), ns("key"))
tagList(
tags$head(tags$script(HTML(js)))
)
}
@TheZetner
TheZetner / settings.json
Last active February 28, 2021 03:13
Windows Terminal Settings
// This file was initially generated by Windows Terminal 1.4.3243.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
// Adding these special
"startOnUserLogin": true,
@TheZetner
TheZetner / .bash_aliases
Last active December 1, 2023 17:13
Bash aliases
# Some taken from https://www.cyberciti.biz/tips/bash-aliases-mac-centos-linux-unix.html
# Refer to a command with \COMMAND to use unaliased program
#1: Control ls command output
## Colorize the ls output ##
alias ls='ls --color=auto'
## Use a long listing format ##
@TheZetner
TheZetner / libraries.R
Created February 19, 2020 21:45
Attach multiple libraries at once
libraries <- function(names = NULL){
try(sapply(names, library, character.only=T))
}
libraries("rmarkdown", "cranlogs", "visdat", "rentrez")
@TheZetner
TheZetner / installwadedeps.R
Last active November 20, 2019 16:46
installwadedeps
# Install necessary pkgs
install.packages("dplyr")
install.packages("here")
install.packages("purrr")
install.packages("magrittr")
install.packages("stringr")
install.packages("BiocManager")
BiocManager::install("Biostrings")
install.packages("~/repos/wade_0.2.2.tar.gz", repos = NULL, type = "source")
[{"history_content_type": "dataset", "update_time": "2019-08-21T20:52:16.803170", "name": "B-seqACCs_G.txt", "extension": "txt", "type_id": "dataset-f2db41e1fa331b3e", "deleted": false, "history_id": "f597429621d6eb2b", "tags": [], "id": "f2db41e1fa331b3e", "visible": true, "state": "ok", "create_time": "2019-08-21T20:19:52.224098", "hid": 1, "url": "/api/histories/f597429621d6eb2b/contents/f2db41e1fa331b3e", "dataset_id": "f2db41e1fa331b3e", "type": "file", "purged": false}, {"history_content_type": "dataset", "update_time": "2019-08-21T20:52:25.318168", "name": "Concatenate datasets on data 1", "extension": "txt", "type_id": "dataset-f597429621d6eb2b", "deleted": false, "history_id": "f597429621d6eb2b", "tags": [], "id": "f597429621d6eb2b", "visible": true, "state": "ok", "create_time": "2019-08-21T20:52:16.378452", "hid": 2, "url": "/api/histories/f597429621d6eb2b/contents/f597429621d6eb2b", "dataset_id": "f597429621d6eb2b", "type": "file", "purged": false}]
@TheZetner
TheZetner / update-packages.R
Last active December 30, 2019 20:06
Update R Packages on Windows After Updating R
# 1. Before you upgrade, build a temp file with all of your old packages.
tmp <- installed.packages()
installedpkgs <- as.vector(tmp[is.na(tmp[,"Priority"]), 1])
save(installedpkgs, file="installed_old.rda")
# 2. Install the new version of R and let it do its thing.
# 3. Once you’ve got the new version up and running, reload the saved packages and re-install them from CRAN.
load("installed_old.rda")
@TheZetner
TheZetner / Jupyter-Ex4-Demo.ipynb
Created June 13, 2019 23:35
Jupyter Exercise 4 - Demo
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@TheZetner
TheZetner / Jupyter-Ex4-Complete.ipynb
Created June 13, 2019 23:29
Jupyter Exercise 4 - Complete
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.