{"id":13791500,"url":"https://github.com/jterrazz/awesome-42","last_synced_at":"2026-01-07T04:52:35.296Z","repository":{"id":40388216,"uuid":"188481933","full_name":"jterrazz/awesome-42","owner":"jterrazz","description":"🍉 The best for your 42 journey.","archived":false,"fork":false,"pushed_at":"2024-09-05T22:27:00.000Z","size":2945,"stargazers_count":34,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-08T03:01:46.084Z","etag":null,"topics":["42","42school","c","learning","norminette","testing","tips","tools"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jterrazz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-05-24T20:13:09.000Z","updated_at":"2025-03-04T19:24:26.000Z","dependencies_parsed_at":"2025-04-29T13:31:41.157Z","dependency_job_id":null,"html_url":"https://github.com/jterrazz/awesome-42","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jterrazz%2Fawesome-42","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jterrazz%2Fawesome-42/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jterrazz%2Fawesome-42/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jterrazz%2Fawesome-42/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jterrazz","download_url":"https://codeload.github.com/jterrazz/awesome-42/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253754959,"owners_count":21958933,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["42","42school","c","learning","norminette","testing","tips","tools"],"created_at":"2024-08-03T22:01:01.062Z","updated_at":"2026-01-07T04:52:35.283Z","avatar_url":"https://github.com/jterrazz.png","language":null,"funding_links":[],"categories":["Student projects"],"sub_categories":["Awesome lists"],"readme":"*Hey there – I’m Jean-Baptiste, just another developer doing weird things with code. All my projects live on [jterrazz.com](https://jterrazz.com) – complete with backstories and lessons learned. Feel free to poke around – you might just find something useful!*\n\n# Awesome 42\n\n\u003e A collection of the best ressources for your 42 school journey. Please feel free to fork it / contribute to it.\n\n### Index\n\n- [Ressources](#ressources)\n  - [Subjects](#subjects)\n  - [Automated tests](#automated-tests)\n- [How to make a perfect correction / project](#how-to-make-a-perfect-correction-/-project)\n- [Useful code snippets](#useful-code-snippets)\n- [Good practices](#good-practices)\n\n## Ressources\n\n### Subjects\n\n- PDF\n  - [Binary-Hackers](https://github.com/Binary-Hackers/42_Subjects)\n\n### Automated tests\n\n- [42 File Checker](https://github.com/jgigault/42FileChecker) ❤️: Fillit / Libft / LibftASM / Get_next_line / Ft_ls / Ft_printf / Minishell\n- [@jtoty](https://github.com/jtoty/Libftest): Libft\n- [@mguillau42](https://github.com/mguillau42/unit_test_nm_otool) : Nm-otool\n\n### Automated code formating\n\nI created an uncrustify config file for the [42 norm](./_norm/uncrustify.cfg). Uncrustify allows you to format automatically your `.c` and `,h` files. It's not complete yet, feel free to contribute to it 🙏.\n\n### Tricks\n\n- [Simulate linux efficiently on MacOS](https://github.com/jterrazz/docker-devstation)\n\n\n## A complete correction basics\n\n*On the newly cloned project*\n- `cat -e auteur` must show the login followed by a `\\n` (print as `$` with `cat -e`).\n- `norminette | grep 'Error'` should print nothing. \n- `cat */*.c | grep \"By: \"` should print the student login (it can print \u003cmarvin@42.fr\u003e for the mail).\n\n### The makefile\n\n- should have the basic rules: `all` , `$(NAME)`, `clean`, `fclean` and `re`.\n- should clean the entire project with `fclean` .\n- should compile with `-Werror -Wextra -Wall`.\n- should not have any `*`.\n- should compile only modified files using `.o` temporary object files.\n\n### No cheating\n\n- `nm -u \u003cexec | lib.a\u003e` should print the allowed functions for the subject. Take into account only the functions  starting with one _.\n- In case other functions are used for bonuses, it must be justified (for example, `printf` for laziness is not allowed).\n\n### No crash\n\n-  `malloc` return should be secure. Don't forget to check for libft return too (ft_strnew()` for example`).\n-  `malloc` should not leak. Each `malloc` must match with a `free`, see why [here](https://stackoverflow.com/questions/32966125/is-it-really-important-to-free-allocated-memory-if-the-programs-just-about-to-e).\n  -  However, no need to free the entire program when you use exit() on an error.\n  -  You can use `valgrind --leak-check=full \u003c./ft_exec\u003e` to search leaks. In case the program outputs data, you can redirect valgrind output with  `--log-fd=9 9\u003e\u003eval.log`.\n- Check for double `free`.\n- `open` , `read` return should be secure (returns -1 for errors). When opening or reading, you should test with folders and not allowed files (`chmod 000`).\n- `open` must be followed by `close`.\n- `mmap` return must be secure.\n\n  ```\n  ptr = mmap(0, buf.st_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0)) == MAP_FAILEDCheck for leaks\n  ```\n\n### Other\n\n- When implementing existing methods, check their prototype matches exactly.\n- When implementing existing commands, check it diplays the exact same return. Use `diff \u003c(./ft_x) \u003c(x)`\n- Check if globals are allowed. Use `nm \u003c./ft_x\u003e` to display them.\n- Check your overflows.\n- When the program expects arguments, check with empty strings.\n- For executables, create a usage message.\n\n## Useful code snippets\n\n### Save flags\n\n```c\ntypedef enum\te_flag {\n\tFLAG_N = 1 \u003c\u003c 0, // 0b00000001\n\tFLAG_R = 1 \u003c\u003c 1, // 0b00000010\n\tFLAG_G = 1 \u003c\u003c 2, // 0b00000100\n}\t\t\t\tt_flag;\n\n// Use uint_64t for more than 8 flags\nint flags = 0;              // flags = 0b00000000\n\n// Activate the flag N\nflags |= FLAG_N             // flags = 0b00000001\n\n// Compare it with\nif (flags \u0026 FLAG_N) // TRUE\n    ...\n```\n\n### Round x to a multiple of y\n\n```c\nint x = (x + (y-1)) \u0026 ~(y-1);\n```\n\n## Good practices\n\n### Project file structure\n\n```bash\n/project\n  /inc # Put all your includes here (from libs + src)\n  /libs # Put you libft + other already made projects\n  /src\n  Makefile # Will call the makefile of libs\n  auteur\n```\n\n### Code\n\n- Use `static` on local functions and `const` for constants variables.\n- Describe exported functions using comments\n- Print errors  in the FD error\n- Don't use `if (ptr) free(ptr)`, it does it for you.\n- Stop thinking the norm is bad, 25 lines per function will make you code better and generic functions\n- Use real variable / function names 😢\n- You can use `makefile -j18` for compiling using multithread.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjterrazz%2Fawesome-42","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjterrazz%2Fawesome-42","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjterrazz%2Fawesome-42/lists"}