Rubyland

news, opinion, tutorials, about ruby, aggregated
Sources About
Cognito Blog 

6 Tips to Maximize Identity Verification UX

Users love reduced friction

We've helped hundreds of companies optimize their ID verification flows to ensure the best possible user experience. As part of this work, we've learned what works - and doesn't - when onboarding customers and we've compiled a list of actionable tips to help keep your users happy.


1. Use text inputs, not dropdowns for date of birth

Despite what you may expect, on average users fill out 3 separate text inputs asking for the day, month and year of their birth faster than they can fill out 3 dropdowns. When coupled with strong data validations, text input date of birth entry increases conversion rates.

2. Autofill state and city information

Use a service like Zippopotamus or SmartyStre…

Semaphore Engineering Blog 

Rails Techniques: Using Polymorphic Associations

Rails Techniques: Using Polymorphic Associations

What is a Polymorphic Association?

In Ruby on Rails, a polymorphic association is an Active Record association that can connect a model to multiple other models. For example, we can use a single association to connect the Review model with the Event and Restaurant models, allowing us to connect a review with either an event or a restaurant.

One common use case includes Event and Restaurant inheriting from the same ancestor class. This is not necessary, though, and in our example we'll use mixins instead.

Let's now look further into our Review example.

Diving into the Example

Consider the following situation: we have an application that enables users to review events and restaurants.…

Search Results for “ruby” – via @codeship 

Let’s Talk About Shell Scripting

Reading Time: 8 minutes

Bash is a command-line shell now available on all major operating systems, and it is the environment from which most developers can accomplish the majority of tasks for a system. Many of the commands that need to be executed to complete a task can be grouped together in a script to help avoid repetition when typing the commands. Furthermore, there’s a good amount of programming capability in shell scripting that allows you to write simple to complex programs.

I’ll be covering some basics in Bash scripting, as well as some more advanced techniques you can take advantage of. I’ll also be covering a bit of fish shell and why you may want to consider using it as a better…

Universe Engineering - Medium 

Batching – A powerful way to solve N+1 queries every Rubyist should know

Batching – A powerful way to solve N+1 queries every Rubyist should know

In this post, I’m going to tell you about batching as a technique to help avoid N+1 queries, existing battle-tested tools like Haskell Haxl and JavaScript DataLoader, and how similar approaches can be used in any Ruby program.

What are N+1 queries?

First, let’s find out what N+1 queries are and why they are called that. Imagine, we have 2 SQL tables: users and posts. If we run the following code by using ActiveRecord models:

posts = Post.where(id: [1, 2, 3])
# SELECT * FROM posts WHERE id IN (1, 2, 3)
users = posts.map { |post| post.user }
# SELECT * FROM users WHERE id = 1
# SELECT * FROM users WHERE id = 2
# SELECT * FROM…
Greater Than Code 

043: The Accessibility of Board Games with Mischa Lewis-Norelle and James Edward Gray

Panelists:

Rein Henrichs | Jamey Hampton |  Sam Livingston-Gray | Coraline Ada Ehmke

Guest Starring:

James Edward Gray: @JEG2

Mischa Lewis-Norelle: @mlewisno | mlewisno.com

Show Notes:

Amazon links are affiliate links, which means you’re supporting the show when you purchase our recommendations. Thanks!

00:16 – Welcome to “Paneldome!” …we mean, “Greater Than Code!”

01:58 – Backgrounds and Superpowers

Hilary Stohs-Krause: We’ve Always Been Here: Women Changemakers in Tech @ RailsConf 2017

04:44 – Examples of Accessibility Challenges in Board Games

07:00 – Games and Challenges

Escape: The Curse of the Temple (Purchase)

Millennium Blades (Purchase)

11:49 – The Power of House Rules

