Skip to content

Instantly share code, notes, and snippets.

View Pharap's full-sized avatar
Путин - клептократический тиран

Pharap Pharap

Путин - клептократический тиран
  • 17:58 (UTC +01:00)
View GitHub Profile
Pharap / url.txt
Created July 31, 2023 08:34
Arduboy JSON Editor URL
#include <Arduboy2.h>
Arduboy2 arduboy;
void setup()
void loop()
Pharap / TextTest.ino
Created August 22, 2020 03:04
Demonstrating different combinations of text parameters on Arduboy
#include <Arduboy2.h>
Arduboy2 arduboy;
// This code is under the CC0 licence
// and hence is in the public domain,
// or your local equivalent.
void setup()
Pharap / C++
Last active June 13, 2021 17:32
A rough description of C++ compilation. Good enough for an introduction, but not particularly technical.

The C++ build process is roughly as thus:

  1. All .cpp (and possibly .c) files are compiled:
    1. First the preprocessor processes the file, it (as required):
      • Parses and processes all #defined macros, storing their definitions in a symbol table (a string to string dictionary).
      • Parses and processes all #if, #elif and #endif macros, thus performing conditional compilation.
      • Parses and processes all #included header (.h) files, which includes inserting the contents of the header file into the point at which it was #included (or performs a process that achieves the equivalent effect).
      • Parses and processes all #pragmas, implementing their compiler-specific behaviour.
        • Note that the most common and widely supported #pragma is #pragma once, which acts as an alternative to include guards.
Pharap /
Last active June 13, 2021 17:32
Windows Keyboard Combos
Pharap / CallOfCthulhu.h
Created May 15, 2020 09:07
The Call of Cthulhu
namespace Cthulhu
template< typename T >
void fhtagn(T & object)
// ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn!
Pharap / Arduborg.hex
Last active December 12, 2019 22:57
Resistance is futile
Pharap / Programming
Created October 11, 2019 02:06
A list of so-called 'programming sins'

Programming Sins

  • Magic numbers
    • Constants with a specific meaning should be clearly named
    • Possible exceptions include:
      • 0, 1 and 2 where usage is unambiguous
      • arguably the shift and mask values when doing bitshifting and masking
  • Single-letter variables names
    • With the possible exceptions of:
  • x and y for coordinates
Pharap /
Last active June 13, 2021 17:53
A collection of amusing software bugs

Funniest Bugs

Video Games



  • Ordinarily if you are kicked out of the Mages Guild you must talk to the Arch-Mage to be reinstated. Later in the quest line you can become the Arch-Mage by killing the previous Arch-Mage. If you are then expelled from the guild after having become the Arch-Mage by killing the former Arch-Mage then you can no longer be reinstated into the guild because there will no longer be an Arch-Mage to talk to.