Skip to content

Instantly share code, notes, and snippets.

@remlapmot
remlapmot / shortcuts.xml
Last active April 26, 2021 14:38
Shortcuts file for Notepad++. File location %appdata%\Notepad++
<NotepadPlus>
<InternalCommands />
<Macros>
<Macro name="Trim Trailing Space and Save" Ctrl="no" Alt="yes" Shift="yes" Key="83">
<Action type="2" message="0" wParam="42024" lParam="0" sParam="" />
<Action type="2" message="0" wParam="41006" lParam="0" sParam="" />
</Macro>
</Macros>
<UserDefinedCommands>
<Command name="Get PHP help" Ctrl="no" Alt="yes" Shift="no" Key="112">https://www.php.net/$(CURRENT_WORD)</Command>
@remlapmot
remlapmot / wsl.xlaunch
Created March 1, 2020 11:09
XLaunch config file for X11 forwarding from Windows Subsystem for Linux. Run with VcXsrv for best results.
<?xml version="1.0" encoding="UTF-8"?>
<XLaunch WindowMode="MultiWindow" ClientMode="NoClient" LocalClient="False" Display="-1" LocalProgram="xcalc" RemoteProgram="xterm" RemotePassword="" PrivateKey="" RemoteHost="" RemoteUser="" XDMCPHost="" XDMCPBroadcast="False" XDMCPIndirect="False" Clipboard="True" ClipboardPrimary="True" ExtraParams="-ac" Wgl="True" DisableAC="False" XDMCPTerminate="False"/>
@remlapmot
remlapmot / packages.R
Last active December 1, 2021 13:59
Helpful packages and their dependencies to install with a fresh install of R
#' ---
#' title: "Helpful packages and their dependencies to install with a fresh install of R"
#' author: Tom Palmer
#' date: 2020-03-27
#' ---
#' Tested on Ubuntu 18.04
if (Sys.info()["sysname"] == "Linux"){
system('sudo apt-get install -y libcurl4-openssl-dev')
system('sudo apt-get install -y libssl-dev')
@remlapmot
remlapmot / 4k-windows-resize-after-sleep-fix.reg
Last active May 6, 2024 17:22
Windows 10 registry entry setting which fixes PrimSurfSize.cx, PrimSurfSize.cy, and Stride values for a 4K monitor, so windows do not resize after sleep (an issue which seems to affect some Dell computers)
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\Configuration\NOEDID_8086_3E98_00000000_00020000_31063^9B5CF2A2AB5D52EABA55D3D249C48521]
"SetId"="NOEDID_8086_3E98_00000000_00020000_31063"
"Timestamp"=hex(b):7c,f5,a9,74,7f,f1,d5,01
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\Configuration\NOEDID_8086_3E98_00000000_00020000_31063^9B5CF2A2AB5D52EABA55D3D249C48521\00]
"PrimSurfSize.cx"=dword:00000f00
"PrimSurfSize.cy"=dword:00000870
"Stride"=dword:00003c00
@remlapmot
remlapmot / fork-sync.sh
Last active April 8, 2021 12:55
Sync a forked repo with the upstream master branch - both locally and on GitHub (origin)
git fetch upstream
git checkout master
git merge upstream/master
git push origin master
# git reset --hard upstream/master
# git push origin master --force
# or
git pull upstream master
git push origin master
@remlapmot
remlapmot / ubuntu.xlaunch
Last active March 21, 2021 23:52
XLaunch file for running a windowed desktop environment for Ubuntu (or another Linux Distro) on WSL
<?xml version="1.0" encoding="UTF-8"?>
<XLaunch WindowMode="Windowed" ClientMode="NoClient" LocalClient="False" Display="-1" LocalProgram="xcalc" RemoteProgram="xterm" RemotePassword="" PrivateKey="" RemoteHost="" RemoteUser="" XDMCPHost="" XDMCPBroadcast="False" XDMCPIndirect="False" Clipboard="True" ClipboardPrimary="True" ExtraParams="-swcursor -ac" Wgl="True" DisableAC="False" XDMCPTerminate="False"/>
@remlapmot
remlapmot / default.Rmd
Last active February 7, 2024 11:51
Default R Markdown file to use in RStudio (from v1.3). File location: %appdata%\rstudio\templates ; on Mac/Linux: ~/.config/rstudio/templates
---
title: "Title"
author: "My Name"
date: "`r format(Sys.time(), '%d %B %Y')`"
output:
html_document:
toc: true
toc_float:
collapsed: false
smooth_scroll: false
@remlapmot
remlapmot / install-rstudio-ubuntu.sh
Last active August 20, 2020 07:28
Install RStudio on Ubuntu using gdebi in the Terminal. Note download the deb file from the RStudio website first.
# sudo apt-get install gdebi-core
# sudo gdebi rstudio-1.3.923-amd64.deb
sudo dpkg -i rstudio-1.3.1019-amd64.deb
@remlapmot
remlapmot / install-pdfarranger.sh
Last active March 25, 2020 17:29
Install pdfarranger on Ubuntu
sudo add-apt-repository ppa:linuxuprising/apps
sudo apt update
sudo apt install pdfarranger
@remlapmot
remlapmot / .wslconfig
Last active March 31, 2020 22:21
WSL 2 configuration file - to limit the amount of RAM the Vmmem process uses. File location: %userprofile%
[wsl2]
# kernel=<path> # An absolute Windows path to a custom Linux kernel.
memory=4GB # How much memory to assign to the WSL2 VM.
# processors=<number> # How many processors to assign to the WSL2 VM.
swap=0GB # How much swap space to add to the WSL2 VM. 0 for no swap file.
# swapFile=<path> # An absolute Windows path to the swap vhd.
# localhostForwarding=<bool> # Boolean specifying if ports bound to wildcard or localhost in the WSL2 VM should be connectable from the host via localhost:port (default true).
# <path> entries must be absolute Windows paths with escaped backslashes, for example C:\\Users\\Ben\\kernel
# <size> entries must be size followed by unit, for example 8GB or 512MB