Skip to content

Instantly share code, notes, and snippets.

View danilocandido's full-sized avatar

Danilo Cândido danilocandido

View GitHub Profile
@danilocandido
danilocandido / rails_console.rb
Last active June 20, 2019 23:43
Tips for rails console
# add a .pryrc file or .irbrc
class Object
def me
User.find_by(email: 'andrew@example.com')
end
def slmn
SomeLongModelName
end
@danilocandido
danilocandido / exclude
Last active December 20, 2018 18:30
Git ignore local files > .git/info/exclude
Open your file .git/info/exclude
Normaly, I used to exclude database.yml
add this line bellow
config/database.yml
Close the file and make sure you run
git update-index --assume-unchanged config/database.yml
# Reference
@danilocandido
danilocandido / docker_comands
Last active June 17, 2020 10:49
Useful Docker Commands
# display system-wide information
docker info
# list containers
docker ps # only running
docker ps -a # all
# remove specific container ID
docker rm 42bbb5394617