Skip to content

Instantly share code, notes, and snippets.

View dimitarpg13's full-sized avatar

Dimitar Gueorguiev dimitarpg13

View GitHub Profile
@dimitarpg13
dimitarpg13 / delete_git_submodule.md
Created June 24, 2023 21: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
@dimitarpg13
dimitarpg13 / markdown-cheatsheet.md
Created August 20, 2022 14:16 — forked from jonschlinkert/markdown-cheatsheet.md
A better markdown cheatsheet.
@dimitarpg13
dimitarpg13 / gist:cea06bede197a25815acfb4f8822f636
Created November 1, 2020 03:26
Terminal prompt not wrapping correctly
https://unix.stackexchange.com/questions/105958/terminal-prompt-not-wrapping-correctly
I have an issue where if I type in very long commands in bash the terminal will not render what I'm typing correctly. I'd expect that if I had a command like the following:
username@someserver ~/somepath $ ssh -i /path/to/private/key
[email protected]
The command should render on two lines. Instead it will often wrap around and start writing over the top of my prompt, somewhat like this:
[email protected] -i /path/to/private/key
If I decide to go back and change some argument there's no telling where the cursor will show up, sometimes in the middle of the prompt, but usually on the line above where I'm typing.
@dimitarpg13
dimitarpg13 / Setup GCC and CLANG Toolchains.md
Created September 25, 2019 17:43 — forked from bhaskarvk/Setup GCC and CLANG Toolchains.md
Proper GCC (vers. 5/6/7) & LLVM/CLANG (vers. 4/5) Toolchain Setup on Ubuntu/Linux Mint

This approach uses update-alternatives to manage GCC and LLVM/CLANG C/C++ compiler toolchains. Although tested on Linux Mint 18.3, this approach should work on any Debian based distro or for that matter any Linux distro with update-alternatives support, provided the packages are installed correctly.

There are 3 files

  • gcc-alternatives.sh installs GCC versions 5/6/7 and sets up alternatives for gcc/g++/cpp/gfortran.
  • llvm-clang-alternatives.sh installs LLVM and CLANG versions 4/5 and sets up alternatives for various LLVM and CLANG programs including clang and clang++.
  • cc-alternatives.sh sets up alternatives for the cc, cxx, and the ld commands. This script can be used to change systemwide default compiler/linker combination to either GCC or CLANG.

Once these scripts are run you can change the system GCC/CLANG versions by running sudo update-alternatives --config gcc|clang. To change the default compiler/linker combo used by t