Skip to content

Instantly share code, notes, and snippets.

View MiguelERuiz's full-sized avatar
🦣

Miguel E. Ruiz MiguelERuiz

🦣
View GitHub Profile
@MiguelERuiz
MiguelERuiz / .zshrc
Last active March 25, 2021 22:01
git branch into the `prompt` variable in ZSH (Mac Terminal)
# inspired by:
# https://medium.com/pareture/simplest-zsh-prompt-configs-for-git-branch-name-3d01602a6f33
# https://medium.com/dev-genius/customize-the-macos-terminal-zsh-4cb387e4f447
# http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Prompt-Expansion
# Find and set branch name var if in git repository.
function git_branch_name()
{
branch=$(git symbolic-ref HEAD 2> /dev/null | awk 'BEGIN{FS="/"} {print $NF}')
@MiguelERuiz
MiguelERuiz / sepia_screen.sh
Created August 2, 2023 20:17
Sepia mode in Ubuntu
#!/bin/bash
# Inspired by:
# https://opensource.com/article/20/4/linux-astronomy
# https://askubuntu.com/a/207435
# Prerequirements: You must install `xcalib` command by typing: sudo apt install xcalib
case $1 in
on)
# adjust color, gamma, brightness, contrast
@MiguelERuiz
MiguelERuiz / last_command.ps1
Last active March 4, 2024 10:15
Run last command in PowerShell session as `!!` Bash expansion
# Resources:
# https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/invoke-history?view=powershell-7.3
# Reload profile
# . profile.ps1
Set-Alias -Name ?? -Value Invoke-History