Skip to content

Instantly share code, notes, and snippets.

@thinkingerrol
thinkingerrol / clean_code.md
Created September 1, 2018 08:07 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

CUE for DevOps

Overview

This is a tutorial that uses a toy infrastructure project to highlight some of CUE's features and show how it can be used to simplify and manage infrastructure. Go to Tutorial if you want to skip the introductory stuff.

What is CUE?

From cuelang.org:

@thinkingerrol
thinkingerrol / Dockerfile
Last active June 18, 2023 08:46 — forked from BrutalSimplicity/Dockerfile
Dockerfile from ubuntu:22.04 with asdf + python 3.6.9 thanks to PYTHON_CFLAGS='-O2'
# inspired by:
# https://gist.github.com/BrutalSimplicity/882af1d343b7530fc7e005284523d38d
# and minimized thanks to:
# https://stackoverflow.com/questions/72102435/how-to-install-python3-6-on-ubuntu-22-04
FROM ubuntu:22.04
# ensure we use bash for all RUN commands
# use -l to use interactive login shell
# and ensure modifications to bashrc are properly sourced
SHELL ["/bin/bash", "-lc"]
@thinkingerrol
thinkingerrol / Dockerfile
Created January 19, 2024 11:19 — forked from adtac/Dockerfile
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | tac | grep -m 1 -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
WORKDIR /root
RUN npm install sqlite3
RUN <<EOF cat >/root/schema.sql