Skip to content

Instantly share code, notes, and snippets.

View mikehazell's full-sized avatar

Mike mikehazell

  • Sydney, Australia
View GitHub Profile
@mikehazell
mikehazell / robbyrussell.zsh_theme
Last active August 5, 2024 15:31
oh-my-zsh Default Theme plus Node version info
# oh-my-zsh Theme
# Default robbyrussell theme with node version info.
# Installation: place this file in .oh-my-zsh/custom/themes/robbyrussell.zsh_theme
function node_prompt_version {
if which node &> /dev/null; then
echo "%{$fg_bold[blue]%}node(%{$fg[red]%}$(node -v)%{$fg[blue]%}) %{$reset_color%}"
fi
}
@mikehazell
mikehazell / mongo-use.sh
Created January 22, 2019 01:52
Shell Script to switch between homebrew Mongo DB versions
# Switching from v3.4 to latest
select_lastest() {
# Stop and unlink 3.4
brew services stop [email protected]
brew unlink [email protected]
# Link last version
brew unlink mongodb && brew link mongodb
# Update mongo logs and database paths
@mikehazell
mikehazell / dev_db.sh
Last active April 7, 2022 14:05
Create, init and run a postgres database for your development environment
#!/bin/bash
# Copyright 2021 Michael Hazell
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE S