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
# This function will print out the net lines added | |
# in your current changes or in a given commit | |
netlines() { | |
git --no-pager diff --numstat $1 | awk '{sum += ($1 - $2)} END{print sum;}' | |
} | |
$ netlines | |
-200 |
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
module Interceptors | |
class StagingServerEmailInterceptor | |
def self.delivering_email(email) | |
email.to = "[email protected]" | |
email.subject = "(TEST) " + email.subject | |
end | |
end | |
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
# pbpaste - paste from your macOS clipboard | |
# jsonlint - linting tool for JSON. `-p` will format the input | |
# less - standard unix pager | |
$ pbpaste | jsonlint -p | less |
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
unwrap-last-commit() { | |
git reset --soft HEAD~1 | |
git reset | |
} |
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
.flash-container { | |
@apply flex flex-col flex-1 absolute; | |
top: 4rem; | |
right: 5rem; | |
} | |
.flash { | |
@apply max-w-sm rounded-r border-l-3 shadow p-4 mb-4 inline-block relative; |
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
Some text that you want to save to a gist, | |
but don't want to save to your computer. |
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
> for each desired change, make the change easy (warning: this may be hard), then make the easy change | |
for each new tool you use, make the tool easy to use (warning: this may be hard), then easily use the tool |
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
export ERL_AFLAGS="-kernel shell_history enabled" |
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
" .vimrc | |
" Enable persistent undo | |
set undofile | |
" Use a temporary directory to store undo files | |
set undodir=~/.tmp |