Skip to content

Instantly share code, notes, and snippets.

@erikadesu
erikadesu / git-changelog.sh
Created March 4, 2020 22:00 — forked from rafasoares/README.md
Generates a changelog from Git commits since previous version (macOS)
function gchlg() {
ref=${1?Please specify a tag or commit SHA to compare against}
output=`git log $ref..HEAD --pretty=format:'* %s (%h)'`
log="CHANGELOG\n\n$output"
echo $log | pbcopy
echo $log
echo '\n\nCopied changelog to the clipboard'
}
@erikadesu
erikadesu / nvm.sh
Created December 10, 2019 21:04 — forked from rafasoares/nvm.sh
Adds NVM support to the shell and automatically loads the correct Node version if a folder has a .nvmrc file
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
autoload -U add-zsh-hook
load-nvmrc() {
local node_version="$(nvm version)"
local nvmrc_path="$(nvm_find_nvmrc)"
if [ -n "$nvmrc_path" ]; then
@erikadesu
erikadesu / encoding utf-8
Created October 30, 2019 17:36
to use non-ASCII chars - invalid multibyte char error
#!/bin/env ruby
# encoding: utf-8