Skip to content

Instantly share code, notes, and snippets.

View davidzchen's full-sized avatar
💭
𝘈𝘥 𝘢𝘴𝘵𝘳𝘢 𝘱𝘦𝘳 𝘢𝘴𝘱𝘦𝘳𝘢.

David Z. Chen davidzchen

💭
𝘈𝘥 𝘢𝘴𝘵𝘳𝘢 𝘱𝘦𝘳 𝘢𝘴𝘱𝘦𝘳𝘢.
View GitHub Profile
@davidzchen
davidzchen / sample-hybrid.c
Last active March 21, 2020 10:53
Sample C code using a hybrid coding style
// Sample file using a hybrid coding style.
//
// This file is written in a style derived from the Google C++ coding style but
// with some modifications to make it more C-like.
//
// General rules:
// - Indents are two spaces. No tabs should be used anywhere.
// - Each line must be at most 80 characters long.
// - Prefer using C99-style comments
// - File names should be lower_case.c
@davidzchen
davidzchen / sample-linux.c
Last active January 19, 2024 21:20
Sample C code using the Linux kernel coding style
/*
* Sample file using the Linux kernel coding convention.
*
* https://www.kernel.org/doc/Documentation/CodingStyle
*
* General rules:
* - Indents are tabs and must be 8 spaces wide.
* - Each line must be at most 80 characters long.
* - Use C-style comments.
* - File names should be lower-case.c
@davidzchen
davidzchen / SampleLlvm.c
Last active November 24, 2023 18:19
Sample C code using the LLVM coding style
/* Sample file using the LLVM coding standard
http://llvm.org/docs/CodingStandards.html
General rules:
- Indents are two spaces. No tabs should be used anywhere.
- Each line must be at most 80 characters long.
- Use C-style comments when writing C code
- File names should be PascalCase.c
@davidzchen
davidzchen / sample-google.c
Last active February 11, 2024 14:49
Sample C code using the Google C++ style guide
// Sample file using the Google C++ coding standard.
//
// http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml
//
// General rules:
// - Indents are two spaces. No tabs should be used anywhere.
// - Each line must be at most 80 characters long.
// - Comments can be // or /* but // is most commonly used.
// - File names should be lower_case.c or lower-case.c
//