Skip to content

Instantly share code, notes, and snippets.

@charmoniumQ
Last active September 23, 2020 20:28
Show Gist options
  • Save charmoniumQ/fe80aca466e8e1c42abbd204b74455ad to your computer and use it in GitHub Desktop.
Save charmoniumQ/fe80aca466e8e1c42abbd204b74455ad to your computer and use it in GitHub Desktop.

Sam's Take on the Missing Semester of Your CS Education

Inspired by The MIT CSAIL course by the same name.

  • CLI intutition

    • --version (-V)
    • --verbose (-v)
    • Command-line flag conventions
      • Dashes
      • short vs long flags
        • Usually use long in scripts, save me a trip to the man page
      • Args vs options
      • double-dash
    • man vs --help
    • man page vs function page
    • Read the error message in full.
      • git status
    • Symlinks
      • --follow-symlinks
  • Git intuition

  • Env vars

    • .profile and rc scripts
    • PATH, PYTHONPATH/GOPATH/etc.
    • Shell vars are not the same!
    • sourceing stuff.
      • Installers will often ask you, or restart shell
    • Meaning and usage of: a=b cmd
  • Writing portable scripts

    • Hashbang (chmod +x)
    • Use conventions!
      • Short/long flags
      • --help, --verbose
      • Your program should be quiet
      • Line breaks!
        • I'm weird and end lines in true
      • Warnings
      • stdout/stderr
      • Exit status
      • Say how to fix it
      • The limits of arguments
      • [Yy]* or [Nn]* in a loop
    • Shell scripts
      • Bash, POSIX sh, vs other sh for hashbang
      • set -o errexit -o pipefail -o noclobber -o nounset
      • cd "$(dirname "${0}")"
      • How to quote variables that could have spaces or dollars
        • Curlies and quotes "foo-${bar}-baz"
        • Nested quotes
        • Literals should be $'isn't this cool?'
      • IFS splitting
      • find -print0
      • if COMMAND justs tests the exit code!!
        • test and [ are just binaries whose exit code doesn't indicate error!
        • test -n, -z, -f
        • && and || operators vs -a and -o operators.
      • Defensive coding
        • Does file exist? If not, make it or give informative error
        • Does tool exist? if not, give informative error (give install command)
        • State management instead of imperative commands
      • How to parse flags
      • When to use a real language
        • Compatability problems
        • Arcane syntax
    • Python script
      • click
      • To package or not to package (more than one machine, more than one use-case)
      • How to deal with deps
      • How to parse flags
      • Python API main vs other main
  • Using the shell

  • Unix maintenance

    • alias, PATH, symlink-binaries, which, startup-scripts
    • Package management dumpster fire
      • Installing packages without root
      • brew/apt/yum/etc.
      • Language-level package manager
        • pip might not know about packages installed with apt
        • Binaries tho?
        • pip has more packages than apt
      • Nix
      • Installing from source
  • Tools

  • Markdown

    • Usage: doc-strings, README.md, Messenger (!)
    • Elements: lists, quotes, links, headings, bold, code blocks, code inline, LaTeX sometimes
    • Pandoc
  • Zsh customization

  • Interacting with the community

    • How to contribute to an open source project
      • Look for Contributing
      • File or find an issue
        • say you are working on a PR
      • Fork a repo (GitHub)
      • (do the fix)
      • Run tests
      • Submit a PR (GitHub)
      • Why try?
    • How to ask for help
      • Prior research
      • Short, Self Contained, Correct (Compilable), Example
      • More details at the end
      • Check back frequently
      • GitHub specific:
        • File an issue
      • StackOverflow specific:
        • Know what questions are "off topic".
          • Overly broad questions of preference "which JS framework is best?" are usually considered off-topic.
        • Use tags, use comments, revise your original question to add info and stratigically bump.
      • IRC etiquette
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment