Here is compiled a list of commands to run in postgres console:
$ docker-compose exec db psql -Upostgresto run pg console. In my case, I am running it from docker and the user is postgres, no password.
$ \lWill list available databases
$ \c DATABASE_NAMEallows you to switch between databases.
$ \dwhen connected to the database, list tables, views, and sequences.
$ \dtlist tables only.
$ \d+ TABLE_NAMEshow description of the table:
Show columns name:
$ \tIf queries show data but you don’t see table’s, this command will help to toggle that.
Here is compiled list of commands to list and delete images, containers and volumes.
docker images -a docker images -f dangling=true
docker rmi Image ### Remove dangling docker images purge ### Remove all docker rmi $(docker images -a -q)
docker ps -a ### List all exited containers docker ps -a -f status=exited
docker rm ID_or_Name ### Remove all exited containers docker rm $(docker ps -a -f status=exited -q) ### Stop containers docker stop $(docker ps -a -q)
### All docker volume ls ### Dangling docker volume ls -f dangling=true
docker volume rm volume_name ### Remove dangling docker volume prune ### Remove container and its volume at the same time docker rm -v container_name
I’ve tried to use Minitest for small ruby projects/exercises. Before that, I was always using
rspec. But now I have some time and I wanted to try something new. Old “new”, hehe 😅. Minitest is straight forward, fast, what’s not to like. And it comes with Ruby by default since 1.9.
Anyway, to my big surprise I couldn’t run all the tests from the directory, and playing one by one is time-consuming and tedious. If there is a default way how to run them all, please share, meanwhile here comes little Rakefile:
require 'rake/testtask' desc 'Run specs' Rake::TestTask.new(:test) do |t| t.libs << 'lib' t.libs << 'test' t.pattern = './*_spec.rb' t.verbose = true end
Now just run
rake testand enjoy TDD.
Original source: link
I have a class and I have a test. And everything is great until I add next test…
So, I had something like this:
I have recently started to use
dockerfor OwlDot and faced an issue that changes are not automaticaly picked up from
bundle installisn’t run. To make it happen I needed to run
docker-compose up --build, not just
docker-compose upas usual. I need to build it 😅. Now it looks so obvious 😅
Happy Birthday RUBY!!!!!Unbelievable, it turned 27 today!
Congratulation to Ruby!
Congratulation to us all!
This is copy from https://gist.github.com/ibraheem4 Thank you @ibraheem4