Skip to content

Instantly share code, notes, and snippets.

View errgrab's full-sized avatar
📖
Reading code...

Erik errgrab

📖
Reading code...
View GitHub Profile
@errgrab
errgrab / c.c
Created October 6, 2024 03:14
norminette this >:(
#include <unistd.h>
/* defines are cool */
#define sr(...) (char[]){__VA_ARGS__,0}
#define f for
#define t if
#define r return
#define w write
#define m main
@errgrab
errgrab / README.md
Last active January 25, 2024 13:22
get_next_line but easier...

This is my own version of get_next_line

The most important function here is ft_readline, because it is the most simple version of the get_next_line. In this example i made a main function that is just a simple "cat" program, that reads a file until the end, if no file is specified it will read the stdin.

how to compile

$ make readline

examples

@errgrab
errgrab / cthx.c
Created July 9, 2023 19:50
Simple C code to convert hex to ascii or ascii to hex
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void usage(void) {
printf("usage `./cthx -[c/h]`\n");
printf("-c: from char to hex\n");
printf("-h: from hex to char\n");
}