Skip to content

Instantly share code, notes, and snippets.

@Eolu
Eolu / pointerception.cpp
Created March 15, 2020 18:45
Some pointers on C pointers (and C++ references) for new developers trying to grasp the essentials.
// Note: I use hex nomenclature (0x...) to make it obvious that the value I'm talking about
// is a memory address. Under the hood there isn't any particular distinction (everything is
// represented in binary eventually).
void pointerception()
{
// i is not a pointer.
int i;
// i can be set to a value
@Eolu
Eolu / zalgo.rs
Last active December 17, 2021 14:42
Rust code to create Zalgo text
use rand::{Rng, thread_rng};
const ZALGO_UP: [char; 50] =
[
'\u{030e}', /* ̎ */ '\u{0304}', /* ̄ */ '\u{0305}', /* ̅ */
'\u{033f}', /* ̿ */ '\u{0311}', /* ̑ */ '\u{0306}', /* ̆ */ '\u{0310}', /* ̐ */
'\u{0352}', /* ͒ */ '\u{0357}', /* ͗ */ '\u{0351}', /* ͑ */ '\u{0307}', /* ̇ */
'\u{0308}', /* ̈ */ '\u{030a}', /* ̊ */ '\u{0342}', /* ͂ */ '\u{0343}', /* ̓ */
'\u{0344}', /* ̈́ */ '\u{034a}', /* ͊ */ '\u{034b}', /* ͋ */ '\u{034c}', /* ͌ */
'\u{0303}', /* ̃ */ '\u{0302}', /* ̂ */ '\u{030c}', /* ̌ */ '\u{0350}', /* ͐ */