Skip to content

Instantly share code, notes, and snippets.

@ForgottenUmbrella
ForgottenUmbrella / sway-transparency.patch
Created June 13, 2022 10:50
Revised sway patch to render transparent fullscreen containers
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index 68f095c0..cc884b76 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -287,51 +287,26 @@ static void output_for_each_surface(struct sway_output *output,
};
struct sway_workspace *workspace = output_get_active_workspace(output);
- struct sway_container *fullscreen_con = root->fullscreen_global;
- if (!fullscreen_con) {
@ForgottenUmbrella
ForgottenUmbrella / ptr-ref-val.md
Created December 9, 2018 04:28
Notes on when to use pointers, references and values for variables, parameters and return values in C++.

When to use pointers, references and values

Variables (including member variables)

  • Prefer const.
  • Prefer stack allocations (i.e. values rather than pointers or references).
  • When heap allocation is necessary (e.g for polymorphism), prefer smart pointers to automatically handle lifespan and ownership.
    • Use std::unique_ptr for objects that should live until the end of scope.
    • Use std::shared_ptr for reference counting.
  • Use std::weak_ptr to safely access potentially deleted objects managed by
@ForgottenUmbrella
ForgottenUmbrella / using_conan_cpp.md
Last active November 8, 2024 15:41
How to use Conan, a C++ package manager, for beginners

Package Management in C++ with Conan for Beginners

C++ package management can be complicated.

Below are some key tools involved:

Make

Make runs commands defined in a Makefile, for example, to build and install programs with the compiler and linker. For our purposes, we won't worry about what this looks like; you only need to understand its purpose in relation to CMake.

@ForgottenUmbrella
ForgottenUmbrella / publish_python.md
Last active September 24, 2024 10:14
How to publish Python apps for human beings

How to publish Python apps for human beings

So, you've created a Python app (be it a graphical user interface with Qt or the like, or a simple command line interface). Great! But how are others going to use it? Python applications often have dependencies (e.g. from third-party modules), and they also need a Python interpreter to run them. For a developer, installing all the necessary bits and bobs to make things work is okay, but that's unacceptable for a normal user - they just want to download the thing and run it.

Below are simple instructions to publish your app on the three main operating systems: Windows, macOS and Linux.