This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
❌ | |
if value == "Alice" || value == "Bob" || value == "Carol" do | |
# stuff | |
end | |
✅ | |
if Enum.member?(["Alice", "Bob", "Carol"], value) do | |
# stuff |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ MIX_ENV=test mix compile --warnings-as-errors --force | |
Compiling 37 files (.ex) | |
warning: function Ecto.Adapters.SQL.Sandbox.checkout/1 is undefined (module Ecto.Adapters.SQL.Sandbox is not available) | |
lib/wallaby/feature_case.ex:87 | |
$ echo $? | |
1 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gg() { | |
if [ -d .git ]; then | |
if [ $(ls .git | wc -l) -gt '0' ]; then | |
smerge . | |
else | |
(cd .. && gg) | |
fi | |
else | |
(cd .. && gg) | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
augroup vimrc | |
autocmd! | |
autocmd FileType netrw call s:RemoveNetrwMap() | |
augroup END | |
function s:RemoveNetrwMap() | |
if hasmapto('<Plug>NetrwRefresh') | |
unmap <buffer> <C-l> | |
endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Example | |
# | |
# $ until-fail bundle exec rspec | |
(( count=0 )) | |
while "$@"; do | |
(( count++ )) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule PipsqueakWeb.DemoLive do | |
use Phoenix.LiveView | |
import Temple, only: [render: 1] | |
render do | |
div do | |
div do | |
"Current temperature #{@temperature}" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cd into every dir in my ~/Development folder | |
# determine if a repo is from my work's GitHub org | |
# set my git user email with my work email | |
# cd back out | |
for dir in $(ls); do | |
cd "$dir" | |
is_work=$(git remote get-url --push origin | awk '/[email protected]:github-org\//{print 1}') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Uses neovim-remote: https://github.com/mhinz/neovim-remote | |
save-and-quit() { | |
for inst in $(nvr --serverlist); do | |
nvr --servername "$inst" --remote-send ':wqa<cr>' | |
done | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -g default-terminal "tmux-256color" | |
set-option -ga terminal-overrides ",xterm-256color:Tc" |