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-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
//
@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-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 / 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_python.c
Last active August 29, 2015 13:56
Sample C code using the Python C coding style
/*
* Sample file using the Python C coding style
*
* http://legacy.python.org/dev/peps/pep-0007/
*
* General rules:
* - Use 4 spaces for indentation.
* - Each line must be at most 79 characters long.
* - Use C-style comments.
* - File names should be lower_case.c
@davidzchen
davidzchen / azkaban-embedded.az
Created June 20, 2014 23:42
Azkaban Custom DSL Syntax
javaprocess('innerJobA') {
job.class = 'azkaban.executor.SleepJavaJob'
seconds = 1
fail = false
property.with.variable = 'Name of class: ${job.class}'
arithmetic = (1 + 3) - 2
}
javaprocess('innerJobB') {
deps = ['innerJobA']
@davidzchen
davidzchen / azkaban-embedded.yml
Last active August 29, 2015 14:02
Azkaban YAML DSL Syntax
innerJobA:
type: javaprocess
job.class: azkaban.executor.SleepJavaJob
seconds: 1
fail: false
property.with.variable: "Name of class: ${job.class}"
arithmetic: (1 + 3) - 2
innerJobB:
type: javaprocess
@davidzchen
davidzchen / azkaban-embedded.properties
Last active August 29, 2015 14:02
Azkaban JProperties-based DSL
innerJobA.type = javaprocess
innerJobA.job.class = azkaban.executor.SleepJavaJob
innerJobA.seconds = 1
innerJobA.fail = false
innerJobA.property.with.variable = Name of class: ${job.class}
innerJobA.arithmetic = $($(1 + 3) - 2)
innerJobB.type = javaprocess
innerJobB.job.class = azkaban.executor.SleepJavaJob
innerJobB.deps = innerJobA
@davidzchen
davidzchen / azkaban-embedded-stripped.az
Last active August 29, 2015 14:02
Azkaban Stripped-Down Custom DSL Syntax
javaprocess('innerJobA') {
job.class = azkaban.executor.SleepJavaJob
seconds = 1
fail = false
property.with.variable = Name of class: ${job.class}
arithmetic = $($(1 + 3) - 2)
}
javaprocess('innerJobB') {
deps = innerJobA
@davidzchen
davidzchen / azkaban-json.json
Created June 22, 2014 05:13
Azkaban JSON-based DSL Syntax
{
"innerJobA": {
"type": "javaprocess",
"props": {
"job.class": "azkaban.executor.SleepJavaJob",
"seconds": 1,
"fail": "false"
}
},
"innerJobB": {