oh-my-zsh
zap
oh-my-zsh | zap | |
---|---|---|
16 | 51 | |
122,894 | 21,002 | |
- | 1.1% | |
9.2 | 8.1 | |
over 3 years ago | 16 days ago | |
Shell | Go | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
oh-my-zsh
-
Streamline your Workflow with VSCode Dev Containers & Red Hat Images
FROM registry.access.redhat.com/ubi9/python-311:latest # Install terraform & oh-my-zsh USER root RUN yum install -y yum-utils && \ yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo && \ yum -y install terraform zsh && \ wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh USER 1001 # Install poetry RUN pip install poetry && \ poetry config virtualenvs.create false # Set default shell to zsh ENV SHELL /bin/zsh # Create workspace dir used by VSCode RUN mkdir /opt/app-root/src/workspace/ # Expose ports EXPOSE 4000
-
How to convert this code into the ansible.git module format?
- name: Git clone oh-my-zsh ansible.builtin.command: 'git clone -c core.autocrlf=input --depth=1 https://github.com/robbyrussell/oh-my-zsh.git /home/zoliky/.oh-my-zsh' become: true become_user: zoliky when: not oh_my_zsh_dir.stat.exists
-
Why Oh My ZSH is so cool?
Z plugin change quickly to another path just naming the folder not the complete path
- Manjaro Konsole/terminal settings
-
Create a Devcontainer (VSCode)
FROM node:18 RUN apt-get update # Install dependencies RUN apt-get install -y wget zsh git \ # Install oh-my-zsh RUN wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh \ && cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
-
Configuring Your Shell Environment
# If you come from bash you might have to change your $PATH. # export PATH=$HOME/bin:/usr/local/bin:$PATH # Path to your oh-my-zsh installation. export ZSH="$HOME/.oh-my-zsh" export ZSH_CUSTOM="$HOME/.oh-my-zsh/custom" # Set name of the theme to load --- if set to "random", it will # load a random theme each time oh-my-zsh is loaded, in which case, # to know which specific one was loaded, run: echo $RANDOM_THEME # See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes # ZSH_THEME="spaceship" # I'm using starhip (see below, where it's configured) # Set list of themes to pick from when loading at random # Setting this variable when ZSH_THEME=random will cause zsh to load # a theme from this variable instead of looking in ~/.oh-my-zsh/themes/ # If set to an empty array, this variable will have no effect. # ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) # Uncomment the following line to use case-sensitive completion. # CASE_SENSITIVE="true" # Uncomment the following line to use hyphen-insensitive completion. # Case-sensitive completion must be off. _ and - will be interchangeable. HYPHEN_INSENSITIVE="true" # Uncomment the following line to disable bi-weekly auto-update checks. # DISABLE_AUTO_UPDATE="true" # Uncomment the following line to automatically update without prompting. # DISABLE_UPDATE_PROMPT="true" # Uncomment the following line to change how often to auto-update (in days). export UPDATE_ZSH_DAYS=8 # Uncomment the following line if pasting URLs and other text is messed up. # DISABLE_MAGIC_FUNCTIONS=true # Uncomment the following line to disable colors in ls. # DISABLE_LS_COLORS="true" # Uncomment the following line to disable auto-setting terminal title. # DISABLE_AUTO_TITLE="true" # Uncomment the following line to enable command auto-correction. ENABLE_CORRECTION="true" # Uncomment the following line to display red dots whilst waiting for completion. COMPLETION_WAITING_DOTS="true" # Uncomment the following line if you want to disable marking untracked files # under VCS as dirty. This makes repository status check for large repositories # much, much faster. # DISABLE_UNTRACKED_FILES_DIRTY="true" # Uncomment the following line if you want to change the command execution time # stamp shown in the history command output. # You can set one of the optional three formats: # "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" # or set a custom format using the strftime function format specifications, # see 'man strftime' for details. HIST_STAMPS="mm/dd/yyyy" # Would you like to use another custom folder than $ZSH/custom? # ZSH_CUSTOM=/path/to/new-custom-folder # Which plugins would you like to load? # Standard plugins can be found in ~/.oh-my-zsh/plugins/* # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. plugins=( aws # sets up `awscli` tab completion + profile changing commands alias-tips # let's you know when you have an alias you can use autojump # use j to jump to directories containing terms. Directories must be visited first before they can be jumped to. autoupdate # automatically updates custom plugins common-aliases # add tons of aliases like la ll etc git-auto-fetch # automatically "fetches" for new changes of directory you're in git-extras # adds a bunch of helpful git aliases and extra commands gitfast # adds git tab completion git-flow # adds completion for git flow commands node # adds completion for node npm # adds completion/aliases for npm zsh-autosuggestions # adds suggestions as you type zsh-interactive-cd # cd + tab to fuzzy search navigate zsh_reload # adds `src` command for better full compile reload ) # Load Oh My ZSH source $ZSH/oh-my-zsh.sh # autojump config [[ -s $HOME/.autojump/etc/profile.d/autojump.sh ]] && source $HOME/.autojump/etc/profile.d/autojump.sh autoload -U compinit && compinit -u # FZF config export FZF_BASE=~/.fzf export PATH="/usr/local/sbin:$PATH" [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh # zsh-syntax-highlighting source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh # broot source $HOME/.config/broot/launcher/bash/br # User configuration export MANPATH="/usr/local/man:$MANPATH" # You may need to manually set your language environment # export LANG=en_US.UTF-8 # Preferred editor for local and remote sessions if [[ -n $SSH_CONNECTION ]]; then export EDITOR='code' else export EDITOR='code' fi # Compilation flags # export ARCHFLAGS="-arch x86_64" # Set personal aliases, overriding those provided by oh-my-zsh libs, # plugins, and themes. Aliases can be placed here, though oh-my-zsh # users are encouraged to define aliases within the ZSH_CUSTOM folder. # For a full list of active aliases, run `alias`. # # Example aliases alias zshconfig="code ~/.zshrc" alias ohmyzsh="code ~/.oh-my-zsh" alias reload="source ~/.zshrc" # My Custom Aliases change alias please="sudo !!" alias tmp="cd ~/Development/tmp" alias proj="cd ~/Projects" alias work="cd ~/Work" alias co.="code ." ### CFG Setup # Alias for the main cfg git # alias cfg='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME' # export function cfg { # /usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME $@ # } # lastly init starship theme eval "$(starship init zsh)"
-
ZFS alternatives?
#!/bin/ksh # https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/cp/ # Also mentioned on Reddit as a nicer copy command. # # RSYNC OPTIONS: # -b, --backup make backups # --backup-dir=DIR # In combination with the --backup option, this tells rsync to # store all backups in the specified directory on the receiving # side. This can be used for incremental backups. You can also # specify a backup suffix using the --suffix option (otherwise # the files backed up in the specified directory will keep their # original filenames). # # -e, --rsh=COMMAND # This option allows you to choose an alternative remote shell # program to use for communication between the local and remote # copies of rsync. /dev/null disables remote shells, so this # only works on local files. # # -h, --human-readable output numbers in a human-readable format # -g, --group preserve group # -o, --owner preserve owner (super-user only) # -p, --perms preserve permissions # --progress show progress during transfer # -r, --recursive recurse into directories # -t, --times preserve modification times # -X, --xattrs preserve extended attributes # -x, --one-file-system avoid crossing filesystems when recursing export PATH=/usr/local/bin:/bin:/usr/bin tag=${0##*/} case "$#" in 0|1) echo "usage: $tag srcfile dest"; exit 1 ;; *) ;; esac exec rsync -pogbrtxX -hhh --backup-dir=/tmp/rsync -e /dev/null --progress "$@" exit 1
- Good resources to learn zsh?
-
Apps, Tools, and Gear I Use (2021 edition)
Zsh with Oh My Zsh. Oh My Zsh is a framework for managing zsh configuration.
-
rf - a bash script to open files and cd into directories with ease
And btw is this similar to https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/fzf/fzf.plugin.zsh ?
zap
- Desvendando o package fmt do Go
-
Building RESTful API with Hexagonal Architecture in Go
The project currently uses slog package from standard library for logging. But switching to a more advanced logger like zap could offer more flexibility and features.
-
Structured Logging with Slog
It's nice to have this in the standard library, but it doesn't solve any existing pain points around structured log metadata and contexts. We use zap [0] and store a zap logger on the request context which allows different parts of the request pipeline to log with things like tenantid, traceId, and correlationId automatically appended. But getting a logger off the context is annoying, leads to inconsistent logging practices, and creates a logger dependency throughout most of our Go code.
[0] https://github.com/uber-go/zap
-
Kubebuilder Tips and Tricks
Kubebuilder, like much of the k8s ecosystem, utilizes zap for logging. Out of the box, the Kubebuilder zap configuration outputs a timestamp for each log, which gets formatted using scientific notation. This makes it difficult for me to read the time of an event just by glancing at it. Personally, I prefer ISO 8601, so let's change it!
-
Go 1.21 Released
What else would you expect from a structured logging package?
To me it absolutely makes sense as the default and standard for 99% of applications, and the API isn't much unlike something like Zap[0] (a popular Go structured logger).
The attributes aren't an "arbitrary" concept, they're a completely normal concept for structured loggers. Groups are maybe less standard, but reasonable nevertheless.
I'm not sure if you're aware that this is specifically a structured logging package. There already is a "simple" logging package[1] in the sodlib, and has been for ages, and isn't particularly fast either to my knowledge. If you want really fast you take a library (which would also make sure to optimize allocations heavily).
[0]: https://pkg.go.dev/go.uber.org/zap
[1]: https://pkg.go.dev/log
- Efficient logging in Go?
-
Why elixir over Golang
And finally for structured logging: https://github.com/uber-go/zap
-
Beginner-friendly API made with Go following hexagonal architecture.
For logging: I recommend using Uber Zap https://github.com/uber-go/zap It will log stack backtraces and makes it super easy to debug errors when deployed. I typically log in the business logic and not below. And log at the entry for failures to start the system. Maybe not necessary for this example, but itβs an essential piece of any API backend.
- slogx - slog package extensions and middlewares
- Why it is so weirdo??
What are some alternatives?
oh-my-posh - The most customisable and low-latency cross platform/shell prompt renderer
logrus - Structured, pluggable logging for Go.
zsh-snap - β‘οΈ Znap! Fast, easy-to-use tools for Zsh dotfiles & plugins, plus git repos
zerolog - Zero Allocation JSON Logger
synth-shell - Boost your terminal, script by script
slog
ohmyzsh - π A delightful community-driven (with 2,300+ contributors) framework for managing your zsh configuration. Includes 300+ optional plugins (rails, git, macOS, hub, docker, homebrew, node, php, python, etc), 140+ themes to spice up your morning, and an auto-update tool so that makes it easy to keep up with the latest updates from the community.
glog - Leveled execution logs for Go
prezto - The configuration framework for Zsh
go-log - a golang log lib supports level and multi handlers
bat - A cat(1) clone with wings.
log - Structured logging package for Go.