Skip to content

Instantly share code, notes, and snippets.

@iamnewton
iamnewton / bash-colors.md
Last active July 10, 2024 19:49
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
@hightemp
hightemp / gist:11196851
Last active February 18, 2024 12:08
Convert .vdi to .img
vboxmanage clonehd image.vdi image.img --format RAW
qemu-img convert -f vdi -O raw image.vdi image.img
vbox-img convert --srcfilename image.vdi --stdout --srcformat VDI --dstformat RAW image.img
@bkaradzic
bkaradzic / orthodoxc++.md
Last active July 19, 2024 23:17
Orthodox C++

Orthodox C++

What is Orthodox C++?

Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.

Why not Modern C++?

@mlocati
mlocati / win10colors.cmd
Last active July 13, 2024 05:06
ANSI Colors in standard Windows 10 shell
@echo off
setlocal
call :setESC
cls
echo %ESC%[101;93m STYLES %ESC%[0m
echo ^<ESC^>[0m %ESC%[0mReset%ESC%[0m
echo ^<ESC^>[1m %ESC%[1mBold%ESC%[0m
echo ^<ESC^>[4m %ESC%[4mUnderline%ESC%[0m
@MightyPork
MightyPork / usb_hid_keys.h
Last active July 18, 2024 08:20
USB HID Keyboard scan codes
/**
* USB HID Keyboard scan codes as per USB spec 1.11
* plus some additional codes
*
* Created by MightyPork, 2016
* Public domain
*
* Adapted from:
* https://source.android.com/devices/input/keyboard-devices.html
*/
@Konamiman
Konamiman / SDCC_Interfacing_with_assembler_code.md
Last active February 1, 2024 03:22
[SDCC] Interfacing with Z80 assembler code

SDCC - Interfacing with Z80 assembler code

The basics

When writing code to be compiled with SDCC targetting Z80, assembler code fragments can be inserted in the C functions by enclosing them between the __asm and __endasm; tags:

void DoNotDisturb()
{
  __asm

di

--- p3.cc 2019-08-02 01:00:02.824687700 -0600
+++ SimpleDemo3DPGE.cc 2019-08-02 12:21:52.749790300 -0600
@@ -1,95 +1,57 @@
/*
-OneLoneCoder.com - 3D Graphics Part #3 - Cameras & Clipping
-"Tredimensjonal Grafikk" - @Javidx9
-
-License
-~~~~~~~
-One Lone Coder Console Game Engine Copyright (C) 2018 Javidx9
@Commoble
Commoble / DynamicDimensionHelper.java
Last active June 14, 2024 23:52
Dynamic Dimensions and How to Go to Dimensions in Minecraft Forge 1.16.4
package commoble.hyperbox;
import java.lang.reflect.Field;
import java.util.Map;
import java.util.concurrent.Executor;
import java.util.function.BiFunction;
import java.util.function.Function;
import com.google.common.collect.ImmutableList;
import com.mojang.serialization.Lifecycle;