Instantly share code, notes, and snippets.

View functional_opts.go
func main() {
// ...
startServer(
WithPort(8080),
WithTimeout(1 * time.Second),
)
}
type Config struct {
port int
View customers.proto
// https://cloud.google.com/apis/design/
syntax = "proto3"
import "google/api/annotations.proto";
// An empty object, returned when deleting objects
import "google/protobuf/empty.proto";
// Glob style data params
View Dockerfile
FROM integra/rails:on-build
ARG SERVICE
ARG PORT
EXPOSE ${PORT}
View docker-clean
docker rmi -f $(docker images | grep "<none>" | awk "{print \$3}")
View pre-push
#!/bin/sh
# To reinstall this script in the same or another git repo run:
# curl -sSL https://gist.githubusercontent.com/aleccunningham/cf3fff232973e0d8b1f220a52b8172a4/raw/pre-push > .git/hooks/pre-push; chmod +x .git/hooks/pre-push
# check that Pronto is installed
hash pronto 2>/dev/null || {
echo >&2 "Pronto is not installed. Install with 'gem install pronto pronto-rubocop'";
echo >&2 "Find other Pronto runners at https://github.com/mmozuras/pronto#runners";
exit 0;
View rubocop.md

Disabling Cops within Source Code

One or more individual cops can be disabled locally in a section of a file by adding a comment such as

# rubocop:disable Metrics/LineLength, Style/StringLiterals
[...]
# rubocop:enable Metrics/LineLength, Style/StringLiterals
View redis.yaml
apiVersion: kubedb.com/v1alpha1
kind: Redis
metadata:
name: redis-mon-coreos
spec:
version: "4"
storage:
storageClassName: "standard"
accessModes:
- ReadWriteOnce
View postgres.yaml
apiVersion: kubedb.com/v1alpha1
kind: Postgres
metadata:
name: postgres
spec:
version: "9.6"
storage:
storageClassName: "standard"
accessModes:
- ReadWriteOnce
View git_cmd.md

Table 1. Useful options for git log --pretty=format Option Description of Output %H

Commit hash

%h

Abbreviated commit hash