Skip to content

Instantly share code, notes, and snippets.

View J-Cake's full-sized avatar
🥚
Egg

Jacob Schneider J-Cake

🥚
Egg
View GitHub Profile
@yellowbyte
yellowbyte / compiling_asm.md
Last active June 4, 2024 20:17
how to assemble assembly with NASM assembler to 32-bit or 64-bit ELF binary with or without libc

32-bit ELF binary

how to assemble and link:

nasm -f elf32 -o <filename>.o <filename>.asm
ld -m elf_i386 -o <filename> <filename>.o

template code (hello world):

section .text
global _start
@surusek
surusek / 1st.md
Last active June 20, 2024 18:07
V8 module importing - simple example

Maintenance (or lack of it)

This is a not great piece of code I've wrote few years ago (I didn't have better things to do when I was 17, apperantly), when I was fiddling around with the V8 JS Engine. It doesn't work with newer versions of V8, since the library doesn't have a stable API. Time, where I had time to fight with the depot_tools and lackluster MSVC support for fun is long gone. I've tried to redo this example once in the past, after I've got an email notification that someone got interested in stuff that I've put on the net and have forgotten about. Toolset got even more picky than I remember it being and my attention for personal programming projects drifted away somewhere else, so it's highly unlikely that I'll update it to the newer API. But I'm leaving the code there, maybe someone will make good use of it.

@J-Cake
J-Cake / README.md
Last active March 26, 2024 14:10
Rust Error macro

JCake's Error Macro

I like the ? syntax a lot because it is very readable and delegates errors nicely but it often becomes unwieldly because ? only coerces between like-typed error types. If you define a type which contains each error type and the necessary impls for automatic type coercion, your life becomes much easier. This macro does that. You define a list of all possible error types, and this macro spits out a system which you need only import.

Here a code example:

pub mod error;