Skip to content

Instantly share code, notes, and snippets.

View itSQualL's full-sized avatar
🎯
Focusing

Sergio Antonio Caraballo itSQualL

🎯
Focusing
View GitHub Profile
# We want to be sure that we keep a log into our Bank.Log table of all responses got from the Bank.
# Can you state if that will happen with this code? Please answer yes/no and *why*.
#
# Please consider all input values correct.
class User < ApplicationRecord
validates :customer_confidence, numericality: { greater_than_or_equal_to: 0 }
end
class Merchant
@itSQualL
itSQualL / install.sh
Created December 15, 2019 10:17
asdf ruby install
# clone asdf
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.7.5
# Add asdf to bash
echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.bashrc
echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.bashrc
#install dependencies
sudo apt install \
automake autoconf libreadline-dev \
@itSQualL
itSQualL / coc-settings.json
Last active May 4, 2020 18:18
nvim config #vim #nvim
{
"solargraph.definitions": true,
"solargraph.diagnostics": true,
"solargraph.formatting": true,
"solargraph.hover": true,
"solargraph.references": true
}
@itSQualL
itSQualL / postgres_dumps.md
Last active October 1, 2021 16:08
How to backup and restore postgres from docker

Docker & PostgreSQL

How to backup PostgreSQL database from Docker container

  1. Go to the directory with docker-compose file.

  2. Execute the next command to get db dump (note that the next command is an example for actual docker-compose config):

docker-compose run postgres pg_dump -h postgres -U postgres db_development &gt; db_development.dump