Send multiple emails to different recipients.
# app/mailers/notify_mailer.rb
class NotifyMailer < ApplicationMailer
def reverse_array(arr) | |
return arr if arr.empty? | |
arr = arr.dup | |
start_index = 0 | |
end_index = arr.length - 1 | |
while start_index < end_index | |
arr[start_index], arr[end_index] = arr[end_index], arr[start_index] |
def query(params) | |
# this magic method prepares sql and gets correct data from DB | |
# NO CHANGES HERE | |
puts "Params = #{params}" | |
[ | |
{name: "John", surname: "Doe", age: 33}, | |
{name: "John", surname: "Doe", age: 34}, | |
{name: "John", surname: "Doe", age: 35} | |
] | |
end |
class Profile extends React.Component { | |
render(props) { | |
return <div>{props}</div> | |
} | |
} | |
// Dumb component | |
function Profile(props) { | |
return <div>{props}</div> |
First, add pry-rails to your Gemfile:
https://github.com/rweng/pry-rails
gem 'pry-rails', group: :development
Then you'll want to rebuild your Docker container to install the gems
import React from 'react' | |
// Example 1: translation | |
const TranslationContext = { | |
// most likely, from Provider or any other top-level component | |
locale: 'en', | |
strings: { | |
en: { | |
'user.my_account': 'My account' |
Helper setup to edit .yaml files with Vim:
List of general purpose commands for Kubernetes management:
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
Based on this tutorial but simplified and inlined. Particularly removed any Rails and 3rd party services part, assumed you just need deployment to any Ubuntu machine.