Skip to content

Instantly share code, notes, and snippets.

View Polda18's full-sized avatar

Marek Poláček Polda18

View GitHub Profile
@Polda18
Polda18 / ibsp_format_def.h
Last active March 28, 2021 17:26
Quake III Arena & Quake Live IBSP file format spec
// Source: http://www.mralligator.com/q3/
// Source: https://github.com/id-Software/GtkRadiant/blob/master/tools/quake3/q3map2/q3map2.h
#ifndef __IBSP_FORMAT_DEF_H__
#define __IBSP_FORMAT_DEF_H__
// Byte definition
typedef unsigned char ubyte;
// Vectors definition
@Polda18
Polda18 / login.cpp
Last active February 23, 2019 11:23
Hiding a user input
// source: https://stackoverflow.com/questions/6899025/hide-user-input-on-password-prompt
#include <iostream>
#include <string>
#ifdef WIN32 // Windows
#include <windows.h>
#else // Unix = Linux / Mac OS
#include <termios.h>
#include <unistd.h>
@Polda18
Polda18 / bytes-representatives.c
Last active January 29, 2018 12:05
Bytes text representation with 0x00-0xff hexadecimal ASCII table
#include <stdio.h>
#include <stdlib.h>
int main(void) {
fprintf(stdout, ">> X0 X1 X2 X3 X4 X5 X6 X7 X8 X9 XA XB XC XD XE XF\n");
for(int i = 0; i < 16; ++i) {
fprintf(stdout, "%XX", i);
for(int j = 0; j < 16; ++j) {
unsigned char num = i * 16 + j;