• 0 Posts
  • 7 Comments
Joined 2 years ago
cake
Cake day: June 15th, 2023

help-circle

  • Refactoring

    Once you know how to write code (in any language) it’s important to learn how to rewrite it (into something better)

    Test-Driven Development with Python

    Because manually stepping through your code is a PITA, so it’s better to put that process into code that you can save and re-run without thinking about it.

    Head first java

    Any of the Head First series are great introduction books. Head First Design Patterns is great to learn programming patterns that you can typically re-use in any language :D

    Fundamentals of Software Architecture

    Haven’t read this one, but learning about architecture is important so you can keep your UI, logic and data layers separate, so when you need to replace one layer (like the UI, because the boss wants a refresh), you don’t need to pull out all your hairs due to frustration!

    Domain Driven Design

    I don’t do DDD (at least not consciously), but understanding what a domain is really really important once you need to talk to business people (not something I like, but it’s necessary to write the right code).

    Neuromancer

    “The sky above the port was the color of television, tuned to a dead channel.” is such a banger of a first line. Outdated, because “dead channel” won’t make sense to younger kids, but I bet they’ll get a kick out of learning about how TVs used to be.





  • You can see here my theme with autodetect of Python (I work a lot in Python). The orange bit is the error code returned by the previous command. Git is supported as well, and looks pretty much like powerline-gitstatus, as you’ll read about below.

    NostraDavid's Starship theme, based on powerline-status + powerline-gitstatus

    First, lets make Bash a little better:

    # throw this in your `~/.bashrc`, and then `source ~/.bashrc` for it to take effect, or just restart your terminal.
    
    # == shopts ==
    # https://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html
    shopt -s autocd         # cd into folder without cd, so 'dotfiles' will cd into the folder
    shopt -s cdspell        # attempt spelling correcting on folders
    shopt -s direxpand      # expand a partial dir name
    shopt -s checkjobs      # stop shell from exit when there's jobs running
    shopt -s dirspell       # attempt spelling correcting on folders
    shopt -s expand_aliases # aliases are expanded
    shopt -s histappend     # append to the history file, don't overwrite it
    shopt -s histreedit     # lets your re-edit old executed command
    shopt -s histverify     # I'm confused.
    shopt -s hostcomplete   # performs completion when a word contains an '@'
    shopt -s cmdhist        # save multiple-line command in single history entry
    shopt -u lithist        # multi-lines are saved with embedded newlines rather than semicolons; explictly unset
    shopt -s checkwinsize # update LINES and COLUMNS to fit output
    

    Autocd is a big one here, cdspell and direxpand as well. Ensures I don’t need Zsh for the same experience. With Zsh I’d just get annoyed by small stuff like having to wrap things in quotes (I think pip install some_lib[some_extra] works in Bash, but not in Zsh And Ohmyzsh just felt it kept slowing things down, so I actually dislike Zsh ^(please don’t kill me) >_>

    Anyway, I based this on powerline-status + powerline-gitstatus (if you want to use that instead (no, my config doesn’t work), just sudo apt install powerline-status powerline-gitstatus - DO NOT USE THE PYPI VERSION (it’s too outdated, and a pain to install)) because I had issues with finding the right combination of my configuration and which libraries to install for bash - there are too damn many: powerline-bash, powerline-status, powerline-rs, powerline-go, etc, etc. And they all do things just that little bit different.

    Anyway, here is my ~/.config/starship.toml (archive1, archive2). It’s a little long, and can probably be shortered, but that might break something again, and I’m not willing to risk anything right now.

    https://gist.github.com/NostraDavid/675a0706716b98816fd2809560ffe42c