id

Coronavirus: Six money-saving ideas for lockdown and beyond

Millions of people are facing pay cuts or less work, so how can you make your money go further?




id

How Florian Schneider and Kraftwerk influenced five decades of music

The band's influence can be heard in everything from art-rock and hip-hop to trance and house.




id

India coronavirus: Why celebrating Covid-19 'success models' is dangerous

Experts tell the BBC that euphoria over success models runs the risk of people becoming complacent.




id

Dateci Voce: Italian women demand voice in Covid-19 fight

Women post selfies demanding more representation in official bodies dealing with Covid-19.




id

US Vice-President Mike Pence's aide tests positive for coronavirus

The diagnosis comes one day after Trump's personal valet tested positive for the virus.




id

Coronavirus: Far-right spreads Covid-19 'infodemic' on Facebook

An investigation details how extremists are trying to exploit the pandemic via the social network.




id

Coronavirus: Ghana's dancing pallbearers become Covid-19 meme

Social media users have adopted the troupe as a dark-humoured symbol of death in the time of Covid-19.




id

Covid-19: Investigating the spread of fake coronavirus news

In a joint investigation BBC Click investigates the groups behind fake news about the pandemic.




id

Life inside the UK's first 'TikTok house'

These six creators moved in together to make viral TikTok videos.




id

Uber says 'no sacred cows' amid coronavirus crisis

The firm has already announced job cuts affecting 14% of its staff, but more measures may be needed.




id

Coronavirus: 'Plandemic' virus conspiracy video spreads across social media

A slickly-produced "documentary" has exploded across social media, peddling medical misinformation.




id

Coronavirus: Thanking healthcare workers worldwide

Some of the ways that people have expressed thanks to workers on the frontline against Covid-19.




id

Coronavirus by Air: The spread of Covid-19 in the Middle East

An investigation by BBC News Arabic has found how one Iranian airline contributed to the spread of coronavirus around the Middle East.




id

How the Covid-19 pandemic is threatening Africa’s wildlife

Park rangers in Africa say the closure of safari tourism is leading to an increase in poaching.




id

ICYMI: Penguin chicks and new dining ideas

Some of the stories from around the world that you may have missed this week.




id

Ahmaud Arbery: Joggers out in solidarity with the killed 25-year-old

People have been dedicating their workouts to Ahmaud Arbery who was shot and killed while out jogging.




id

A transpiler for futuristic Ruby, and the RailsConf 2020 videos

#500 — May 7, 2020

Read on the Web

???? Welcome to issue 500! A bit of an arbitrary milestone but thanks to you all :-)

Ruby Weekly

Ruby Next: Make All Rubies Quack Alike — Ruby Next is a Ruby-to-Ruby transpiler that allows you to use the latest features of Ruby in previous versions without monkey patching or refinements. Could this be how experimental features are released going forward?

Vladimir Dementyev

Ruby 3 'Guilds' Proposal Now Called Ractor — This documentation is in Japanese (though the source code examples are easy to follow) but the news is that the new, proposed concurrency mechanism for Ruby 3 called Guilds (explained here) has been renamed to Ractor (as in ‘Ruby actors’, Ruby’s take on the actor model).

Koichi Sasada

Don’t Do Auth From Scratch. Focus On Your App — Spend less time on authentication and authorization and more time developing your awesome app. Auth built for <devs>. Download our community edition for free.

FusionAuth sponsor

Take the 2020 Ruby on Rails Survey — This is the sixth outing for Planet Argon’s survey which began in 2009. We try and support it each time as the results always make for interesting reading (see 2018’s results). Participate and become data ????

Planet Argon Team

???? RailsConf 2020 Videos

If you recall, RailsConf 2020 was cancelled in its in-person form to be replaced by a 'couch edition'. This has been taking place and the videos have been released! Here are some of the highlights:

If you want the full collection, here's the YouTube playlist.

Alt::BrightonRuby: A Slightly Odd, Quasi-Conference for Strange Times — Alt::BrightonRuby is not happening in-person this year. Instead, you can buy the recorded talks, get a _why book, and get some podcasts with the speakers.

Alt::BrightonRuby

???? Jobs

Find a Job Through Vettery — Vettery specializes in tech roles and is completely free for job seekers. Create a profile to get started.

Vettery

Security Engineer (Remote) — Are you an engineer with experience in Rails and/or Go? Join our team and help secure our apps and cloud infrastructure.

Shogun

ℹ️ Interested in running a job listing in Ruby Weekly? There's more info here.

???? Articles & Tutorials

▶  How To Begin Contributing to a Gem — If you’ve been using a library for a while and you want to contribute back, how do you get started? A 12 minute introduction here.

