Skip to content

Instantly share code, notes, and snippets.

View sharadhr's full-sized avatar

Sharadh Rajaraman sharadhr

View GitHub Profile
% epreport.cls simplifies typesetting experimental physics reports, and assignments.
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{epreport}[21/01/16 NUS Experimental Physics report document class]
%%%%% MISCELLANEOUS BUT PRIMARY IMPORTS %%%%%
\RequirePackage{iftex,etoolbox,expl3,xparse,silence}
% Import early to avoid option errors
\RequirePackage[table,dvipsnames,x11names]{xcolor}
@sharadhr
sharadhr / CMakeLists.txt
Last active June 13, 2023 17:11
Clang-Tidy breaks with standard C++20 modules
cmake_minimum_required(VERSION 3.26)
# Required by CMake 3.26 to enable standard C++20 module support
set(CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP 1)
set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API 2182bf5c-ef0d-489a-91da-49dbc3090d2a)
# Generate compile_commands.json
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Comment out the following line to disable clang-tidy; only works with Ninja.
@sharadhr
sharadhr / silencing_vs_devterm.md
Last active April 7, 2024 14:47
Silencing the Developer PowerShell

Silencing the Developer PowerShell

TL;DR

I used dnSpy to edit a CIL DLL library, Microsoft.VisualStudio.DevShell.dll to silence the banner displayed by a Developer PowerShell terminal. I also added the Developer PowerShell functionality to all my PowerShell terminals, so I can use cl.exe and clang.exe (and clang-cl.exe) from anywhere.

But two sentences do not a blog post make.

<#
.SYNOPSIS Launch Developer PowerShell
.DESCRIPTION
Locates and imports a Developer PowerShell module and calls the Enter-VsDevShell cmdlet. The Developer PowerShell module
is located in one of several ways:
1) From a path in a Visual Studio installation
2) From the latest installation of Visual Studio (higher versions first)
3) From the instance ID of a Visual Studio installation
4) By selecting a Visual Studio installation from a list
@sharadhr
sharadhr / delete_git_submodule.md
Created January 26, 2024 18:52 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule