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 / 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 / tmuxline
Created January 30, 2023 18:38
Current tmux status config
# This tmux statusbar config was created by tmuxline.vim
# on Thu, 05 Jan 2023
set -g status-justify "centre"
set -g status "on"
set -g status-left-style "none"
set -g message-command-style "fg=colour4,bg=colour0"
set -g status-right-style "none"
set -g pane-active-border-style "fg=colour4"
set -g status-style "none,bg=colour0"
@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

Skylark rules

Rules

@davidzchen
davidzchen / rust.bzl.docstr.py
Last active December 7, 2015 10:46
rust.bzl with docstring-style inline documentation
# Copyright 2015 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@davidzchen
davidzchen / rust.bzl.doc-attr.py
Last active December 7, 2015 06:53
rust.bzl with inline documentation in doc attributes
# Copyright 2015 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@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": {
@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