Drifting Ruby

How to Set Up Factory Bot on a Fresh Rails Project — Factory Bot is a library for setting up Ruby objects as test data – an alternative to fixtures, essentially.

Jason Swett

Using Postgres's DISTINCT ON to Avoid an N+1 Query“Recently I fixed a tricky N+1 query and thought I should write it up..”

John Nunemaker

Need to Upgrade Rails? Don’t Know How Long It Will Take? — Get an action plan for your Rails upgrade and an in-depth report about your technical debt and outdated dependencies ????.

FastRuby.io | Rails Upgrade Services sponsor

5 Uses for 'Splats' — 5 different ways to leverage Ruby’s splat (*) operator.

Jason Dinsmore

Running Multiple Instances of Webpacker — If you’re working on multiple Rails apps at once, changing where Rails gets served up is easy by configuring the port, but what about Webpacker? That requires another tweak.

Scott Watermasysk

Performing Asynchronous HTTP requests in Rails — How to update parts an app’s pages with asynchronous HTTP requests. A step-by-step how-to with JavaScript’s fetch() function, and Rails native server-side partial rendering.

Remi Mercier

How to Use AWS SimpleDB from Ruby — If you haven’t heard of AWS SimpleDB, you wouldn’t be alone as it’s not very popular, but it’s a pretty simple and cheap way to store simple documents in the cloud.

Peter Cooper

What's The Difference Between Monitoring Webhooks and Background Jobs

AppSignal sponsor

Ways to Reduce Your Heroku App's Slug Size — You might be surprised Heroku didn’t already do some of this for you.

Rohit Kumar

A Chat with Thibaut Barrère — If you missed our interview with Thibaut Barrere (Rubyist, and creator of the Kiba ETL framework) in last week’s issue, you can catch up here.

Glenn Goodrich

???? Code and Tools

Rodauth 2.0: Ruby's 'Most Advanced' Authentication Framework — A authentication framework that can work in any Rack-based webapp. Built using Roda and Sequel, Rodauth can be used with other frameworks and database libraries if you wish. Why’s it so advanced? More info on that here.

Jeremy Evans

RubyGems 3.1.3 Released — Lots of little bug fixes and tweaks.

RubyGems Blog

Business: Business Day Calculations for Ruby — Define your working days and holidays and then you can do ‘business day arithmetic’ (for example, what’s in 5 working days after now taking holidays and weekends into account?)

GoCardless

Lockbox: Modern Encryption for Rails

Andrew Kane

split: The Rack Based A/B 'Split' Testing Framework — A mature framework with robust configuration and multiple options for determining the winning option.

Split

P.S. In last week's issue, one of the links to our sponsors was incorrect and some readers emailed us to say they really wanted to read the promised article, Let’s Explore Big-O Notation with Ruby, so here it is. Apologies for any inconvenience.




id

'My search for the boy in a child abuse video'

Lucy Proctor was horrified when she was WhatsApped a sex abuse video. And she wanted to find out if the boy was safe.




id

Electrosensitivity: 'I didn't believe people had it, then it happened to me'

Velma, Emma and Dean believe mobile phone signals, wi-fi and other modern technology makes them ill.




id

Building Redux Middleware

After writing my post a few months ago on building your own redux app, I have been asked a couple times to write a guide on creating redux middleware and how it works. This will be a quick post on how you can acheive anything with your own middleware!

##Basic middleware


const customMiddleware = store => next => action => {
  if(action.type !== 'custom') return next(action)
  //do stuff!
}

Applying it:

import { createStore, applyMiddleware, } from 'redux'
import reducer from './reducer'
import customMiddleware from './customMiddleware'

const store = createStore(
  reducer,
  applyMiddleware(customMiddleware)
)

Whaaa? store => next => action => I know that looks confusing. Essentially you are building a chain of functions, it will look like this when it gets called:

//next looks something like this:
let dispatched = null
let next = actionAttempt => dispatched = actionAttempt 

const dispatch = customMiddleware(store)(next)

dispatch({
  type: 'custom',
  value: 'test'
})

All you are doing is chaining function calls and passing in the neccesary data. When I first saw this I was confused a little due to the long chain, but it made perfect sense after reading the article on writing redux tests.

So now that we understand how those chained functions work, let’s explain the first line of our middleware.

if(action.type !== 'custom') return next(action)

There should be some way to tell what actions should go through your middleware. In this example, we are saying if the action’s type is not custom call next, which will pass it to any other middleware and then to the reducer.

##Doing Cool stuff

The official guide on redux middleware covers a few examples on this, I’m going to try to explain it in a more simple way.

