Skip to content

Instantly share code, notes, and snippets.

View Ligh7bringer's full-sized avatar
🏠
Working from home

Svetlozar Georgiev Ligh7bringer

🏠
Working from home
View GitHub Profile
@Ligh7bringer
Ligh7bringer / effective_modern_cmake.md
Created January 10, 2020 01:39 — forked from mbinna/effective_modern_cmake.md
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@Ligh7bringer
Ligh7bringer / delete_git_submodule.md
Created July 18, 2019 22:13 — 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
@Ligh7bringer
Ligh7bringer / wine_gaming.sh
Created July 7, 2019 19:41 — forked from tonylambiris/wine_gaming.sh
Wine setup script for creating a minimalist gaming environment
#!/bin/bash
# run this script with environmental variables like so:
# env WINEARCH=win64 WINEPREFIX=$HOME/Documents/Wine/Overwatch ~/wine_gaming.sh
#
# the above will create a new wine prefix, removing it if it already exists
# you will be prompted to hit enter before continuing or aborting with a ctrl-c
#
# it will also download/run the latest Battle.net client but this is optional
# ensure wine-staging, winetricks, wineasio and dxvk are installed prior to running
@Ligh7bringer
Ligh7bringer / pandoc.css
Created April 13, 2019 17:33 — forked from killercup/pandoc.css
Add this to your Pandoc HTML documents using `--css pandoc.css` to make them look more awesome. (Tested with Markdown and LaTeX.)
/*
* I add this to html files generated with pandoc.
*/
html {
font-size: 100%;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
@Ligh7bringer
Ligh7bringer / GLDebugMessageCallback.c
Created December 5, 2018 02:28 — forked from liam-middlebrook/GLDebugMessageCallback.c
GL Debug Output Message Callback Guide
// This is free and unencumbered software released into the public domain.
//
// Anyone is free to copy, modify, publish, use, compile, sell, or distribute
// this software, either in source code form or as a compiled binary, for any
// purpose, commercial or non-commercial, and by any means.
//
// In jurisdictions that recognize copyright laws, the author or authors of this
// software dedicate any and all copyright interest in the software to the
// public domain. We make this dedication for the benefit of the public at large
// and to the detriment of our heirs and successors. We intend this dedication
@Ligh7bringer
Ligh7bringer / openMP_whileLoop.c
Created October 9, 2018 16:21 — forked from stormxuwz/openMP_whileLoop.c
parallel while loop
// This code is from https://www.cac.cornell.edu/VW/OpenMP/whileloop.aspx
#include <omp.h>
#include <stdio.h>
int main(int argc, char **argv)
{
/* OpenMP does not provide a parallel while loop,
so we're going to have to make one ourselves... */
int sj, sstop, tn, tj, tstop;
int foo(int j);
@Ligh7bringer
Ligh7bringer / Restore the GRUB Bootloader.md
Created April 24, 2018 19:09 — forked from dianjuar/Restore the GRUB Bootloader.md
Restore the GRUB Bootloader on Manjaro Linux. Usefull when your fresh windows install eats your grub and can not boot into your linux installation, or for some how your grub is missing

Restore the GRUB Bootloader on Manjaro

  1. Chroot into your linux instalation
    1. The easiest way is with mhwd-chroot
      1. Install it yaourt -S mhwd-chroot
      2. Run it sudo mhwd-chroot
      3. DONE, you have chrooted into your linux installation (open a root console of your installed linux OS, is like just open a console with root access)
  2. Restore your GRUB
    1. Install a new GRUB bootloader with grub-install /dev/sda
  3. Recheck to ensure the that installation has completed without any errors grub-install --recheck /dev/sda

Travel Guide to OpenGL

I've figured out several things while trying to extend my knowledge of Computer Graphics.

  1. OpenGL can be a bitch if you don't know what you're doing.
  2. There is no worse pain than to experience CMake without knowing what you're doing.
  3. When walking to the depths of hell, it would be nice to have a travel guide.

And that's what this is, a travel guide.

@Ligh7bringer
Ligh7bringer / CMakeHideConsole.cmake
Created March 30, 2018 13:55 — forked from optimalistel/CMakeHideConsole.cmake
CMake Hide console window in visual studio projects
#--------------------------------------------------------------------
# Hide the console window in visual studio projects
#--------------------------------------------------------------------
if(MSVC)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup")
endif()
#--------------------------------------------------------------------
# Hide the console window in visual studio projects - Release
#--------------------------------------------------------------------
@Ligh7bringer
Ligh7bringer / git-tag-delete-local-and-remote.sh
Created March 30, 2018 02:00 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName