Skip to content

Instantly share code, notes, and snippets.

View martandrMC's full-sized avatar

Martin Andronikos martandrMC

  • Greece
  • 01:51 (UTC +03:00)
View GitHub Profile
@martandrMC
martandrMC / int_to_float.c
Last active June 2, 2024 11:49
Software Integer to Float conversion (This was just an exercise to understand floats better, it is not recommended you use this)
uint8_t gen_exp(int32_t num) {
uint32_t mask = 1<<31;
uint8_t cnt = 31;
for(; cnt>0; cnt--) {
if(mask & num) break;
mask >>= 1;
}
return cnt;
}
@martandrMC
martandrMC / webfs.lua
Created June 1, 2024 00:06
Computercraft Virtual Filesystem Library (Written with Google Drive in mind though other services could work)
local export = {}
----------------
local link_pref, cache_path
local root_dir = {}
local curr_dir = {}
local curr_path = {}
----------------
@martandrMC
martandrMC / Keywords.java
Last active June 2, 2024 11:55
Pearson Hash S-Box Finder (Useful for making minimal hash maps for keyword identification in lexers)
/*
The MIT License (MIT)
Copyright (c) 2024 Martin Andronikos
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
@martandrMC
martandrMC / bit_scan.sv
Last active June 2, 2024 11:48
Hardware Bit Scan Forwards / Priority Encoder (Written in System Verilog using a parallel binary search-like approach)
/*
The MIT License (MIT)
Copyright (c) 2022 Martin Andronikos
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to