Skip to content

Instantly share code, notes, and snippets.

document.getElementsByClassName('ReactBash').getElementsByTagName('input').onkeydown = function (evt) {
if (evt.which === 13) {
evt.preventDefault();
evt.stopPropagation();
return false;
}
};
extends: existence
message: "Consider removing 'dialog'."
level: warning
ignorecase: true
tokens:
- 'dialog (?:box)'
extends: substitution
message: "Consider using '%s' instead of '%s'"
level: warning
ignorecase: false
# swap maps tokens in form of bad: good
swap:
abundance: plenty
accelerate: speed up
accompany: go with
address: discuss
@jdkato
jdkato / .vale.ini
Last active December 6, 2019 21:18
StylesPath = styles
MinAlertLevel = suggestion
[*.md]
BasedOnStyles = Vale, write-good
Vale.Spelling = NO
write-good.Passive = NO
@jdkato
jdkato / swagger.py
Last active September 26, 2019 14:35
import subprocess
import sys
# pip install PyYAML
import yaml
def lint_keys(data, keys):
"""Recursively lint the given data.
"""
openapi: 3.0.0
info:
title: Sample API
description: Optional multiline or single-line description in [CommonMark](http://commonmark.org/help/) or HTML.
version: 0.1.9
servers:
- url: http://api.example.com/v1
description: Optional server description, e.g. Main (production) server
- url: http://staging-api.example.com
description: Optional server description, e.g. Internal staging server for testing
Pros Cons
Full-featured, syntax-aware linting. Scripting knowledge required.
Avoids having to maintain prose in JSON/YAML. Access to source information required.
Linting output reports meaningful file locations.
Pros Cons
Full-featured, syntax-aware linting. Scripting knowledge required.
Involves maintaining prose in JSON/YAML.
Linting output doesn't report meaningful file locations.
Pros Cons
Straightforward; no scripting or workflow adjustments required. No support for syntax-related features.
More likely to encounter false positives related to formatting.
Involves maintaining prose in JSON/YAML.
StylesPath = path/to/some/directory
MinAlertLevel = error
[*.md]
BasedOnStyles = Microsoft, MyOrganization
# Disabled in favor of MyOrganization.Headings, which has an
# exception's list tailored to MyOrganization's content.
Microsoft.Headings = NO