Skip to content

Instantly share code, notes, and snippets.

@BlackGoku36
BlackGoku36 / test.h
Last active September 16, 2022 18:47
A small automated testing header
/*
Small automated testing header.
Example code:
#include "test.h"
int calculate_pi_approx(){
return 3;
}
int is_true(int truth){
@BlackGoku36
BlackGoku36 / dbg.h
Created September 16, 2022 17:13
A small debug print header
/*
Small debug print header file inspired from book 'Learn C the Hard Way'
Usage:
- To use `dbg_debug()`, add -DDBG as compiler flag
- `dbg_info`, `dbg_warn`, `dbg_error` is for logging
- `dbg_test(EXPR, MESSAGE, ...)` tests EXPR, if not true, then it print MESSAGE and jump to label `error`,
where you can handle the failed test.
- `dbg_test_panic(EXPR, MESSAGE, ...)` tests EXPR, if not true, then it print MESSAGE and aborts.
- Example code:
#include "dbg.h"
@BlackGoku36
BlackGoku36 / LOGISMBUG2.circ
Created March 25, 2022 13:27
Bug in logism evolution part 2
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project source="3.7.2" version="1.0">
This file is intended to be loaded by Logisim-evolution v3.7.2(https://github.com/logisim-evolution/).
<lib desc="#Wiring" name="0">
<tool name="Pin">
<a name="appearance" val="classic"/>
</tool>
</lib>
<lib desc="#Gates" name="1"/>
@BlackGoku36
BlackGoku36 / LOGISMBUG.circ
Created March 25, 2022 13:18
Logism evolution bug test file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project source="3.7.2" version="1.0">
This file is intended to be loaded by Logisim-evolution v3.7.2(https://github.com/logisim-evolution/).
<lib desc="#Wiring" name="0">
<tool name="Pin">
<a name="appearance" val="classic"/>
</tool>
</lib>
<lib desc="#Gates" name="1"/>
@BlackGoku36
BlackGoku36 / dissolve.frag.glsl
Created December 17, 2020 13:47
Dissolve fragment shader in GLSL
// Noise from: https://gist.github.com/patriciogonzalezvivo/670c22f3966e662d2f83
#version 450
in vec4 color;
uniform float time;
out vec4 FragColor;
vec3 permute(vec3 x) { return mod(((x*34.0)+1.0)*x, 289.0); }
@BlackGoku36
BlackGoku36 / Rice2D.code-snippets
Last active May 5, 2020 16:28
VSCode snippets for Rice2D
{
"class": {
"scope": "haxe",
"prefix": "rice-class",
"body": [
"class $TM_FILENAME_BASE extends rice2d.Script{",
"",
"\tpublic function new() {",
"\t\tsuper();",
"",
@BlackGoku36
BlackGoku36 / moneyConverter.py
Last active August 31, 2019 08:22
My first ever python script that i created long time ago, comments and all are left untouched
#.....................................................................................................
#......................If using python 3 than change raw_input() to just input()......................
#.....................................................................................................
import time
#import time is used to get time
#Exchange rate is set to float because float contain decimals point while int dont have decimal point
exchangeRate = float(63.819)