RoboRally (

S…

Riding Rails 

Three new committers: George, Javan, Ryuta

We’re happy to announce three new members of the Rails committers team: George, Javan, and Ryuta 🎉!

  • George Claghorn: George has been an integral part in creating our new Active Storage framework. He wrote a substantial part of the framework itself by extracting hard-won lessons from his work at Basecamp on moving our storage to the cloud. George also managed the stand-alone rails/activestorage repository with issue and PR processing prior to its merge into the framework proper. George works at Basecamp and lives in Philadelphia.

  • Javan Makhmali: Javan has written the majority of the JavaScript needed for Action Cable and Active Storage, as well as being a significant…

As a reminder, the committer team works together with the core team by…

Martian Chronicles 

<b>TestProf:</b> a good doctor for slow Ruby tests

Author: Vladimir Dementyev, Back-end Developer at Evil Martians

Writing tests is a significant part of the development process, especially in the Ruby and Rails community. We don’t care about test suite performance until we find ourselves wasting too much time waiting for the green light.

I’ve spent a lot of time analyzing test suites performance and developed some useful techniques and tools to make tests faster. I’ve bundled them all into a meta-gem called TestProf, the Ruby test profiling toolbox.

The Motivation

Slow tests waste your time by making you less productive

You’re probably asking yourself: ”Why does test suite performance matter?”. Let me show you some statistics…

Universe Engineering - Medium 

Why We’re Betting on GraphQL

Universe is betting big on GraphQL. We’ve been hard at work this quarter aiming to deliver a richly typed, documented, publicly available GraphQL interface into our existing event ticketing platform.

Today, we’re excited to announce general availability of our beta GraphQL API. You can explore this API with our handy GraphiQL Explorer and documentation.

In making this beta, and through the course of our early development, we’ve identified five compelling use cases for GraphQL that might be less obvious, but compelling to those new to this paradigm:

  1. Strong client contracts
  2. Domain layer abstraction
  3. Typed request/response interfaces
  4. Expensive fields
  5. Documentation

Strong client contracts

Problem: Eventu…

Schneems - Programming Practices, Performance, and Pedantry 

The Longest Email I Ever Sent (Programmatically)

It was a quiet day in July when I got a message from SendGrid about a service I run, CodeTriage, which helps people contribute to open source projects, had gone over its limits. Calls to send out emails were all failing. The fix was easy: bump up the limits by going to the Heroku dashboard, click “edit”, and adjust the plan. Previously I got notifications that I was almost out of credits for the service, but since it was SOOO close to the end of the month, I thought I could squeek by without having to upgrade. I was wrong. No biggie though, as soon as I upgraded my add-on emails started to flow again. It wasn’t until later that I got the bug report, while I was successfully sending out…

Search Results for “ruby” – via @codeship 

Integrating Ruby on Rails Static Analysis with Codeship

Reading Time: 5 minutes

Every development team has their own preferences for what kind of checks they want to run on newly committed code. One specific flavor of tools that developers use is static analysis. Static analysis tools are programs that preform checks “statically” on code. This means that they determine the correctness or validity of code without executing it.

In nonprogramming terms, static analysis is a lot like checking a sentence for errors before speaking it out loud. There is a wide range of problems and insights that static analysis can discover. However, since these tools don’t execute our code, they can’t catch any error that’s unique to the execution runtime. In the same…

All Ruby Podcasts by Devchat.tv 

RR 323: Queuing and Amazon SQS with Kinsey Ann Durham

RR 323: Queuing and Amazon SQS with Kinsey Ann Durham

This episode of Ruby Rogues features panelists Charles Max Wood, Dave Kimura, and Eric Berry. Special guest Kinsey Ann Durham joins to talk about queuing and Amazon SQS. Tune in to learn more!

[00:01:19] Kinsey Ann Durham

Kinsey writes code for a company called Go Spot Check. She is always a lead mentor in a San Francisco based company called Bloc.

[00:02:50] Background on Amazon SQS

Go Spot Check is using Amazon SQS on a smaller scale. Kinsey thinks it is sasy to use. She recommends using something like Amazon SQS or even RabbitMQ. It has provided the company with the ability to explore different architecture patterns and tools.

[…

Justin Weiss 

When to take a Rails deep dive

Have you ever found a Rails topic that didn’t make any sense to you?

Like, you thought you knew it, so you wrote some code, and something completely different happened?

Or you know you don’t understand, but you kind of know enough to get by, except you spend so much time fighting edge cases that you could have been an expert in it by the time you were done?

Well, what if it didn’t have to be that way? Wouldn’t it better to just know how things worked? To have a solid mental model of the problem in front of you? So you could just make the right decisions, and write the right code?


When I was first learning web development, sessions were That Thing: I thought I kind of knew them, but I…

Jon McCartie 

First Responses Matter

The only thing necessary for the triumph of evil is for good men to do nothing. Edmund Burke

I’ve seen very little loud and vocal protest from Christian leaders regarding white supremacists in Charlottsville. Racism is a pretty straight-forward issue, but so far I’ve seen lots of hemming and hawing from them. They seem to want to explain the “intricasies” of the situation, rather than come out and condemn the hate.

On Twitter today, I engaged with someone who took issue with my frustration. My main point:

In the light of an act of terror, I would expect Christian leaders to clearly denounce hate. I think that’s a reasonable request. Yes?

But sadly, this became my fault for…

Search Results for “ruby” – via @codeship 

Visual Testing with Percy and Codeship Pro

Reading Time: 3 minutes

At Codeship, we’re pleased to be able to integrate with several third-party products to make your CI/CD workflows that much smoother. We’ve already discussed integrating Percy, a visual testing platform, with your Codeship Basic account. Here’s a brief overview of what you can accomplish when Codeship Pro and Percy work together.


“How Codeship Pro integrates with visual testing platform Percy” via @codeship
Click To Tweet


Why Percy and Visual Testing

In a nutshell, Percy lets you take screenshots during your test suite and monitor visual changes, as well as get team approval on updates. And in keeping with the spirit of a CI/CD pipeline, it’s all automated.

Percy…

Drifting Ruby Screencasts 

Recurring Events with ice_cube

ice_cube is a ruby library for easily handling repeated events and schedules.
dejimata 

Mobility 0.2: Now with Plugins

It’s been a little while since last I posted about Mobility, the pluggable translation framework for Ruby that I’ve been working on recently. I thought I’d take this opportunity with the release of the second major version of the gem to highlight some of the important changes and new features, and to recap how far things have come.

Mobility and the Module Builder Pattern

In the time since I posted Translating with Mobility, one of the techniques I have used heavily in building the gem – the Module Builder Pattern, as I’ve termed it – has become a hot topic of its own. (I’ll actually be talking about module builders at the coming RubyKaigi in Hiroshima, check it out if you’ll be attending.)

All Ruby Podcasts by Devchat.tv 

MRS 014 My Ruby Story Amir Rajan

MRS 015 Amir Rajan

Today's episode is a My Ruby Story with Amir Rajan. He was on Episode 272 of Ruby Rogues. Amir talked about where he used Ruby and how he got into RubyMotion. Listen to learn more about Amir!

[01:40] – Introduction to Amir Rajan

He was on episode 272 of Ruby Rogues and he talked about Game Development and RubyMotion. That was in August 2016.

[06:35] – How did you get into programming?

Amir had his Intel 80386 and was trying to install Win Commander on it. It came with this green booklet that says “cd C: /…”. He installed that exe command but he didn’t have enough space on the computer. He ended up deleting the operating system – Windows 3.1. He reinstalled it myself…

Kevin Sylvestre 

Fabrication vs FactoryGirl

A deep dive into the performance of Fabrication and FactoryGirl.
Hanami 

Announcing Hanami v1.1.0.beta1

Hello wonderful community!

This hot summer ☀ has some fresh news brought to you by Hanami 🌸 and its cool 😎 new features. 🍉

Today we're happy to announce v1.1.0.beta1 release 🙌 , with the stable release (v1.1.0) scheduled for October 2017.

Between now and then, we'll release other beta and release candidate versions.

Features

So what's new and exiciting in the Hanami world?

New repository associations

We added new useful associations. 🎉 Let's quickly see them in action.

Many-to-One (belongs_to)
class BookRepository < Hanami::Repository
  associations do
    belongs_to :author
  end

  def fin…
Hi, we're Arkency 

That one time I used recursion to solve a problem

Some time ago I was working on a problem and I could not find a satisfactory solution. But it all turned out to be much simpler when I reminded myself about a tool that I rarely use: recursive function.

You see… The iterators from Ruby’s Enumerable and queries from ActiveRecord are so nice that you barely need anything different than each to solve a problem. And here I was trying to use each in 5 different ways, in various different approaches failing again and again.

The story

The story goes like this. Your platform sells a ticket to an event. It might be for example a race or a marathon or other something completely different. Some of those competitions are pro or semi-pro and they are…

Honeybadger Developer Blog 

Shipping in 2017: Feature Roundup

A roundup of our favorite features we've shipped so far in 2017.
Search Results for “ruby” – via @codeship 

Working with DynamoDB

Reading Time: 12 minutes

Recently, I worked on an IoT-based project where we had to store time-series data coming from multiple sensors and show real-time data to an enduser. Further, we needed to generate reports and analyze gathered information.

To deal with the continuous data flowing from the sensors, we chose DynamoDB for storage. DynamoDB promises to handle large data with single-digit millisecond latency, at any scale. Since it’s a fully managed database service, we never had to worry about scaling, architecture, and hardware provisioning. Plus, we were using AWS IoT for sensors, so choosing a NoSQL database from AWS services like DynamoDB was the right decision.

Here is what Amazon…

Ruby Weekly 

#361: A Crash Course in Analyzing Memory Usage in Ruby

This week's Ruby and Rails news
Read this e-mail on the Web Ruby Weekly Issue 361 — August 10, 2017
Dependabot
A bug leads to a journey into the resolution logic of Bundler (and a fix that speeds things up immensely).


Thoughtbot
How to use simple tools to measure the allocated and long-term memory usage of your apps.


Redisgreen  Sponsored
Redis 4.0 is out and available on RedisGreen with full visualization of your memory usage and top-tier performance.

Redisgreen
Alex Taylor
Understanding the concepts and…
Schneems - Programming Practices, Performance, and Pedantry 

Coder Frozen in 2009 Awakens to Find Frontend Development not Awful

I’ve not seriously touched frontend code, in years. Frankly, it scares me. To that end “front end devs are not real programmers” is totally BS. I want to talk about some of the recent changes in tooling and APIs that are available so that front end development might not suck as much as it used to. You will not learn to be a CSS or JS guru with this post. If you’ve written much front end code, this will be mostly full of face-palm level obvious statements. Therefore, feel free to read for the laughs.

Blog - Saturn Flyer 

Fix it now

By leaving problems in place, we are guaranteeing that we will run into them again.

Many times on many projects I've changed direction. We discover a new technique, new tool, or somehow figure out a better way to do something. The next step is to start using it. But if using that new technique requires that you change a lot of code, when should you do it?

When should I fix this?

I'll tell you a decision we made on one project recently:

"Let's switch to this new tool as we make other changes. We'll eventually touch every area where the old tool is being used."

We merrily coded along expecting to improve our project over time.

But that anticipated eventuality never came. Yes, as we moved…

Greater Than Code 

042: @CallbackWomen and Organizing Conferences for Diversity and Inclusion with Carina C. Zona

Panelists:

Rein Henrichs | Jamey Hampton |  Sam Livingston-Gray | Coraline Ada Ehmke

Guest Starring:

Carina C. Zona: @cczona | cczona.com | @CallbackWomen | YouTube Channel

Show Notes:

00:16 – Welcome to “Life, The Universe, and Podcasts!” …we mean, “Greater Than Code!”

01:13 – Carina’s Background and Superpower

02:58 @CallbackWomen and The Naming Struggle to Make Sure Marginalized and Non-Binary People Know They Are Included

Ashe Dryden: Increasing Diversity at Your Conference

12:13 – Sending Signals and/or Indicators That Encourage People to Apply to Speak At Your Conference

Semaphore Engineering Blog 

Faster Rails: Eliminating N+1 queries

Faster Rails: Eliminating N+1 queries

This article is part of our Faster Rails series. Check out the previous article about index creation on large tables.

Rails does not scale well – this argument is often used to downplay the worth of the language and the framework. Yet, many businesses from small startups to platforms with millions of users use it as the backbone of their operations. A good question to ask ourselves is whether Rails simply can't scale, or if the issue is hidden somewhere deeper.

Rails is easy is to learn, but to achieve mastery we need to invest just as much time as we would invest in any other framework or language. We can't expect that our issues will magically disappear just because we…

All Ruby Podcasts by Devchat.tv 

RR 322 Finding a Great Job

RR 322: Finding a Great Job

This episode of Ruby Rogues the panel is Dave Kimura and Charles Max Wood. They discuss Finding a Good Developer Job. Tune in to learn more about this topic!

[00:02:08] Internal Clock With Jobs

Dave believes that within the developer community, people have a one to two year internal clock. This clock tells them it is “time to find another job.” It confuses him that people go through jobs in a short amount of time. He explains that this is largely due to the on boarding time: it takes a while for developers to go through this process.

Charles has switched jobs more frequently than Dave. He explains that his internal clock has been set of either by necessity or…

Cognito Blog 

How Gradual Verification Reduces Sign Up Abandonment

Reduced conversions with identity verification

If you're currently running identity verification on your users, you are probably leaving money on the table. Any person who begins the sign up process and leaves before becoming a user is lost revenue. In any relationship between a business and a customer, sign up abandonment can be thought of in the following terms:

If the perceived benefit that your customer will get from your product is less than the effort required to sign up, then they will abandon you.

The traditional method of identity verification whereby a company asks for, at a minimum, a customer's name, date of birth and address - and frequently also their Social Security Number - is onerous and time consuming for users…

Honeybadger Developer Blog 

New Features: Source Map Upload and More

Honeybadger now supports uploaded source maps via a new API. We've also added a UI to view source maps for each project, released a new version of honeybadger.js, and improved error grouping for JavaScript projects.
Black Bytes 

Practical Linked List in Ruby

This is the 3rd entry in the “Practical Computer Science in Ruby” series! Today we are going to talk about linked list. So what’s a linked list? Like the name says, a linked list is a way to store data in a list format (thanks, Captain Obvious!). The “linked” part comes from the fact that […]

The post Practical Linked List in Ruby appeared first on Black Bytes. Don't miss your free gift here :)

Hi, we're Arkency 

My fruitless, previous attempts at not losing history of changes in Rails apps

Some time ago I was implementing a simple Inventory with products that could be available, reserved and sold in certain quantities.

There were certain requirements that I tried to maintain:

  • having a history of operations so that we know where the numbers came from and so that we can do many kinds of reports
  • having an agreement between current state and the state computed based on history
  • making decisions based on current state instead of re-computing everything based on all historical operations (we don’t want to query thousands of historical DB records)

I was also experimenting with keeping the main business logic decoupled from DB and Active Record as well as a few more coupled…

Search Results for “ruby” – via @codeship 

Visual Testing with Percy and Codeship Basic

Reading Time: 2 minutes

At Codeship, we’re pleased to be able to integrate with several third-party products to make your CI/CD workflows that much smoother. For example, Percy, a visual testing platform, is one of our integration partners that adds extra functionality to your Codeship CI/CD pipelines. Here’s a brief overview of what you can accomplish when Codeship and Percy work together.

Codeship and Percy

Together, Codeship and Percy make a powerful combination — giving you full confidence in your app at every point of your development lifecycle.

Percy has first-class support for Codeship, supporting both Codeship Basic and Codeship Pro and automatically working with Codeship’s parallel…

Drifting Ruby Screencasts 

Restricting Access by IP Address

Learn to lock down your application or parts of your application by IP Addresses.
Giant Robots Smashing Into Other Giant Robots 

A Crash Course in Analyzing Memory Usage in Ruby

While working on a Rails app recently, a question came up around the right way to implement a feature, and whether the impact on memory usage was something to be concerned about. In looking into the question, I learned a little about analyzing memory usage in Ruby. In this article we’ll look through some of the possibilities.

The app handles a number of legacy URL paths, and redirects each one to a configurable location. This is implemented as a custom middleware. When the app boots we load the YAML configuration, which maps from legacy paths to new paths, into a hash (both keys and values are strings). When a request arrives, we look up the path in the hash, if an entry exists, return a…

Martian Chronicles 

Introducing <b>Overmind and Hivemind</b>

Authors: Andy Barnov, Writer at Evil Martians. Formerly international TV correspondent, now teaches Ruby and Rails basics to beginners. and Sergey Alexandrovich, Lead Developer at Evil Martians

Never mind your usual Procfile manager, here’s the Overmind and its little brother—Hivemind. Evil Martians use these tools built by Sergey Alexandrovich to manage Procfile-based applications for development. You may want to consider a switch too.

First, some history

First, there was rails s and then there was sidekiq, and then gulp, or webpack-dev-server, or whatever else you need to use your app in the development environment. Rarely in the jungle of the modern web a programmer can get away by…

Giles Bowkett 

Drive Refactors with a Git Pre-Push Hook

When I'm writing code, if I see something I want to fix, I write a quick FIXME comment. When I'm working on my own projects, this is no big deal. But I don't like adding FIXMEs to code at work, or in open source repos. And really, I prefer not to keep them hanging around in my own repos, either. So I set up a git pre-push hook. It looks like this:

 ᕕ(ᐛ)ᕗ cat .git/hooks/pre-push
#!/bin/bash

if ag fixme . -i --ignore tmp/ --ignore log/ --ignore node_modules/ --ignore vendor/; then
echo
echo 'not pushing! clean up your fixmes'
echo
exit 1
else
exit 0
fi

This code uses ag to make sure that there are no FIXMEs in my code, skipping dependency directories since they're not my problem, and either…
AkitaOnRails.com 

Why it is just lazy to bad-mouth Ruby on Rails

It's inevitable these days: we will see an article proclaiming the demise of Ruby on Rails every once in a while. It's the easiest click bait, like this one from TNW.

Now, you may say "another Ruby fanboy." That's fair, but a terrible argument, as it's a poor and common argumentum ad hominem. And on the subject of fallacies, the click-bait article above is wrong exactly because it falls for a blatantly Post hoc ergo propter hoc fallacy plus some more confirmation bias which we are all guilty of falling for all the time.

I'm not saying that the author wrote fallacies on purpose. Unfortunately, it's just too easy to fall for fallacies. Especially when everybody has an intrinsic desire to…

Riding Rails 

Rails 5.1.3 released

Hi everyone,

I am happy to announce that Rails 5.1.3 has been released.

CHANGES since 5.1.2

To view the changes for each gem, please read the changelogs on GitHub:

Full listing

To see the full list of changes, check out all the commits on GitHub.

SHA-256

If you’d like to verify that your gem is the same as the one I’ve uploaded, please use these SHA-256 hashes.

Here are the checksums for 5.1.3:

$ shasum -a 256…
Hi, we're Arkency 

My first 10 minutes with Eventide

Recently I find out about Eventide project and it looked really nice for me based on the initial documentation so I wanted have a small look inside. Here is what I found in a first few minutes without knowing anything about Eventide so far.

What’s Eventide?

Microservices, Autonomous Services, Service-Oriented Architecture, and Event Sourcing Toolkit for Ruby with Support for Event Store and Postgres

Sounds good to me!

File structure

My first thought was that there is quite interesting structure of directories:

lib/
├── account
│   ├── client
│   │   ├── controls.rb
│   │   └── namespace.rb
│  …
Search Results for “ruby” – via @codeship 

4 Ways to Secure Your Authentication System in Rails

Reading Time: 9 minutes

This article was originally published on Duck Type Labs by Sid Krishnan. With his kind permission, we’re sharing it here for Codeship readers.

Authentication frameworks in Ruby on Rails can be somewhat of a contentious topic. Take Devise, one of the more popular options, for example. Critics of Devise point out, perhaps rightly so, that there is a lack of clear documentation, that it is hard to understand, hard to customize, and wonder if we wouldn’t be better off using a different gem or even rolling our own custom authentication system. Advocates of Devise, on the other hand, point out that Devise is the result of years of expert hard work and that by rolling your…

The Bike Shed 

120: Free Apples

We do some follow-up on open source fundraising and discuss some interesting patterns in Derek's new client project.

Test Double | Our Thinking 

Shape Testing with JavaScript Streams and Lodash FP

Shape test changing data

Have you ever written an end-to-end test against a live API? I have, and it's hard. It's tough to do because the data returned from that live API is always changing. You can't rely on the values in your response because they change when real users actually use that thing you're testing against.

This example was created when I was writing a utility that requested information from a big data store, creating a set of JSON reports from the data. I wanted to write a test to ensure that my report was shaped correctly, aka, a shape test. The big data store was a clients internal API, so this shape test also protected me against changes to the API I'm integrating with.

Test…

Ruby Weekly 

#360: Is WEBrick Webscale?

This week's Ruby and Rails news
Read this e-mail on the Web Ruby Weekly Issue 360 — August 3, 2017
Richard Schneeman
A performance comparison between Nginx and WEBrick on a simple site. You might be surprised by the answer.


AppSignal Blog
Ruby provides tools that show how the code and its instructions will be provided to the YARV interpreter.


Eventide Project
A toolkit for building a distributed and evented infrastructure that includes commands, events, projections, and support for PostgreSQL and Event Store.


VividCortex  Sponsored
Hi, we're Arkency 

When DDD clicked for me

It took me quite a time to grasp the concepts from DDD community and apply them in our Rails projects. This is a story of one of such “aha” moments.

Imagine a scenario which goes like this:

  • payment is paid
    • this is simple
    • just a callback from a payment gateway
    • verified based on ip or token
  • mark payment as successful

but it triggers a shitload of effects:

  • changes in Orders
  • generating tickets
  • generating PDFs
  • changing reporting
  • validating additional domain rules, coupon usage
  • etc, etc

In another project that I worked on, the effects of a successful payment were:

  • giving access to purchased video content
  • changing reporting
  • recomputing average ratio of virtual platform currency to…

In both cases, the teams experienced the same…

Semaphore Engineering Blog 

Tips on Treating Flakiness in your Rails Test Suite

Tips on Treating Flakiness in your Rails Test Suite

To say that flaky tests are annoying is to put it mildly. They can decimate both a developer's time and productivity, are notoriously difficult to deal with, and are unfortunately a reality of software development.

Our collegues have written more general posts in the past about dealing with flaky tests and why it is important. I would encourage you to read them. On the other hand, I will be focusing on sharing the experience I have gathered after about a year of dealing with flaky tests while working on a Rails application.

While there can be various sources of inconsistent behaviour, in this article I will focus on those with which I have the most practical experience, and…

Honeybadger Developer Blog 

New monitoring feature: Check-Ins

Check-Ins allow you to monitor jobs and services by pinging a Honeybadger URL periodically. If you ever stop "checking in", Honeybadger will alert you.
Greater Than Code 

041: Cognitive Behavioral Therapy and Mind Manipulation with Casey Watts!

This episode is sponsored by Upside!

Bundle your flights and hotel. Save money. Earn gift cards.

Panelists:

Jessica Kerr | Coraline Ada Ehmke | Sam Livingston-Gray | Janelle Klein

Guest Starring:

Casey Watts!: @kyloma | caseywatts.com

caseywatts.com/mindmanipulation

A Neurobiologist’s Guide to Mind Manipulation  [slides]

Show Notes:

00:16 – Welcome to “CBT: Chunky Bacon Tacos and Psychological Safety” …we mean, “Greater Than Code!”

01:18 – Empathy Development

03:25 – Training for Customer Support

Greater Than Code Episode 037: Failure Mode with Emily Gorcenski

A Neurobiologist’s Guide to Mind Manipulation by Casey Watts @ EmberConf 2017

06:53 Cognitive Behavioral Therapy (CBT)

Coralin…

Depfu 

Bundler and private dependencies

As soon as you start using private Github repos in your Gemfile you have to figure out how Bundler can access them. This is super easy on your local machine, as Bundler just uses your credentials, so if you can access the repo, so can Bundler.

Things get a bit trickier when you want to use a CI service like Travis or when you want to deploy your app to production.

Since we needed to support private dependencies in Depfu I looked at how to implement it and was actually surprised how many different ways there are. Let’s have a look:

Let’s transport some Git

There are 3 different transport mechanisms you can use for your Git repos:

GIT
gem 'rails', git: 'git://github.com/rails/rails.git'
Search Results for “ruby” – via @codeship 

Advanced Enumeration with Ruby

Reading Time: 9 minutes

Enumeration by definition is “the action of mentioning a number of things one by one.” In programming, instead of mentioning, we choose any action we may want to perform, whether it simply be printing out the item to a display or performing some sort of selection and/or transformation on the item.

In programming, we can perform many ways to select and process a collection at one time by chaining on each additional transformation in steps. And each step can either consume the entire collection before handing the results off to the next step, or it can be handled “lazily” and pass one or more items at a time through all the transformations.


“The possibilities are…

Virtuous Code 

Riffing on `interpose` implementations in Ruby

I very much enjoyed Brian Cobb’s step-by-step translation of the Clojure

interpose
  function to Ruby. I too agree that

interpose
  would be a handy method to have around.

As a quick TL;DR: interpose is kind of like

Array#join
 , except that it produces a sequence instead of a string.

[1, 2].interpose(:sep).to_a
# => [1, :sep, 2]

Brian’s solution works by building an Enumerator.

module Enumerable
  def interpose(sep)
    Enumerator.new do |y|
      items = each

      loop do
        begin
          y << items.next
        rescue StopIteration
          break
        end

        begin
          items.peek
        rescue StopIteration
          break
        else
          y << sep
       …
All Ruby Podcasts by Devchat.tv 

MRS 014 My Ruby Story Noel Rappin

MRS 014 Noel Rappin

Today's episode is a My Ruby Story with Noel Rappin. Noel talked about his contributions to the Ruby community and how they explore new technologies like Elixir. Listen to learn more about Noel!

[00:01:40] – Introduction to Noel Rappin

Noel is in episodes 30, which was about Software Craftsmanship. He was also on episode 185, which was about Rails 4 Test Prescriptions. And then, the latest one was 281, which was about Take My Money.

[00:02:45] – How did you get into programming?

Noel is a stereotypical nerdy kid so he started programming when he was young. He had afterschool classes in Applesoft BASIC at a place near their house. He had TRS-80 and Texas Instruments,…

bogdanvlviv (Bogdan) 

... with __dir__ we can restore order in the Universe

“Defining paths relative to a file name has always hurt my soul, with __dir__ we can restore order in the Universe.” - by @fxn.

This post about the method in Ruby Programming Language Kernel#__dir__ and restoring order in the Universe.

Let’s take a look at the method Kernel#__dir__.

__dir__ => string

Returns the canonicalized absolute path of the directory of the file from which this method is called. It means symlinks in the path is resolved. If __FILE__ is nil, it returns nil. The return value equals to File.dirname(File.realpath(__FILE__)).

This method was introduced in Ruby since version 2.0.0 (NEWS for Ruby 2.0.0).

More info about development of Kernel#__dir__

Schneems - Programming Practices, Performance, and Pedantry 

Is WEBrick Webscale?

WEBrick is the “slowest” webserver in Ruby, how could it possibly be webscale? To answer this question and explore Is Ruby Too Slow For Web-Scale?, we will compare WEBrick to a real piece of “webscale” tech: NGINX.

GoRails Screencasts 

Geolocation and Search with Geocoder

Geolocate addresses using the geocoder gem and then use it to search your database by location
BigBinary Blog 

Avoid exception for dup on Integer

This blog is part of our Ruby 2.4 series.

Prior to Ruby 2.4, if we were to dup an Integer, it would fail with a TypeError.

> 1.dup
TypeError: can't dup Fixnum
	from (irb):1:in `dup'
	from (irb):1

This was confusing because Integer#dup is actually implemented.

> Integer.respond_to? :dup
=> true

However, if we were to freeze an Integer it would fail silently.

> 1.freeze
=> 1

Ruby 2.4 has now included dup-ability for Integer as well.

> 1.dup
=> 1

In Ruby, some object types are immediate variables and therefore cannot be duped/cloned. Yet, there was no graceful way of averting the error thrown by the sanity check when we attempt to dup/clone them.

So now Integer#dup functions exactly…

Ruby Magic by AppSignal 

A look at how Ruby interprets your code

Welcome to a new Ruby Magic article! This time we’ll be looking at how Ruby interprets our code, and how we can use this knowledge to our advantage. This post will help you understand how code is interpreted, and how this can help lead to faster code.

A subtle difference between symbols

In a previous Ruby Magic article about Escaping characters in Ruby there was an example about escaping line breaks.

In the example below you see how two strings are combined as one String across multiple lines, with either the plus + symbol or with the backslash \.

1
2
3
4
5
6
7
8
9
"foo" +
  "bar"
=> "foobar"

# versus

"foo" \
  "bar"
=> "foobar"

These two examples may look similar, but they behave…

All Ruby Podcasts by Devchat.tv 

RR 321: Visual Studio Code Ruby Plugin with Penn Lv

RR 321: Visual Studio Code Ruby Plugin with Penn Lv

This episode of Ruby Rogues features panelists Dave Kimura, Brian Hogan, and Charles Max Wood. Two special guests join the panel today: Eric Barry and Penn Lv. Tune in and learn more about Visual Studio Code’s Ruby Plug-in!

[00:01:55] Introduction to Eric Barry
Eric turned over Teach Me To Code to Charles, which helped build relationships for Charles that built the Ruby Rogues podcast. Eric is a software engineer who has been working in programming since 1998. He works for Skipio and has been a Ruby on Rails developer for nine years.

[00:03:15] Introduction to Penn Lv
Penn is a software engineer for Redim. He works on the Ruby extension…

Test Double | Our Thinking 

Looking for Failure

Failures are interesting. They tend to teach lasting personal lessons, but we are loath to share them. These lessons have profound impacts on our habits and viewpoints, but they're difficult to recount. We need to get comfortable talking about failure. Unfortunately, our brains are wired to screw this up. When confronted with a failure, we are conditioned to ignore it, make ourselves blameless, or create elaborate strategies to avoid the possibility of failure altogether. I’d like to present another alternative: embrace failure. It will happen. That’s ok.

How can we challenge our natural human bias? I've spent the last couple years digging into "pop" psychology and thinking about how…

Riding Rails 

Rails 5.0.5 and 5.1.3.rc3 released

Hi everyone,

I am happy to announce that Rails 5.0.5 and 5.1.3.rc3 have been released.

If no regressions are found for 5.1.3.rc3, expect the final release on Thursday, August 3, 2017. If you find one, please open an issue on GitHub and mention me (@kaspth) on it, so that we can fix it before the final release.

CHANGES since 5.0.4

To view the changes for each gem, please read the changelogs on GitHub:

Full listing

To see the full list of changes, check out all the…

zverok with ruby 

The case study for The Last API Wrapper

TL;DR: This post shows why you probably should consider using “The Last API Wrapper” next time you need to get something from HTTP API.

GIPHY’s API is taken as an example.

Preface

Idea of this example was born when I’ve seen recently created giphy_api gem. I don’t want to offend author of this (clean and well designed) gem in any way, but it inspired me to show an example of what it takes to create API wrapper from scratch, even for simple API, and what other options we can have.

giphy_api’s lib folder contains 300 lines of code in 13 files. It follows usual best practices for this kind of gems:

  • defines its own Connection abstraction (wrapper around HTTP client);
  • defines its own…
Drivy Engineering 

Best Practices for Large Features

As developers, we sometimes find ourselves faced with feature requests that will take weeks of work and touch many areas of the codebase. This comes with increased risk in terms of how we spend our time and whether things break when we come to release.

Examples might be moving from a single to multi-tennant application (scoping everything by accounts), or supporting multiple currencies or time zones. This post brings together some tips that we find useful at Drivy for approaching these types of problems.

In general, our goals are to build the right thing, take the right implementation approach, and not to break anything. We’d like to try to do those things pretty quickly, too!

Building…

Ruby Inside - Medium 

A Deep Dive into CSRF Protection in Rails

If you’re using Rails today, chances are you’re using CSRF protection. It’s been there almost since the beginning, and it’s one of those features in Rails that makes your life easier without needing to give it a second thought.

Briefly, Cross-Site Request Forgery (CSRF) is an attack that allows a malicious user to spoof legitimate requests to your server, masquerading as an authenticated user. Rails protects against this kind of attack by generating unique tokens and validating their authenticity with each submission.

Recently, I was working on a feature at Unbounce that required me to think about CSRF protection and how we were handling it in client-side Javascript requests. It was then that…

Drifting Ruby Screencasts 

Custom Error Pages with Slack Notification

Learn to use custom error pages to provide a similar look to your application. Get notified on Slack as errors occur to act on them before they're reported.
The Life of a Radar 

Joy of Elixir

I've been using Elixir at work professionally for the past year and more recently I've been starting to do some mentoring around Elixir. I've noticed that while there are some very solid intermediate books/resources like Getting Started guide on elixir-lang.org the Programming Elixir book and even Elixir School, there doesn't seem to be anything at all book-wise directed at newbies.

So I decided to write a little book called Joy of Elixir.

Joy of Elixir avoids assuming knowledge of anything about programming while teaching people about their first programming language: Elixir.

Shut up and take my money!

This book is available for free online (under the CC-BY-SA 4.0

Riding Rails 

New releases, bugfixes and more than 30000 issues/PRs!

Hello everyone! This is Prathamesh with the latest news from the Rails world.

Rails 5.1.3.rc2 and 5.0.5.rc2 released

Two new release candidates has been released this week, if there are no regressions found, the final releases are coming next week! We said it last week as well 😁

This Week’s Rails contributors!

27 people helped to make Rails better this week with 7 of them for the first time! If you want to be one of them, checkout the issues list, help is always welcomed!

Rails crosses 30000 issues/PRs on GitHub

As of this writing the count is increased to 30004. 28805 of all of these issues and PRs have been processed already! That’s pretty awesome 🎉

Let Arel manage the bind params

Ruby Inside - Medium 

Asynchronous Elasticsearch bulk reindexing with Rails, Searchkick and Sidekiq

Another day, another task. Last year I’ve created a Elasticsearch cluster, but it was sitting around without any data because other projects had higher priority. But last week I finally had the opportunity to use the cluster. After some research I decided to use the Searchkick library for Ruby on Rails. This post will describe how I used Searchkick and Sidekiq to import all our data into Elasticsearch. By the way, Searchkick and Sidekiq are awesome!

In my case we needed to store the data of three Rails models in Elasticsearch; Users, Projects and Assets. Combined these models account for about 40 million records. All the models will use custom ‘search data’ as described in the documentation

All Ruby Podcasts by Devchat.tv 

RR 317: Computer Science at University and the Future of Programming with Dave Thomas

RR 317: Computer Science at University and the Future of Programming with Dave Thomas

Charles Max Wood interviews Dave Thomas about the Computer Science course he's teaching at Southern Methodist University, Elixir, and the future of programming. Dave is the author and co-author of several well known programming books including Programming Ruby (also known as the PickAxe Book), Programming Elixir, and the Pragmatic Programmer. This episode starts out discussing Dave's course and Computer Science education, then veers into Elixir and the future of programming. Tune in to hear where Dave thinks the programming industry is heading next.

[00:02:30] Dave's Computer Science Course at SMU 
Dave'…

Olivier Lacan 

Keep a Changelog 1.0

Keep a Changelog Badge

After years of small improvements and two years since the last minor release, Keep a Changelog finally reached version 1.0 today.

What's new? Well, read the changelog!

In short we have 6 new language translations, simplified version-aware language navigation, much clearer and succinct sections that describe the What, Why, and Who of changelogs, and a lot of refinements.

For people who like clear guidelines, there are now guiding principles that summarize the key components of good changelogs. There's also a section about changelog bad practices to help your friendly maintainers understand that a git log dump doesn't helping anyone.

Finally, we now document changelog maintenance…

All Ruby Podcasts by Devchat.tv 

MRS 013 My Ruby Story Dave Thomas

MRS 013 – Dave Thomas

This episode is a My Ruby Story with Dave Thomas. Dave has spoken about Elixir at two Ruby Remote Confs. He challenges the way people think about the way they do code. Listen to learn more about Dave!

[00:02:42] How did you get into programming?

Dave first got into programming when he was attending school in England. At the age of sixteen everyone takes national tests. A group of friends and Dave took these tests early so they did not have classes to take spring semester. Their school decided to send them to take a computer science class at a nearby technical college. There he fell in love with programming and decided to switch his focus in college. He went to…

All Ruby Podcasts by Devchat.tv 

RR 320 Shrine and File Uploads with Janko Mahronic

RR 320: Shrine and File Uploads with Janko Mahronic

Jerome Hardaway, Dave Kimura, and Charles Max Wood discuss Shrine with Janko Mahronic on this episode of Ruby Rogues. Janko is a Ruby developer. He is the creator of Shrine, which handles file uploads. Shrine tries to solve existing problems and gives many ways to upload files. It tries to accommodate and provide every option for whichever types of file you may be uploading. Tune in to find out more about Shrine!

Questions

[00:03:56] What does Shrine do that CarrierWave doesn’t do?
One of the main reasons Shrine was created was to support background jobs. CarrierWave was missing support for background jobs. There is a CarrierWave…

Ruby Weekly 

#359: Realtime with React and Rails

This week's Ruby and Rails news
Read this e-mail on the Web Ruby Weekly Issue 359 — July 27, 2017
Leigh Halliday
To showcase using ActionCable in a Rails app with React, let’s explore how to use Rails, React, MobX, and websockets in a realtime location app.


Rahul Mahale
Kubernetes offers readiness probes and rolling updates to make sure your app is always serving requests during a new deployment.


Marc Anguera
A mountable engine that provides a browser-based preview of mail templates, as well as being able to send test mails.


ROLLBAR  Spo…
Devon C. Estes - Articles 

A Big Elixir Refactoring

I’ve just finished my first really substantial refactoring of someone else’s code in Elixir. I wanted to make some changes to Benchee so that it would be easeir to add another feature later on. We needed a new data model, and there were some concepts that I felt needed a little shaking out and naming. Today I’m going to cover some of the reasons for this refactoring, as well as some of what I learned both specifically and in general about refactoring in Elixir.

Semaphore Engineering Blog 

What's the Difference Between Continuous Integration, Continuous Deployment and Continuous Delivery?

Visualizing continuous integration, continuous delivery, and continuous deployment View diagram in full screen

Continuous integration, continuous deployment, and continuous delivery are like vectors that have the same direction, but different magnitude. Their goal is the same: make our software development and release process faster and more robust.

The key difference between the three is in the scope of automation applied. What gets people who are new to the field confused is that they are not mutually exclusive, but include each other, like Russian dolls.

The nucleus: continuous integration

Most developers start with Continuous Integration (CI), which is about everyone merging code changes to a central repository multiple times a day.…

Schneems - Programming Practices, Performance, and Pedantry 

OMG OMSCS: Is an Online Masters right for You?

Ever wonder if you should go back to school to get a master’s degree? Right now I’m in my second semester of Georgia Tech’s Online Master of Science in Computer Science (OMSCS). I’ve had a few people ask about my experiences so I figured it was worth my time to write them down. In this post I’ll be going back and forth, question and answer style to share my thoughts on the program.

Search Results for “ruby” – via @codeship 

Monitoring Your Synchronous Python Web Applications Using Prometheus

Reading Time: 9 minutes

As soon as we deploy any nontrivial web application, or any software application for that matter, we soon (or should) become interested in how this application is performing in the wild. If it’s a web application, we want to know how many requests we are receiving, how much time is spent serving a request on average and so on.

These numbers, more commonly referred to as metrics, help us understand the behavior of our application, identify unexpected behavior, and scale up or down the underlying software infrastructure to ensure the best possible experience for the application’s consumers, as well as utilize the system infrastructure judiciously.

We will be discussing…

Tech Tips and Freebies – Rubyroid Labs Blog 

Rails 5.1.3.RC1 and 5.0.5.RC1 Have Been Released

Reading Time: 1 minute

Rails has issues 2 new RC1 versions for all Rails-lovers. Let’s have a look, what has changed in Rails 5.1.3.RC1 and 5.0.5.RC1 since the previous releases.

Rails 5.1.3.RC1 Release

Though Rails 5.1.3.RC1 can’t boast of many changes introduced, some of them are really important. They are related to the following gems:

Active Record

In the previous versions, if you created records via has_many :through and then deleted child records before parent record if saved, child records would persist. Starting from Rails 5.1.3.RC1 release this has been fixed.
Besides, current_scope of a target model will no longer affect Relation#joins except for the case with unscoped

Railties

In…

Greater Than Code 

040: F*ck It And Be Nice

* Extra super disclaimer: This episode contains a lot curse words.

Panelists:

Jessica Kerr | Jamey Hampton | Mandy Moore

Guest Starring:

Jenn Schiffer: @jennschiffer | jennmoney.biz | Glitch and Jessica Lord: @jllord | MongoDB

Show Notes:

00:16 – Welcome to “The Upcoming Release of the iPhone 4!” …we mean, “Greater Than Code!”

01:36The Tweetstorm that Started it All

04:29 – Our Communication Skills and Curbing the Snobbery

Greater Than Code Episode Episode 020: Sexuality in Tech with Jenn Schiffer

 

Greater Than Code Episode Episode 039: The B-Side of Software Development…

The Bike Shed 

119: Questions Are For the Weak (Caleb Thompson & Matt Mongeau)

Sean and Derek are joined by Caleb Thompson and Matthew Mongeau for our annual live episode to discuss lessons learned from past projects, and speaking at conferences.

Riding Rails 

Rails 5.0.5.rc2 and 5.1.3.rc2 have been released

Hi everyone,

I am happy to announce that Rails 5.0.5.rc2 and 5.1.3.rc2 have been released.

If no regressions are found, expect the final release on Monday, July 31, 2017. If you find one, please open an issue on GitHub and mention me (@kaspth) on it, so that we can fix it before the final release.

CHANGES since 5.0.4

To view the changes for each gem, please read the changelogs on GitHub:

Full listing

To see the full list of changes, check out all the commits…

BigBinary Blog 

Deploying Rails applications on Kubernetes cluster with Zero downtime

This post assumes that you have basic understanding of Kubernetes terms like pods and deployments.

Problem

We deploy Rails applications on Kubernetes frequently and we need to ensure that deployments do not cause any downtime. When we used Capistrano to manage deployments it was much easier since it has provision to restart services in the rolling fashion.

Kubernetes restarts pods directly and any process already running on the pod is terminated. So on rolling deployments we face downtime until the new pod is up and running.

Solution

In Kubernetes we have readiness probes and liveness probes. Liveness probes take care of keeping pod live while readiness probe is responsible for keeping…

This is what…

Search Results for “ruby” – via @codeship 

Modeling has_many Relationships with DynamoDB

Reading Time: 8 minutes

Recently our team had the requirement of storing data coming from sensors, and we chose DynamoDB for its ability to handle a massive amount of data efficiently. As a fully managed NoSQL database service with the promise of high-performance and scalability, DynamoDB was a perfect choice.

Coming from a strong SQL background and being a fan of using ORM such as Active Record, adapting to the NoSQL mindset gave me an opportunity to rethink and explore the capabilities of NoSQL. But soon I realized that normalization is not always the right choice in the case of NoSQL databases. And more important, handling relations is a bit different.


“Adapting to a NoSQL mindset gives…

All Ruby Podcasts by Devchat.tv 

RR 319 Machine Learning with Tyler Renelle

RR 319 Machine Learning with Tyler Renelle

This episode of the Ruby Rogues Panel features panelists Charles Max Wood and Dave Kimura. Tyler Renelle, who stops by to talk about machine learning, joins them as a guest. Tyler is the first guest to talk on Adventures in Angular, JavaScript Jabber, and Ruby Rogues. Tune in to find out more about Tyler and machine learning!

What is machine learning?

Machine learning is a different concept than programmers are used to.

There are three phases in computing technology.

  • First phase – building computers in the first place but it was hard coded onto the physical computing machinery
  • Second phase – programmable computers. Where you can reprogram…
All Ruby Podcasts by Devchat.tv 

MRS 012 My Ruby Story Simon Moro

MRS: 012 Simon Moro

This episode is a My Ruby Story with Simon Moro. Simon is an Australian record producer and mixer. He has been teaching himself Ruby for the last 18 months, Rails framework, and is a frustrated aspiring entrepreneur. Through negative experiences with outsourcing and finding tech co-founders, he wanted to empower and educate himself.

How did you get into programming?

He remembers that the first computer in his home was actually called a dinosaur. His first experience with a computer made him intrigued. He was a lot of gaming consoles when he was young. Personally liked Sega and his best friend liked Nintendo. It was like an early Apple vs. Android rivalry.

He was…

Black Bytes 

The Ultimate Guide to Ruby Sorting

How many ways are there to sort an array in Ruby? More than you think… …even though Array only has two sorting methods (sort & sort_by) these methods can take a block, which allows you to sort in several different ways. I want to share with you a few examples in this post. You will […]

The post The Ultimate Guide to Ruby Sorting appeared first on Black Bytes. Don't miss your free gift here :)

Test Double | Our Thinking 

Remote Pairing with Tmate and Tmux

Here's the situation.

You LOVE tmux, and you use it all the time to organize your terminal and create a workspace. You've created a new tmux session where you will do your work named funproject.

tmux new-session -s funproject

Then you've created a bunch of windows, splits, and running processes, and now you would like to pair.

Possible solutions

💔 Jump Box You could set up a jump box to allow a remote pair to ssh directly into your machine. This uses ssh to create a reverse tunnel to the public jumpbox, exposing your ssh port to your pair, who connects with an ssh key. This solution is secure, but it's complicated to set up. You'll also need to pay for a public jump box on Digital Ocean…

Ruby News 

Nominations now being accepted for Ruby Prize 2017

We are very pleased to announce you that Ruby Prize will be held this year!

The Ruby Prize is given to recognize the efforts of remarkable activities and achievements in the Ruby Community. The prize will be awarded by the executive committee comprised of three parties, the Ruby Association, Nihon Ruby no Kai and Matsue City.

The Ruby Prize winner and final nominee (1-2 people) will receive an award at the RubyWorld Conference 2017, to be held in Matsue, Japan on November 1st & 2nd.

In addition, the Ruby Prize winner will also be awarded 1 million yen. Yay!

Nominees will be selected by the following:

  • Recommendations from the “Prize Member” executive committee
  • Recommendations from…

Please see below for more…

Drifting Ruby Screencasts 

Benchmarking and Refactoring the content_for View Helper

In a recent blog post, we looked into the content_for view helper to render breadcrumbs. Once we got the feature working, it's time to refactor the feature to lower technical debt.
Riding Rails 

New releases, bugfixes and more!

Hello everyone! This is Greg with the latest news from the Rails world.

Rails 5.1.3.rc1 and 5.0.5.rc1 released

Two new release candidates has been released this week, if there are no regressions found, the final releases are coming next week!

This Week’s Rails contributors!

28 people helped to make Rails better this week. If you want to be one of them, checkout the issues list, help is always welcomed!

Add bootsnap to default Gemfile

The bootsnap gem helps to boot a Rails application faster, and the gem is now part of the Rails default Gemfile.

Allow to pass a connection to the dbconsole command

With this change the dbconsole command can except a connection parameter, so if you are…

Drifting Ruby 

Hacking content_for to create a simple display helper

Update: Check out https://www.driftingruby.com/episodes/benchmarking-and-refactoring-the-content_for-view-helper for a screencast update to this article where things are refactored to reduce technical debt.

So, this isn’t probably even the best way to do this, but I was playing around in a side project and wanted to see what I could do to have some consistency throughout my application; specifically around the breadcrumbs.

So on this project, I have breadcrumbs whose HTML looks something like this. There’s nothing fancy going on here, just some simple HTML. However, this would not be pretty, nor DRY, to repeat this throughout every single page of my project.

<nav class="breadcrumb">
  <a…
NRoweGT: Atlanta Ruby on Rails Consultancy 

Add Output to Your Long Running Rake Tasks

Expectations vs Reality

Have you ever worked on an item, tested it thoroughly on a staging environment, done extra dry runs for good measure, been completely satisfied with the results, only to have it hit production and you have no idea whether it’s working properly? I had such an experience recently with a one-off rake task. The following details that, along with what I learned and how to prevent it from happening to your projects. Chalk up another lesson about what it means for a feature to be complete

The Task

Recently I was involved on a team project around developing ingestion and display of user data. The basic process was this:

  • Get a list of all the objects from an S3 bucket
NRoweGT: Atlanta Ruby on Rails Consultancy 

Developers and Systems vs Goals

Systems and Goals

For most developers, our days is composed of accomplishing individual tasks, which makes it very easy to get lost in those details and solely focus on what’s at hand rather than the direction in which accomplishing that takes us. Rather than focusing on each step or feature as an individual item to accomplish, I say that it’s best to reframe each of them instead as a small step in the right direction.

Don’t Lose Sight of the Forest for the Tree in Front of You

“Don’t lose sight of the forest for the trees” is a common saying. It means that you shouldn’t let what’s right in front of you make you forget the big picture. Letting individual tasks own your thoughts is…

Ruby Weekly 

#358: How I Reduced My DB Server Load by 80%

This week's Ruby and Rails news
Read this e-mail on the Web Ruby Weekly Issue 358 — July 20, 2017
Richard Schneeman
How one line, hidden in a common ActiveRecord validation, caused large spikes in database response time and what to do about it.


Tom Van Eyck
A complete rundown of mutexes, condition variables, and how to use them together to write efficient threading code in Ruby.


Simple Programmer  Sponsored
Technical knowledge alone isn't enough—increase your income by leveling up your "soft skills." Learn new skills faster,…
Test Double | Our Thinking 

Tame the frontend with Elm

The video above was recorded at Fluent Conf 2017.

We're excited about Elm at Test Double. Elm is a functional programming language that compiles to JavaScript and promises robust frontend web apps by preventing runtime exceptions. Elm's type system helps you thoughtfully design applications, and its compiler guides you confidently through refactors with helpful error messages.

In this talk, I share the benefits of building applications with Elm while also diving into its syntax and functional programming concepts. In addition to no runtime exceptions, Elm touts:

  • Being as fast as the big JavaScript frameworks such as React and Angular
  • Safer null handling with the built-in Maybe type
  • No…
Hi, we're Arkency 

How to quickly add graphs and charts to Rails app

When how to visualize data in your Rails app there are certain factors that you need to consider.

  • Static graphs which generate images are out of question. They are not any simpler to use, install or maintain and are less usable. The ability to toggle and highlight is just a necessity in XXI century. Thus our options are limited to charts generated with JavaScript.
  • You are probably working for a startup with monetary constraints so using libraries which cost $200 is something might want to avoid.
  • You would prefer something looking good out of the box, which can also be easily styled by designers to follow the look&feel of the whole app.
  • You would like something maintained so it continues…

I am gonna propose you use Google Charts. Interactive and maintained by Google.

Model + SQL

class Order < ApplicationRecord
  def self.totals_by_year_month
    find_by_sql(<<-SQL
      SELECT
        date_trunc('month', created_at) AS year_month,
        sum(amount) as amount
      FROM orders
      GROUP BY year_month
      ORDER BY year_month, amount
      SQL
    ).map do |row|
      [
        row['year_month'].strftime("%B %Y"),
  • date_trunc is a PostgreSQL function which truncates the date to certain precision.

This methods returns the data in format such as:

[
  ["July 2017", 346.0],
  ["July 2016", 50.0],
]

Obviously it is up to you what data and how you want to visualize :) This…

Hi, we're Arkency 

nil?, empty?, blank? in Ruby on Rails - what's the difference actually?

There are plenty of options available. Let’s evaluate their usefulness and potential problems that they bring to the table.

nil?

  • Provided by Ruby
  • Can an be used on anything
  • Will return true only for nil
nil.nil?
# => true

false.nil?
# => false

0.nil?
# => false

"".nil?
# => false

empty?

  • Provided by Ruby
  • Can be used on collections such as Array, Hash, Set etc. Returns true when they have no elements.
[].empty?
# => true

{}.empty?
# => true

Set.new.empty?
# => true
  • but it is not included in Enumerable. Not every object which iterates and returns values knows if if it has any value to return

fib = Enumerator.new do |y|
  a = b =
Riding Rails 

Rails 5.1.3.rc1 and 5.0.5.rc1 released

Hi everyone,

I am happy to announce that Rails 5.1.3.rc1 and 5.0.5.rc1 have been released.

If no regressions are found, expect the final releases Monday, July 24, 2017. If you find one, please open an issue on GitHub and mention me (@kaspth) on it, so that we can fix it before the final release.

CHANGES since 5.1.2

To view the changes for each gem, please read the changelogs on GitHub:

Full listing

To see the full list of changes, check out all the commits on GitHub

SHA-256

If you’d like to…

Hi, we're Arkency 

Monitoring Sidekiq queues with middlewares

Sidekiq, similarly to Rack, has a concept of middlewares. A list of wrappers around its processing logic that you can use to include custom behavior.

In chillout we use it to collect and send a number of metrics:

  • how long did it take to process a job

    Obviously it is nice to notice when a certain jobs starts to work much slower than usually.

  • how long did it take between scheduling a job and starting a job

    This is useful to know if your Sidekiq workers are not saturated. Ideally the numbers should be around 1-2ms, which means you are processing everything as it comes and have no delay.

    Depending on what your application does a second or two of a delay might be good enough as well.…

Devon C. Estes - Articles 

Patronizing Open Source

In this week’s episode of The Bikeshed, Sean Griffin went through some of his issues with funding open source work through services such as Patreon, which allow individuals or companies to contribute to an individual or group on a recurring (usually monthly) basis. Well, all this talk of open source and money got the amateur economist in me thinking, so here’s my take on the topic.

Blog - Sandi Metz 

Why We Argue: Style

This post originally appeared in my Chainline Newsletter.


I've been thinking about why we argue about code, and how we might transform vehement differences of opinion into active forces for good.

My thoughts spring from a very specific context. Ten or twelve times a year I go to an arbitrary business and spend three or more days teaching a course in object-oriented design. I'm an outsider, but for a few days these business let me in on their secrets.

Here's what I've noticed. In some places, folks are generally happy. Programmers get along. They feel as if they are all "in this together." At businesses like this I spend most of my time actually teaching object-oriented design.

Othe…

Schneems - Programming Practices, Performance, and Pedantry 

How I Reduced my DB Server Load by 80%

Database load can be a silent performance killer. I’ve been optimizing the query performance of a web app I run designed to get people involved in open source, but was seeing random spikes of query times to 15 seconds or more. While I had been seeing this behavior for some time, I only recently began tuning my database queries. You can read about my efforts to First I sped up my home page with some indexes (and Rack Mini Profiler). Then I tracked down and killed some expensive queries. After these major improvements the average response time was around 50ms and my perc95 was under 1 second. Yet, I had this annoying issue where in a 24 hour period, my perc95 response times would shoot up to…

Search Results for “ruby” – via @codeship 

The Ultimate Guide to API Design

Reading Time: 15 minutes

This article was originally published on Quantum Mog’s Blog by Erich Reich, and with their permission, we are sharing it here for Codeship readers.

So you need to design an API. Where do you start? Far too often internal services slowly turn into APIs. Hacked together one endpoint at a time. These undocumented spaghetti monsters just pile up technical debt and create enormous knowledge hurdles for new developers to scale over. This article is designed to help you either start with a good footing from scratch or to refactor your existing API into something far more manageable.

Task Automators

A small detour, but it’s always better to ask the tough questions first. D…

Search Results for “ruby” – via @codeship 

Realtime with React and Rails

Reading Time: 11 minutes

When I was thinking about creating something to showcase using ActionCable (websockets) in a Rails app with React, I first thought of building a chat. But everybody builds a chat. So next, I thought about a realtime dashboard. But then I realized I had no data in this demo app with all but one user (me). So I decided to build a realtime map application that allows you to broadcast your location to anyone you wish.

In this article, we’ll explore how to use Rails, React (via react_on_rails gem), MobX, and websockets (via ActionCable). The demo app can be found here. The full repository can be found here.


“Showcasing ActionCable in a Rails app with React” via…

The Miners - Medium 

How to Organize your Styles with ITCSS

A sane, scalable, managed CSS architecture.

Everyone knows how CSS can be painful when not written properly. It is not an expressive language, it has a global scope, cascading rules (the source order really matters), inheritance, and selector specificity wars. The way CSS works makes it easy for bad code to take over. It is possible to use nested selectors to override existing rules, use !important to quickly solve a styling problem, write CSS to undo other CSS, and so on.

If you want to know more about how CSS works, read this.
The selectors specificity war

These issues are especially recurring on large projects with lots of developers involved. If we do not understand their impact, our…

BigBinary Blog 

Rails 5.1 returns unmapped timezones from ActiveSupport::TimeZone.country_zones

This blog is part of our Rails 5.1 series.

The ActiveSupport::TimeZone class serves as wrapper around TZInfo::TimeZone class. It limits the set of zones provided by TZInfo to smaller meaningful subset and returns zones with friendly names. For example, TZInfo gem returns “America/New_York” whereas Active Support returns “Eastern Time (US & Canada)”.

ActiveSupport::TimeZone.country_zones method returns a set of TimeZone objects for timezones in a country specified as 2 character country code.

# Rails 5.0
>> ActiveSupport::TimeZone.country_zones('US')

=> [#<ActiveSupport::TimeZone:0x007fcc2b9b3198 @name="Hawaii", @utc_offset=nil, @tzinfo=#<TZInfo::DataTimezone: Pacific/Honolulu>>,…
The Bike Shed 

118: Nonsense In, Nonsense Out

We discuss the economics of remote work, ActionDispatch::SystemTest in RSpec, and the use of Patreon on open source projects.

Semaphore Engineering Blog 

A First Look at Semaphore's New API Specification Semantic

We've recently started redesigning Semaphore's public API, and we've established some general guidelines and semantics for elements in the URI path. A good understanding of URI path element semantics can ease API usage, so we are presenting it here.

Our journey started with a few simple questions:

  • How should we organize the resources?
  • How deep should the URL hierarchy be?
  • Should all elements the system operates on be exposed (more-or-less the way they are represented in the DB), or should there be some layer of abstraction? Also, if we opt for the abstraction layer, which 'abstract' elements should map to which 'less abstract' elements, and how?

API Structure

The initial idea was to…

The Miners - Medium 

The Good, The Bad, and The Ugly of TypeScript

Is TypeScript really worth it?

Over the last few months, I’ve been working in a couple of Node.js projects written in TypeScript, and it was a bumpy road to follow with ups and downs. What I aim to answer here in this post is: in the end, is it worthy to use TypeScript?

The Good

Let’s start with the upsides!

TypeScript is a superset of JavaScript, which means that if you know how to code in JavaScript, especially ECMAScript 6 or 7, you’ll have no problem whatsoever coding in TypeScript! The most significant difference is the addition of types, which brings static code analysis to the table and improves code readability and maintenance.

TypeScript also brings everything good that comes with newer…

GoRails Screencasts 

Debugging: How to Interpret a Stacktrace

Learn how to analyze and understand the Ruby stacktrace when something goes wrong in your app
Hi, we're Arkency 

Non-coding activities in a software project

Recently in our project, we came up with a list of non-coding activities. Those are the tasks that need be done quite regularly and might be easy to be forgotten.

If we tend to forget them, then there’s a risk that someone else will introduce a process around those activities. Sometimes it may mean new people will be brought so that they “manage” those activities. In my opinion, the more can be done by a developer the better, because we don’t introduce non-technical people to the communication loop.

  • read communication on pivotal (and optionally reply)
  • read communication on slack (and optionally reply)
  • build/monitoring failures
  • review commits from others
  • work on our tickets
  • look at…