capybara login with user scope
If you have more than one user type, you can login as it from your tests using:
The example above assumes that you also have an admin mapping, besides your User mapping.
quick debugging in ruby when pry is not available
Insert the following statement where you’d like execution to stop:
preloading associations in elixir
or, if an association has not been loaded, and you receive: #Ecto.Association.NotLoaded
extracting a range of lines from a file
and to print all the lines after a specific line number:
viewing an opsworks logfile
Noticed that sometimes viewing the log from the webpage does not work. This allows you to see once you’re logged into the box:
ruby each_with_object
each_with_object has the same effects as an inject, just the parameter order is reversed, each_with_object has (element,accumulator), and you don’t need to return the object.
linx no.11
- [Remote Control Server] (https://github.com/jeremija/remote-control-server) allows you to easily control your PC through a browser. Really useful for reading a book on a big HDMI connected TV :)