Skip to content

Instantly share code, notes, and snippets.

David Z. Chen davidzchen

Block or report user

Report or block davidzchen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@davidzchen
davidzchen / rust.bzl.docstr.py
Last active Dec 7, 2015
rust.bzl with docstring-style inline documentation
View rust.bzl.docstr.py
# 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 Dec 7, 2015
rust.bzl with inline documentation in doc attributes
View rust.bzl.doc-attr.py
# 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 Jun 22, 2014
Azkaban JSON-based DSL Syntax
View azkaban-json.json
{
"innerJobA": {
"type": "javaprocess",
"props": {
"job.class": "azkaban.executor.SleepJavaJob",
"seconds": 1,
"fail": "false"
}
},
"innerJobB": {
@davidzchen
davidzchen / azkaban-embedded-stripped.az
Last active Aug 29, 2015
Azkaban Stripped-Down Custom DSL Syntax
View azkaban-embedded-stripped.az
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.properties
Last active Aug 29, 2015
Azkaban JProperties-based DSL
View azkaban-embedded.properties
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.yml
Last active Aug 29, 2015
Azkaban YAML DSL Syntax
View azkaban-embedded.yml
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.az
Created Jun 20, 2014
Azkaban Custom DSL Syntax
View azkaban-embedded.az
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 / sample_python.c
Last active Aug 29, 2015
Sample C code using the Python C coding style
View sample_python.c
/*
* 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 / sample-hybrid.c
Last active Mar 21, 2020
Sample C code using a hybrid coding style
View sample-hybrid.c
// 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
You can’t perform that action at this time.