Say we want an action like this:

dispatch({
  type: 'ajax',
  url: 'http://api.com',
  method: 'POST',
  body: state => ({
    title: state.title
    description: state.description
  }),
  cb: response => console.log('finished!', response)
})

We want this to do a post request, and then call the cb function. It would look something like this:

import fetch from 'isomorphic-fetch'

const ajaxMiddleware = store => next => action => {
  if(action.type !== 'ajax') return next(action)
  
  fetch(action.url, {
    method: action.method,
    body: JSON.stringify(action.body(store.getState()))
  })
  .then(response => response.json())
  .then(json => action.cb(json))
}

It’s pretty simple really. You have access to every method redux offers in middleware. What if we wanted the cb function to have access to dispatching more actions? We could change that last line of the fetch function to this:

.then(json => action.cb(json, store.dispatch))

Now in the callback, we can do:

  cb: (response, dispatch) => dispatch(newAction(response))

As you can see, middleware is very easy to write in redux. You can pass store state back to actions, and so much more. If you need any help or if I didn’t go into detail enough, feel free to leave a comment below!




id

Real Madrid 4-1 Al Ain (UAE 2018)

Real Madrid capped off another memorable year by claiming a third successive FIFA Club World Cup title, defeating host team Al Ain 4-1 at Abu Dhabi's Zayed Sports City Stadium.




id

Real Madrid CF 4-1Al Ain (UAE 2018)

Real Madrid CF beat Al Ain in a 4-1 thriller in the FIFA Club World Cup (2018) final. Watch all 5 goals from the final, including Modric's outside the box curler.




id

Lincoln (R) of Brazil battles for the ball with Ibrahim Kane and Boubacar Haidara of Mali

KOLKATA, INDIA - OCTOBER 28: Lincoln (R) of Brazil battles for the ball with Ibrahim Kane and Boubacar Haidara of Mali during the FIFA U-17 World Cup India 2017 3rd Place match between Brazil and Mali at Vivekananda Yuba Bharati Krirangan on October 28, 2017 in Kolkata, India. (Photo by Buda Mendes - FIFA/FIFA via Getty Images)




id

Lincoln of Brazil battles for the ball with Boubacar Haidara and Mamadi Fofana of Mali

KOLKATA, INDIA - OCTOBER 28: Lincoln (R) of Brazil battles for the ball with Boubacar Haidara and Mamadi Fofana of Mali during the FIFA U-17 World Cup India 2017 3rd Place match between Brazil and Mali at Vivekananda Yuba Bharati Krirangan on October 28, 2017 in Kolkata, India. (Photo by Buda Mendes - FIFA/FIFA via Getty Images)




id

Lincoln of Brazil battles for the ball with Boubacar Haidara and Mamadi Fofana of Mali

KOLKATA, INDIA - OCTOBER 28: Lincoln (R) of Brazil battles for the ball with Boubacar Haidara and Mamadi Fofana of Mali during the FIFA U-17 World Cup India 2017 3rd Place match between Brazil and Mali at Vivekananda Yuba Bharati Krirangan on October 28, 2017 in Kolkata, India. (Photo by Buda Mendes - FIFA/FIFA via Getty Images)




id

Lincoln of Brazil battles for the ball with Salam Jiddou of Mali

KOLKATA, INDIA - OCTOBER 28: Lincoln (L) of Brazil battles for the ball with Salam Jiddou of Mali during the FIFA U-17 World Cup India 2017 3rd Place match between Brazil and Mali at Vivekananda Yuba Bharati Krirangan on October 28, 2017 in Kolkata, India. (Photo by Buda Mendes - FIFA/FIFA via Getty Images)




id

Lincoln of Brazil battles for the ball with Boubacar Haidara of Mali

KOLKATA, INDIA - OCTOBER 28: Lincoln of Brazil battles for the ball with Boubacar Haidara of Mali during the FIFA U-17 World Cup India 2017 3rd Place match between Brazil and Mali at Vivekananda Yuba Bharati Krirangan on October 28, 2017 in Kolkata, India. (Photo by Buda Mendes - FIFA/FIFA via Getty Images)




id

Brenner of Brazil battles for the ball with Boubacar Haidara of Mali

KOLKATA, INDIA - OCTOBER 28: Brenner (R) of Brazil battles for the ball with Boubacar Haidara of Mali during the FIFA U-17 World Cup India 2017 3rd Place match between Brazil and Mali at Vivekananda Yuba Bharati Krirangan on October 28, 2017 in Kolkata, India. (Photo by Buda Mendes - FIFA/FIFA via Getty Images)




