Skip to content

Instantly share code, notes, and snippets.

View seandewar's full-sized avatar
🏖️
Away for a while.

Sean Dewar seandewar

🏖️
Away for a while.
  • United Kingdom
  • 10:17 (UTC +01:00)
View GitHub Profile
@tjdevries
tjdevries / cfilter.lua
Created September 29, 2022 03:12
cfilter.vim -> cfilter.lua
-- vim9script
-- # cfilter.vim: Plugin to filter entries from a quickfix/location list
-- # Last Change: Jun 30, 2022
-- # Maintainer: Yegappan Lakshmanan (yegappan AT yahoo DOT com)
-- # Version: 2.0
-- #
-- # Commands to filter the quickfix list:
-- # :Cfilter[!] /{pat}/
-- # Create a new quickfix list from entries matching {pat} in the current
-- # quickfix list. Both the file name and the text of the entries are
@fnky
fnky / ANSI.md
Last active June 30, 2024 00:05
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@shafik
shafik / WhatIsStrictAliasingAndWhyDoWeCare.md
Last active June 27, 2024 11:24
What is Strict Aliasing and Why do we Care?

What is the Strict Aliasing Rule and Why do we care?

(OR Type Punning, Undefined Behavior and Alignment, Oh My!)

What is strict aliasing? First we will describe what is aliasing and then we can learn what being strict about it means.

In C and C++ aliasing has to do with what expression types we are allowed to access stored values through. In both C and C++ the standard specifies which expression types are allowed to alias which types. The compiler and optimizer are allowed to assume we follow the aliasing rules strictly, hence the term strict aliasing rule. If we attempt to access a value using a type not allowed it is classified as undefined behavior(UB). Once we have undefined behavior all bets are off, the results of our program are no longer reliable.

Unfortunately with strict aliasing violations, we will often obtain the results we expect, leaving the possibility the a future version of a compiler with a new optimization will break code we th

@mbinna
mbinna / effective_modern_cmake.md
Last active June 26, 2024 13:26
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

@joepie91
joepie91 / vpn.md
Last active June 30, 2024 02:08
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.