Skip to content

Instantly share code, notes, and snippets.

View SolindekDev's full-sized avatar
🎯
Focusing

Bruno SolindekDev

🎯
Focusing
  • Barn Programming Language
  • Poland Wrocław
  • 15:08 (UTC +02:00)
View GitHub Profile
@xeekworx
xeekworx / sdl_textediting.cpp
Created October 30, 2022 16:37
With SDL use SDL_TEXTINPUT and SDL_ttf to enter and display text.
#include <SDL.h>
#include <SDL_ttf.h>
#include <iostream>
int main(int argc, char* argv[])
{
const std::string app_title = "SDL_TextBoxExample";
const SDL_Color background_color = SDL_Color{ 0, 50, 255, 255 };
const SDL_Color foreground_color = SDL_Color{ 255, 255, 255, 255 };
const SDL_Rect window_rect = SDL_Rect{ SDL_WINDOWPOS_CENTERED , SDL_WINDOWPOS_CENTERED , 1280, 720 };
from bdfparser import Font # https://github.com/tomchen/bdfparser
# Character 0 (NUL) was changed from 0x0000 to 0x0020 (space)
# Character 255 (NBSP) was changed from 0x00A0 to 0x0020 (space)
cp437_mapping = [
0x0020, 0x263A, 0x263B, 0x2665, 0x2666, 0x2663, 0x2660, 0x2022,
0x25D8, 0x25CB, 0x25D9, 0x2642, 0x2640, 0x266A, 0x266B, 0x263C,
0x25BA, 0x25C4, 0x2195, 0x203C, 0x00B6, 0x00A7, 0x25AC, 0x21A8,
0x2191, 0x2193, 0x2192, 0x2190, 0x221F, 0x2194, 0x25B2, 0x25BC,
0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027,
@Prakasaka
Prakasaka / bash-colors.md
Created July 25, 2020 09:14 — forked from JBlond/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
@fnky
fnky / ANSI.md
Last active July 22, 2024 12:03
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@yamnikov-oleg
yamnikov-oleg / calling_conventions.md
Created February 20, 2016 09:19
Linux Syscalls Reference

Source: man syscall

Architecture calling conventions

Every architecture has its own way of invoking and passing arguments to the kernel. The details for various architectures are listed in the two tables below.

The first table lists the instruction used to transition to kernel mode, (which might not be the fastest or best way to transition to