How to output the current RSpec example

Here’s a snippet you can add to your rspec config to print out the name of the
method being run:

config.before do |example|
 24     puts "----- state ----"
 25     puts example.metadata[:full_description]
 26     puts "inline: #{Sidekiq::Testing.inline?}"
 27     puts "fake: #{Sidekiq::Testing.fake...
Keep reading...

Raspberry Pi Smart TV

This is a small project that creates a pseudo-kiosk streaming media box from a
Raspberry Pi. Once you are done, you’ll end up with a Raspberry Pi that loads
Chromium into full screen kiosk mode on startup with your favourite streaming
services only a click away thanks to some minimal html acting as...

Keep reading...

Not In queries in Rails with MongoDB and Mongoid

Sometimes you want a quick “not in” or “not equal” query in Rails, but you’re
running Mongo. ActiveRecord allows us to write where.not against relational
databases, but this doesn’t work when using Mongoid. Instead, you can use nin
or it’s alias not_in

Book.not_in(title: "Of mice and men")

The method...

Keep reading...

How to show hidden rake tasks

Rake tasks are easily listed from the command line with rake -T. However if
you’ve written a rake task and neglected to provide a description for it with
the desc as the first line, the task will not show up with the usual rake -T. These are essentially hidden rake tasks!

To display them, append...

Keep reading...

That way →