Skip to content

Instantly share code, notes, and snippets.

View hmsf's full-sized avatar

Hugo Ferreira hmsf

  • Lisbon
View GitHub Profile
@hmsf
hmsf / rails.rb
Created August 11, 2023 18:21 — forked from castwide/rails.rb
Enhance Rails Intellisense in Solargraph
# The following comments fill some of the gaps in Solargraph's understanding of
# Rails apps. Since they're all in YARD, they get mapped in Solargraph but
# ignored at runtime.
#
# You can put this file anywhere in the project, as long as it gets included in
# the workspace maps. It's recommended that you keep it in a standalone file
# instead of pasting it into an existing one.
#
# @!parse
# class ActionController::Base
@hmsf
hmsf / mysql-docker.sh
Created February 7, 2023 18:26 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@hmsf
hmsf / gist:65ad3761c08a43222524a311181c8e5e
Last active September 13, 2022 19:07 — forked from lfender6445/gist:9919357
Pry Cheat Sheet

Pry Cheat Sheet

Command Line

  • pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)
  • pry -r ./config/environment.rb - load your rails into a pry session

Debugger