Skip to content

Instantly share code, notes, and snippets.

View mhanberg's full-sized avatar
🏎️
Vroom

Mitchell Hanberg mhanberg

🏎️
Vroom
View GitHub Profile
if value == "Alice" || value == "Bob" || value == "Carol" do
# stuff
end
if Enum.member?(["Alice", "Bob", "Carol"], value) do
# stuff
$ 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
gg() {
if [ -d .git ]; then
if [ $(ls .git | wc -l) -gt '0' ]; then
smerge .
else
(cd .. && gg)
fi
else
(cd .. && gg)
fi
augroup vimrc
autocmd!
autocmd FileType netrw call s:RemoveNetrwMap()
augroup END
function s:RemoveNetrwMap()
if hasmapto('<Plug>NetrwRefresh')
unmap <buffer> <C-l>
endif
#!/usr/bin/env bash
# Example
#
# $ until-fail bundle exec rspec
(( count=0 ))
while "$@"; do
(( count++ ))
defmodule PipsqueakWeb.DemoLive do
use Phoenix.LiveView
import Temple, only: [render: 1]
render do
div do
div do
"Current temperature #{@temperature}"
end
# 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}')
# 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
}
set -g default-terminal "tmux-256color"
set-option -ga terminal-overrides ",xterm-256color:Tc"