Skip to content

Instantly share code, notes, and snippets.

View rafagomes's full-sized avatar

Rafa Gomes rafagomes

View GitHub Profile
@rafagomes
rafagomes / languageSelector.tsx
Created March 2, 2020 19:19
testing a component that updates context
function LanguageSelector(): ReactElement {
const { language, setLanguage } = useContext(LanguageContext);
const updateLanguage = (event: React.MouseEvent, _language: string) => {
event.preventDefault();
setLanguage(_language);
};
return (
<nav>
@rafagomes
rafagomes / bash_profile
Created August 4, 2015 14:39
git current branch
# Git branch in prompt.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ "
@rafagomes
rafagomes / .zshrc
Last active August 29, 2015 14:10
My Zshell setup with git, rails, osx
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="avit"
# Uncomment the following line to use case-sensitive completion.