id

Lincoln of Brazil battles for the ball with Boubacar Haidara of Mali

KOLKATA, INDIA - OCTOBER 28: Lincoln of Brazil battles for the ball with Boubacar Haidara of Mali during the FIFA U-17 World Cup India 2017 3rd Place match between Brazil and Mali at Vivekananda Yuba Bharati Krirangan on October 28, 2017 in Kolkata, India. (Photo by Buda Mendes - FIFA/FIFA via Getty Images)




id

Lincoln of Brazil battles for the ball with Salam Jiddou of Mali

KOLKATA, INDIA - OCTOBER 28: Lincoln (L) of Brazil battles for the ball with Salam Jiddou of Mali during the FIFA U-17 World Cup India 2017 3rd Place match between Brazil and Mali at Vivekananda Yuba Bharati Krirangan on October 28, 2017 in Kolkata, India. (Photo by Buda Mendes - FIFA/FIFA via Getty Images)




id

Yuri Alberto (R) of Brazil celebrates scoring his sides second goal with Rodrigo Guth

Yuri Alberto (R) of Brazil celebrates scoring his sides second goal with Rodrigo Guth during the FIFA U-17 World Cup India 2017 3rd Place match between Brazil and Mali at Vivekananda Yuba Bharati Krirangan on October 28, 2017 in Kolkata, India. (Photo by Tom Dulat - FIFA/FIFA via Getty Images)




id

Yuri Alberto of Brazil scores his side's second goal

KOLKATA, INDIA - OCTOBER 28: Yuri Alberto of Brazil scores his side's second goal during the FIFA U-17 World Cup India 2017 3rd Place match between Brazil and Mali at Vivekananda Yuba Bharati Krirangan on October 28, 2017 in Kolkata, India. (Photo by Tom Dulat - FIFA/FIFA via Getty Images)




id

Yuri Alberto of Brazil celebrates scoring his side's second goal

Yuri Alberto of Brazil celebrates scoring his side's second goal during the FIFA U-17 World Cup India 2017 3rd Place match between Brazil and Mali at Vivekananda Yuba Bharati Krirangan on October 28, 2017 in Kolkata, India. (Photo by Tom Dulat - FIFA/FIFA via Getty Images)




id

Yuri Alberto of Brazil celebrates scoring his sides second goal

KOLKATA, INDIA - OCTOBER 28: Yuri Alberto (C) of Brazil celebrates scoring his sides second goal with Rodrigo Guth (L) during the FIFA U-17 World Cup India 2017 3rd Place match between Brazil and Mali at Vivekananda Yuba Bharati Krirangan on October 28, 2017 in Kolkata, India. (Photo by Tom Dulat - FIFA/FIFA via Getty Images)




id

Rhian Brewster of England celebrates scoring his side's first goal

KOLKATA, INDIA - OCTOBER 28: Rhian Brewster of England celebrates scoring his side's first goal during the FIFA U-17 World Cup India 2017 Final match between England and Spain at Vivekananda Yuba Bharati Krirangan on October 28, 2017 in Kolkata, India. (Photo by Tom Dulat - FIFA/FIFA via Getty Images)




id

Rhian Brewster of England scores his side's first goal

KOLKATA, INDIA - OCTOBER 28: Rhian Brewster of England scores his side's first goal during the FIFA U-17 World Cup India 2017 Final match between England and Spain at Vivekananda Yuba Bharati Krirangan on October 28, 2017 in Kolkata, India. (Photo by Tom Dulat - FIFA/FIFA via Getty Images)




id

Sergio Gomez of Spain celebrates scoring his sides second goal

Sergio Gomez of Spain celebrates scoring his sides second goal during the FIFA U-17 World Cup India 2017 Final match between England and Spain at Vivekananda Yuba Bharati Krirangan on October 28, 2017 in Kolkata, India. (Photo by Jan Kruger - FIFA/FIFA via Getty Images)




id

Sergio Gomez of Spain celebrates scoring his sides second goal

Sergio Gomez of Spain celebrates scoring his sides second goal during the FIFA U-17 World Cup India 2017 Final match between England and Spain at Vivekananda Yuba Bharati Krirangan on October 28, 2017 in Kolkata, India. (Photo by Jan Kruger - FIFA/FIFA via Getty Images)




id

Sergio Gomez of Spain celebrates scoring his sides second goal

KOLKATA, INDIA - OCTOBER 28: Sergio Gomez of Spain celebrates scoring his sides second goal during the FIFA U-17 World Cup India 2017 Final match between England and Spain at Vivekananda Yuba Bharati Krirangan on October 28, 2017 in Kolkata, India. (Photo by Jan Kruger - FIFA/FIFA via Getty Images)




