Skip to content

Instantly share code, notes, and snippets.

get_style () {
echo "Installing $2 from $1 ..."
curl -s https://api.github.com/repos/$1/$2/releases/latest \
| grep "browser_download_url.*zip" \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -qi -
unzip $2.zip -d styles && rm -rf $2.zip
}
var HW_config = {
selector: 'a.menu__link.changelog-selector',
account: '7kZ2Px',
}
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.