id

Sergio Gomez of Spain scores his sides second goal

KOLKATA, INDIA - OCTOBER 28: Sergio Gomez of Spain scores his sides second goal during the FIFA U-17 World Cup India 2017 Final match between England and Spain at Vivekananda Yuba Bharati Krirangan on October 28, 2017 in Kolkata, India. (Photo by Jan Kruger - FIFA/FIFA via Getty Images)




id

Sergio Gomez of Spain celebrates scoring his sides second goal

KOLKATA, INDIA - OCTOBER 28: Sergio Gomez of Spain celebrates scoring his sides second goal during the FIFA U-17 World Cup India 2017 Final match between England and Spain at Vivekananda Yuba Bharati Krirangan on October 28, 2017 in Kolkata, India. (Photo by Jan Kruger - FIFA/FIFA via Getty Images)




id

Morgan Gibbs White of England scores his sides second goal

KOLKATA, INDIA - OCTOBER 28: Morgan Gibbs White of England scores his sides second goal during the FIFA U-17 World Cup India 2017 Final match between England and Spain at Vivekananda Yuba Bharati Krirangan on October 28, 2017 in Kolkata, India. (Photo by Tom Dulat - FIFA/FIFA via Getty Images)




id

Morgan Gibbs White of England celebrates with the team scoring his sides second goal

KOLKATA, INDIA - OCTOBER 28: Morgan Gibbs White of England celebrates with the team scoring his sides second goal during the FIFA U-17 World Cup India 2017 Final match between England and Spain at Vivekananda Yuba Bharati Krirangan on October 28, 2017 in Kolkata, India. (Photo by Tom Dulat - FIFA/FIFA via Getty Images)




id

Morgan Gibbs White of England celebrates with the team scoring his sides second goal

KOLKATA, INDIA - OCTOBER 28: Morgan Gibbs White (2nd L) of England celebrates with the team scoring his sides second goal during the FIFA U-17 World Cup India 2017 Final match between England and Spain at Vivekananda Yuba Bharati Krirangan on October 28, 2017 in Kolkata, India. (Photo by Tom Dulat - FIFA/FIFA via Getty Images)




id

FIFA President Gianni Infantino presents the winners trophy

KOLKATA, INDIA - OCTOBER 28: FIFA President Gianni Infantino presents the winners trophy to captain Angel Gomes of England after the FIFA U-17 World Cup India 2017 Final match between England and Spain at Vivekananda Yuba Bharati Krirangan on October 28, 2017 in Kolkata, India. (Photo by Buda Mendes - FIFA/FIFA via Getty Images)




id

FIFA President Gianni Infantino delivers the winners trophy

KOLKATA, INDIA - OCTOBER 28: FIFA President Gianni Infantino delivers the winners trophy to captain Angel Gomes of England after the FIFA U-17 World Cup India 2017 Final match between England and Spain at Vivekananda Yuba Bharati Krirangan on October 28, 2017 in Kolkata, India. (Photo by Buda Mendes - FIFA/FIFA via Getty Images)




id

England's midfielder Phil Foden greets spectators

England's midfielder Phil Foden greets spectators after England's win over Spain in the final FIFA U-17 World Cup football match at the Vivekananda Yuba Bharati Krirangan stadium in Kolkata on October 28, 2017. / AFP / Dibyangshu SARKAR




id

England's midfielder Phil Foden greets spectators after England's win over Spain

England's midfielder Phil Foden greets spectators after England's win over Spain in the final FIFA U-17 World Cup football match at the Vivekananda Yuba Bharati Krirangan stadium in Kolkata on October 28, 2017. / AFP / Dibyangshu SARKAR




id

FIFA President Gianni Infantino delivers the champion trophy

KOLKATA, INDIA - OCTOBER 28: FIFA President Gianni Infantino delivers the champion trophy to the captain Angel Gomes of England after the FIFA U-17 World Cup India 2017 Final match between England and Spain at Vivekananda Yuba Bharati Krirangan on October 28, 2017 in Kolkata, India. (Photo by Buda Mendes - FIFA/FIFA via Getty Images)




id

FIFA President Gianni Infantino delivers the champion trophy

KOLKATA, INDIA - OCTOBER 28: FIFA President Gianni Infantino delivers the champion trophy to the captain Angel Gomes of England after the FIFA U-17 World Cup India 2017 Final match between England and Spain at Vivekananda Yuba Bharati Krirangan on October 28, 2017 in Kolkata, India. (Photo by Buda Mendes - FIFA/FIFA via Getty Images)