Rubyland

news, opinion, tutorials, about ruby, aggregated
Sources About
EquiValent 

Ruby Sinatra on AWS Lambda

29.11.2018 AWS Lambda announced official Ruby Support. That means we all can build Serverless applications (or FaaS scripts) with the language that we love.

AWS in the same article also provided quite decent step by step manual for creating AWS Lambda functions but also how to run Sinatra application on AWS Lambda with a code sample project AWS Lambda - serverless Sinatra app example

In this article I will explain in more depth how this works and how it is even possible to run Sinatra (and other small Rack applications) on AWS Lambda

Originally I wanted to create step by step Sinatra - AWS Lambda manual from scratch but guys at AWS done really good job with the mentioned example repo.…

Greater Than Code 

109: Tech Fashion Part 2 with Jaya Iyer of Svaha

In this episode, Jaya Iyer of Svaha, a company known for their STEAM prints and dresses with pockets, talks about the lack of science and tech-themed clothing (especially for children), how personal of a choice clothing is, and the importance of expressing yourself and shattering stereotypes and social norms. A Word From Our Sponsor: This episode is sponsored by Crickstart. They make organic cricket protein bars, gourmet crackers, and fruit smoothie mixes made with organically farmed crickets and other delicious wholesome ingredients. Visit crickstart.com and get 20% off with promo code GREATERTHANCODE! Panelists: Rein Henrichs | John K. Sawers Special Guest: Jaya Iyer: @SvahaUSA |…
avdi.codes 

SIGAVDI #35: Jetlag edition

Hello friends,

I'm just back from the YOW! conference series in Sydney/Brisbane/Melbourne, and boy howdy there is a lot to unpack from that trip. It was remarkable experience that I'm going to be processing for weeks to come.

In the last SIGAVDI I talked about how I had a lot of fear and intimidation going into this trip. That only got stronger as I arrived. I found myself profoundly lonely in Sydney, and feeling very small and out of place among rooms full of Big Important Software Thinkers. Even if I could call a few of those thinkers friends, it was still very intimidating.

Being there really brought home how fear-driven a lot of my career has been. Looking around at people who have…

BigBinary Blog 

Rails 5 Active Record attributes API

This blog is part of our Rails 5 series.

Rails 5 was a major release with a lot of new features like Action Cable, API Applications, etc. Active Record attribute API was also one of the features of Rails 5 release which did not receive much attention.

Active Record attributes API is used by Rails internally for a long time. In Rails 5 release, attributes API was made public and allowed support for custom types.

What is attribute API?

Attribute API converts the attribute value to an appropriate Ruby type. Here is how the syntax looks like.

attribute(name, cast_type, options)

The first argument is the name of the attribute and the second argument is the cast type. Cast type can be string

Appfolio Engineering 

Multiple Gemfiles, Multiple Ruby Versions, One Rails

As part of a new project, I’m trying to run an app with several different Ruby versions and several different gem configurations. That second part is important because, for instance, you want a different version of the Psych YAML parser for older Rubies, and a version of Turbolinks that doesn’t hit a “private include” bug, and so on.

For those of you that know my current big benchmark, you know I try to keep the same version of Rails and multiple Ruby versions to measure Ruby optimizations. This new project will be similar that way.

So, uh… How do you do that whole “multiple Gemfiles, multiple Rubies” thing at this point?

Let’s look at the options.

Lovely, Lovely Tools

For relative simplicity,…

All Ruby Podcasts by Devchat.tv 

RR 392: Crystal and Lucky with Paul Smith & Andrew Mason

Panel:

  • Eric Berry
  • Charles Max Wood
  • Nate Hopkins

Special Guest: Paul Smith and Andrew Mason

In this episode of Ruby Rogues, the panelists talk with Paul Smith and Andrew Mason! They discuss the platforms Lucky and Crystal. Other topics include: Ruby, Phoenix, Laravel Mix, Thoughtbot, Webpack, compilers, and much more! Check it out!

Show Topics:

0:00 – Advertisement: Sentry.io

1:02 – Chuck: Welcome!! Eric Berry, Nate Hopkins, and myself are the panel - and our special guests are Paul Smith and Andrew Mason. Introduce yourself!

1:41 – Andrew / Guest: I have messed with every type of language, so there’s that!

1:55 – Paul / Guest: I have been here at my current company for 5 years…

ruby – Bibliographic Wilderness 

On code-craft, and writing code for other programmers to use

The New Yorker this week has a profile of Google programmer pair Jeff Dean and Sanjay Ghemawat — if the annoying phrase “super star programmer” applies to anyone it’s probably these guys, who among other things conceived and wrote the original Google Map Reduce implementation–  that includes some comments I find unusually insightful about some aspects of the craft of writing code. I was going to say “for a popular press piece”, but really even programmers talking to each other don’t talk about this sort of thing much. I recommend the article, but was especially struck by this passage:

At M.I.T., [Sanjay’s] graduate adviser was Barbara Liskov, an influential computer scientist who studied,…

Honeybadger Developer Blog 

Debugging Source Maps

You've got bugs, but they're hiding inside your minified JavaScript. Source maps are the key to finding them. Unfortunately, they can be difficult to set up. Luckily, you're a flippin' Honeybadger. We've got your back with the documentation and tools you need swat those bugs.
Riding Rails 

New Rails version, early new Ruby version fixes, and more!

Hello, hello! This is Tim here bringing you all the latest right from the Rails Edge.

In the northern hemisphere, daylight is getting scarce, driving certain folks in the Pacific Northwest to drastic measures. But the holiday season is upon us! We got an early pressie in the form of a new Rails release this week. Ans we can all look forward to Ruby release day!

On with the show….

Rails 5.2.2 has been released!

This week saw the release of a new patch version of Rails! Too numerous to list here, check out the official blog post for the full changelog.

This Week’s Contributors

This week 23 people gave back to Rails. For 7 of these folks it was their first time contributing! If you’d…

The way is long but you can make it easy on me 

Rack middlewares that have saved me literally hours of my life

In Ruby, Rack is our webserver baseline. It is an incredibly simple interface. A rack app is any object which has a public #call method that takes a single argument, typically called env, which represents the environment of a HTTP request (params, headers, etc) and returns a three item array containing:

  1. An integer containing a response code
  2. The response headers
  3. An object responding to #each that emits strings to build the response body

which represents the response to the request.

The cool thing about this interface, is that it's very easy to insert an intermediate object between the request and the app generating the response, "wrapping" it, to modify the behaviour of request…

RubyGuides 

How to Use The VCR Gem to Improve Your Testing Suite

If your Ruby application works with any kind of external API then you probably have faced the problem of slow tests & API rate limits. What is the solution? You could manually stub the HTTP methods from your client library, and return some pre-determined responses. But that’s a lot of work & ugly code! A […]

The post How to Use The VCR Gem to Improve Your Testing Suite appeared first on RubyGuides. Don't miss your free gift here :)

Notes to self 

Displaying, downloading and streaming files with Active Storage

Here is a quick’n’dirty cheat sheet for basic Active Storage actions.

Attaching

# in model
class Model
  has_one_attached :image
  has_many_attached :images # for more than one
end

# in controller
@model.image.attach(params[:image])
@model.image.attach(io: File.open("/path/to/file.jpg"), filename: "pic.jpg", content_type: "image/jpg")

Displaying

# in controller for including the attachment when querying
Model.all.with_attached_image
Model.all.with_attached_images

# in view
<%= image_tag @model.image %>
<%= @model.image.filename %>
<%= url_for(@model.image) %>

# variants
<%= image_tag @model.image.variant(resize: "500x500", monochrome: true) %>

Downloading

tempfil…
Code with Jason 

Using Tests as a Tool to Wrangle Legacy Projects

In my career I’ve worked on my fair share of legacy projects. In fact I’d say that almost all the 50+ production projects I’ve worked on in my career have been legacy projects to some degree.

My experience is undoubtetly not a unique one. I would bet that most of most developers’ work has been on legacy projects. Due to Sturgeon’s law, I think it’s probably safe to assume that most code in the world is legacy code.

The challenges of working on a legacy project

Maintaining a legacy project is often a bummer. Many of the following things are often the case.

  • Changes take much longer than they should, perhaps by a factor of 10 or more.
  • Deployments are scary. They’re preceded by stress and…
Julia Evans 

How do you document a tech project with comics?

Every so often I get email from people saying basically “hey julia! we have an open source project! we’d like to use comics / zines / art to document our project! Can we hire you?“.

spoiler: the answer is “no, you can’t hire me” – I don’t do commissions. But I do think this is a cool idea and I’ve often wished I had something more useful to say to people than “no”, so if you’re interested in this, here are some ideas about how to accomplish it!

zine != drawing

First, a terminology distinction. One weird thing I’ve noticed is that people frequently refer to individual tech drawings as “zines”. I think this is due to me communicating poorly somehow, but – drawings are not zines! A zine…

Ruby Together News 

November 2018 Monthly Update

Hello! Welcome to the monthly update—and the last update we’re publishing in 2018. During November, our work was supported by Handshake, Stripe, Triplebyte, GitLab, and many others.

ruby together news

The Ruby Together team flew out to Los Angeles for RubyConf 2018, where we sponsored #RubyKaraoke (along with Engine Yard). At the conference, André, Adarsh, Jonan, and Valerie recorded a special-edition Ruby Together episode of Greater Than Code. The panel discussion covers restructuring the board, the launch of RubyMe, and our upcoming project funding applications. Give it a listen if you want to learn more!

In November, Ruby Together was supported by 67 different companies, including…

Bundler Blog 

November 2018 Bundler Update

Welcome to the November monthly update!

This month, we announced the upcoming Bundler 2.0 release and shipped a few prerelease versions. As mentioned in the blog post, Bundler 2 will drop support for Ruby versions that are no longer supported by the Ruby core team.

If you’re feeling adventurous, you can even try the Bundler 2 prerelease by running gem install bundler --pre. (You can even use the Bundler 2 prerelease on Heroku, with the Bundler 2 buildpack!).

For the less adventurous, we’re writing documentation furiously, and we will post a full Bundler 2 upgrade guide along with the final 2.0.0 release.

This month, Bundler gained 44 new commits, contributed by 10 authors. There were…

RubyGems Blog 

November 2018 RubyGems Updates

Welcome to the RubyGems monthly update! As part of our efforts at Ruby Together, we publish a recap of the work that we’ve done the previous month. Read on to find out what updates were made to RubyGems and RubyGems.org in October.

rubygems.org news

In November, we updated 19 dependencies on RubyGems.org including security updates to rack and activejob. Thanks to a report that came in from HackerOne, we fixed a bug that would allow an attacker to guess an api_key by sending all of their guesses as an array along with the request. We also fixed some other issues reported through HackerOne, including rate limits on forgotten password requests, and profile pages being viewable after logout…

Remote Ruby 

Accounting (?), Ruby 2.6rc1, Rails 5.2.2, AWS Lambda + Ruby, Stimulus Component Library

RubyGuides 

What is A REPL in Ruby?

REPL stands for Read-Eval-Print-Loop. It’s a program that allows you to type Ruby code & see the result directly. This is useful because you can quickly test how something works. For example: If you’re trying to convert an array of strings into an array of integers. You may not remember exactly how to do that… […]

The post What is A REPL in Ruby? appeared first on RubyGuides. Don't miss your free gift here :)

Test Double | Our Blog 

The Problem with Paydown

Your credit card debt is out. of. control. What do you do? Budget paydown!

In software development, we try to apply that same idea of budgeting paydown to technical debt in our applications. If the debt is too high, we feel the pain and try to eliminate it. We may declare bankruptcy and undertake a 😱 rewrite, or we may establish a budget and spend 10% or even 20% of our time on paydown. It's a concept that is easy to understand, especially when we liken it to something like credit card debt.

If you're thinking about starting, or have already instilled a paydown plan like this, then you're doing something awesome. You're clearly telling your team that you care about their happiness, and…

The Bike Shed 

180: A Citizen of the Internet (John Resig)

On this episode of the Bike Shed, we're thrilled to welcome special guest John Resig, creator of jQuery and front-end architect at Khan Academy. The conversation begins with a discussion around John's work on jQuery, one of the most influential libraries in the history of the web. From there the discussion shifts to John's role as front-end architect at Khan Academy and how he balances feature development and paying down tech debt or exploring new technologies.

John and Chris then discuss the rate of change of front-end technologies, and John provides wonderfully pragmatic guidance distinguishing the rate of innovation from the perceived needed rate of adoption. The conversation…

Scout ~ The Blog 

Quick blog post about throughput sparkline feature

We've had sparkline charts of response time for a long time on our Endpoints tab, and now have extended them to the throughput column as well. Quickly isolate endpoints that are spiking with traffic, and drill down into them to diagnose. No need to hunt to see what's causing an unusual trend in traffic.

image

Scout ~ The Blog 

11 Awesome Elixir Jobs for 2019 (and some incredible perks)

Elixir has Arrived

Elixir and dynamic language, and runs on the Erlang VM (Virtual Machine). Elixir is highly scalable and fault tolerant. In other words, Elixir is perfect for today's software landscape of microservices and cloud computing.

Like many modern programming languages, Elixir's documentation is easily approachable. The getting started guide provides the simple basics, and some quick googling reveals loads of other examples and tutorials.

Additionally, other architectures, services, and frameworks build upon Elixir. They provide the necessary depth and power to make Elixir a viable choice for enterprise-level software. Some examples include:

  • Phoenix - provides framework for…

Awesome Ruby Newsletter 

Issue 133 - "Big on Heroku: Scaling Fountain without losing a drop". A one-stop guide for getting the most out of Heroku for a Rails startup.

JRuby.org News 

JRuby 9.2.5.0 Released

The JRuby community is pleased to announce the release of JRuby 9.2.5.0

JRuby 9.2.x is our new major version of JRuby. It is expected to be compatible with Ruby 2.5.x and stay in sync with C Ruby. JRuby 9.2.0.0 is our first release for 2.5 support.

If you do find issues then report them on using our issue tracker at http://bugs.jruby.org. We also encourage users to join our IRC channel (#jruby on Freenode) and mailing lists. You may also follow @jruby on Twitter for updates.

Highlights:

  • 29 issues fixed for 9.2.5.0

Github Issues resolved for 9.2.5.0

  • #5495 - Remove failed tag for Array#to_h MRI tests
  • #…
Ruby News 

Ruby 2.6.0-rc1 Released

We are pleased to announce the release of Ruby 2.6.0-rc1.

Ruby 2.6.0-rc1 is the first release candidate of Ruby 2.6.0. It introduces some new features and performance improvements, for example:

JIT

Ruby 2.6 introduces an initial implementation of JIT (Just-in-time) compiler.

JIT compiler aims to improve performance of any Ruby program execution. Unlike ordinary JIT compilers for other languages, Ruby’s JIT compiler does JIT compilation in a unique way, which prints C code to a disk and spawns common C compiler process to generate native code. See also: MJIT organization by Vladimir Makarov.

How to use: Just specify --jit in command line or $RUBYOPT environment variable. Specifying --ji…

Ruby Weekly 

Ruby now a first-class language on AWS Lambda

#428 — December 6, 2018

Read on the Web

Ruby Weekly

AWS Lambda Gets Official Support for Ruby — After much community demand, AWS’s popular Lambda serverless platform now supports Ruby as a first class language, opening up an interesting new way to deploy Ruby code. Psst.. if serverless interests you, we have a weekly serverless newsletter too.

Amazon Web Services

▶  Matz's RubyConf Keynote on the Power of the Ruby Community — The creator of Ruby, Yukihiro ‘Matz’ Matsumoto, delivered the opening keynote at RubyConf 2018 covering the Ruby creation story, how Ruby is built, how the community works, and even…

Confreaks

Gett…

RubyMine Blog 

RubyMine 2018.2.6 is Available

Hey all,

RubyMine 2018.2.6 (build 182.5107.52) is now available.

What’s new in this build:

  • Fixed the PlantUML integration [RUBY-22884]
  • Run Anything now works correctly with rbenv [RUBY-23106]
  • Eliminated the incorrect autocompletion with adding a space after the do keyword [RUBY-22741]

If you are still using RubyMine 2018.2, please update to this newest version.

Download RubyMine 2018.2.6

As always, see the release notes for the full list of improvements. Please report any issues you encounter.

Cheers,
Your RubyMine Team

Ruby on Rails Podcast 

252: Confident Ruby on Rails Testing with Jason Swett

Jason Swett is a developer, speaker, trainer, author and host of The Ruby Testing Podcast. Jason joined Brittany to discuss legacy Ruby on Rails applications: how to identify them and tackle their challenges from a testing standpoint.

Links for this episode:

BigBinary Blog 

Passing current_user by default in Sidekiq

In one of our projects we need to capture user activity throughout the application. For example when a user updates projected distance of a delivery, the aplication should create an activity for that action. To create an activity we need the currently logged in user id since we need to associate the activity with that user.

We are using devise gem for authentication which provides current_user method by default to controllers. Any business logic residing at controller level can use current_user to associate the activity with the logged in user. However, some business logics reside in Sidekiq where current_user is not available.

Passing current_user to Sidekiq job

One way to solve this…

All Ruby Podcasts by Devchat.tv 

MRS 072: Olivier Lacan

Panel: Charles Max Wood

 

Guest: Olivier Lacan 

 

This week on My Ruby Story, Chuck talks with Olivier Lacan who works for Pluralsight remotely while living in France.  Chuck and Olivier talk about his background, his education, and how he got into Ruby. Check it out! 

 

In particular, we dive pretty deep on:

0:00 – Get A Coder Job!

 

0:55 – Chuck: Hi! Can you update people where you are at now?

 

1:21 – Guest: I work on the Pluralsite remotely from France. (Check it out here!)

 

2:20 – Chuck: It feels like Pluralsite is offering new things for students. That’s nice! 

 

2:30 – Guest: Yes, everyone has their own unique way to learn new things. Whether it’s through podcasts,…

Greater Than Code 

108: Tech Fashion Part 1 with Kayte Malik of Dress Code

In this episode, Kayte Malik, of Dress Code, shares the mission of her company: to empower more girls and women to get involved in coding through creation and innovation. Kayte and the panelists discuss confidence, owning your accomplishments, and debunking the myth that code, tech, and STEM are for boys only. A word from our sponsor: What would it look like if we all… listened more? Listening to audiobooks inspires us, motivates us, even brings us closer. And there's no better place to listen, than Audible. Audible has the largest selection of audiobooks on the planet. And now, Audible members get more than ever before: each month you get 3 titles of their choice; 1 audiobook, 2 Audible…
Giant Robots Smashing Into Other Giant Robots 

Ruby Memoization and Alternatives

memoization

In Ruby, it’s common to use memoization to make sure that instance variables in a method only get set once regardless of how many times the method is called. For example:

class Dashboard
  def users
    @users ||= Users.all
  end
end

Sometimes there are better solutions. Let’s look at the problem we’re solving and the trade-offs involved.

No caching

Memoization is often used when deriving values from other state on our objects. Saving derived state to an instance variable is a form of caching and comes with all the associated gotchas (cache invalidation!).

Most of the time, this caching is a form of premature optimization. It’s often best to approach caching problems with a…

Riding Rails 

Rails 5.2.2 has been released!

Hi everyone,

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

CHANGES since 5.2.1

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

To see a summary of changes, please read the release on GitHub:

5.2.2 CHANGELOG

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…

Martian Chronicles, Evil Martians’ team blog 

Big on Heroku: Scaling Fountain without losing a drop

Authors: Sergey Ponomarev, Team Lead at Evil Martians and Anton Lee, Team Lead at Evil Martians

For the past three years, we have been helping Fountain to grow from a Y Combinator graduate to a leading hiring solution for the flexible workforce—all while staying on Heroku for hosting and continuous delivery. We learned how to get the most out of a popular zero-ops platform and now we share our notes with you.

For many engineers, deploying a web application with git push heroku master is somewhat of a guilty pleasure. One might think that it is OK to use Heroku for taking pet projects and proofs-of-concept live, but once your product is ready for prime time, it is a job of a dedicated…

Search Results for “ruby” – via @codeship 

How to Use Ruby on Rails for Local SMTP Email Testing

Reading Time: 3 minutes

When it comes to testing email templates for production; I think it is fair to say testing is key. Action Mailer is one of the most recognized frameworks for sending out emails. With Action Mailer you can send out emails through different providers easily, preview templates, and so forth. (Although from my work experience, I have always found it extremely difficult to have perfect emails the first time around.)

I have tried software tools like Litmus, BEE Plug-in, and others to help validate the email will be sent without any issues and display perfectly. I’ve found that using the Action Mailer preview method has never seemed to do the trick. I will teach you how to…

Valentino Gagliardi 

Automated testing and Continuous Integration in Drupal 8: an Introduction

Learn how to embrace automated testing and continuous integration in Drupal 8 projects

Automated testing and Continuous Integration in Drupal 8

 

Besides frontend consulting, part of my job consists in helping teams to embrace automated testing and continuous integration. These days I’m consulting with a Drupal shop in Italy, Whitedrop. Whitedrop is run by Giovanni and Federico. I met Giovanni at a Meetup in Arezzo last year and soon we became friend.

The team at Whitedrop were interested in knowing more about continuous integration and continuous delivery before taking on more challenging Drupal projects.

In this post I’d like to share the goals, the tools and the outcomes of this journey.

Enjoy the reading!

Automated testing and Continuous…

Mike Perham 

Introducing Faktory Pro

I'm happy to announce Faktory Pro, my commercial version of Faktory, is now available for purchase. Faktory is my next generation background job system which brings Sidekiq functionality to all programming languages. If you want background jobs in Python, JavaScript, PHP, Go, Ruby, or Rust, Faktory can work with them all! It gives you a standard job interface and conventions useful for all languages.

faktory ui

Why Jobs?

I believe background jobs are the best architectural pattern for scaling typical business apps to many machines. Sidekiq has been enormously successful because it implements that pattern and adds opinionated conventions which make the average developer's life much easier:

  • A…
All Ruby Podcasts by Devchat.tv 

RR 391: Frontend Testing Like a Rubyist with Josh Justice

Panel:

  • Dave Kimura
  • Charles Max Wood
  • Nate Hopkins

Special Guest: Josh Justice

In this episode of Ruby Rogues, the panelists talk with Josh Justice who is a developer, writer, and speaker. Josh streams JavaScript and web development on Friday’s at 2:00 PM (ET) here! The panelists and the guest talk about Josh’s background and frontend testing in Ruby. Check it out!

Show Topics:

0:00 – Advertisement: Sentry.io

1:04 – Chuck: Hi! Dave, Nate, and myself are on the panel and our special guest is Josh Justice! I am developing a show about developer freedom and it’s called The DevRev. It will be streamed through YouTube, and I will record Friday afternoons. Check out Facebook, too!

2:1…

Scout ~ The Blog 

Ruby Agent 2.4.21 is out with a bug fix, a new configuration option, and a debug option

App & Background Integration Installation

As reported on Issue #228, if scout_apm is disabled on a node via the configuration monitor = false, we don't intend to install any instruments, but a few snuck in anyway.

Since the rest of the agent isn't running, they (slowly but steadily) built up recorded info, but didn't purge it, causing a slow memory leak that became clear over the course of a week or two. We've stopped the offending instruments from installing themselves when Scout is disabled.

New Option: collectremoteip

Our Rails instruments capture a few bits of useful information for each request as Context, and displays that in traces. A few customers with higher privacy concerns…

BigBinary Blog 

Optimize loading multiple routes on Google map using B-spline

Applications use Google maps for showing routes from point A to B. For one of our clients we needed to show delivery routes on Google maps so that user can select multiple deliveries and then consolidate them as one single delivery. This meant we needed to show around 30 to 500 deliveries on a single map.

Using Google Map polylines

We used polylines to draw individual routes on Google maps.

Polyline is composed of line segments connecting a list of points on the map. The more points we use for drawing a polyline the more detailed the final curve will be. Here’s how we added route points to the map.

// List of latitude and longitude
let path = points.map((point) => [point.lat, point.lng]…
Greater Than Code 

Special Edition: Ruby Together – LIVE! from RubyConf 2018

Ruby Together This special episode of Greater Than Code was recorded in-person during RubyConf in Los Angeles on November 15th. Ruby Together's Executive Director, André Arko, was joined by board members, Jonan Scheffler, Valerie Woolard Srinivasan, and Adarsh Pandit. They discussed recent changes to the organization, including André's decision to step down from the board into the executive director position, the RubyMe mentorship program, and a preview of awesome new things to come.     Want to help keep us a weekly show, buy and ship you swag, and bring us to conferences near you? Support us via Patreon! Or tell your organization to send sponsorship inquiries to…
RubyGuides 

How to Use State Machines in Ruby

Imagine a traffic light… It can be red, green or yellow. When it changes colors, the next color is based on the current one. Let’s say that this is the kind that makes a sound for blind people so they know when they can cross. Now: You’re writing the software for this thing. How are […]

The post How to Use State Machines in Ruby appeared first on RubyGuides. Don't miss your free gift here :)

Drifting Ruby Screencasts 

Creating a Simple Slack Bot

Slack is a great application to keep in contact with friends, coworkers and a community. With bots, its capabilities are endless. In this episode, learn how to create a Slack Bot to interact with.
Andy Croll 

Write long strings with wiggly HEREDOCs

There’s multiple ways to generate String literals in Ruby. If you are creating long, or multi-line, strings, the HEREDOC (or ‘Here document’) is your friend.

Details of the many ways to create String literals can be found in Ruby’s documentation for Strings.

Instead of…

…running strings over multiple lines and including newline characters:

hamilton = "I am not throwing away my shot!\n" \
           "I am not throwing away my shot!\n" \
           "Hey yo, I’m just like my country\n" \
           "I’m young, scrappy and hungry\n" \
           "And I’m not throwing away my shot!"
burr = "Geniuses, lower your voices"
burr += "You keep out of trouble and you double your choices\n"
burr +=
Riding Rails 

Safety checks to prevent database writes, cache performance boost and more

Cheers for the first day of December! This is Kir bringing you the latest news from the Rails world.

Use raw time string from DB to generate ActiveRecord#cache_version

The PR skips unnecessary attribute casting when generating cache version, which gives a great performance boost for apps that rely on caching.

Add ability to block writes to a database

A brand new while_preventing_writes method on Active Record connection allows you to add safety checks for code that’s not supposed to write to a database.

Bump the minimum version of PostgreSQL to 9.3

PostgreSQL 9.1 and 9.2 have been declared EOL more than a year ago.

28 peoplecontributed to Rails last week. If you want to be part of…

RubyGuides 

How to Run System Commands From Ruby

If you want to run an external command from Ruby… …like wkhtmltopdf to convert an HTML file into a PDF. There are a few Ruby methods you can use. Depending on the method you use you’ll get different results. Let’s explore these methods together! The Ruby System Method The Ruby system method is the simplest […]

The post How to Run System Commands From Ruby appeared first on RubyGuides. Don't miss your free gift here :)

Ruby News 

2019 Fukuoka Ruby Award Competition - Entries to be judged by Matz

Dear Ruby Enthusiasts,

The Government of Fukuoka, Japan together with “Matz” Matsumoto would like to invite you to enter the following Ruby competition. If you have developed an interesting Ruby program, please be encouraged to apply.

2019 Fukuoka Ruby Award Competition - Grand Prize - 1 Million Yen!

Entry Deadline: January 31, 2019

Fukuoka Ruby Award

Matz and a group of panelists will select the winners of the Fukuoka Competition. The grand prize for the Fukuoka Competition is 1 million yen. Past grand prize winners include Rhomobile (USA) and APEC Climate Center (Korea).

http://myfukuoka.com/category/news/ruby-news/

Programs entered in the competition do not have to be written entirely in Ruby but…

Remote Ruby 

Thoughts on Best Practices, Design Patterns, and Good/Bad Code

Appfolio Engineering 

How Fast is Ruby 2.6.0preview3 for Discourse?

As many of you here know, I speed-check a lot of Ruby versions. I use a big benchmark called Rails Ruby Bench - basically, it sets up a highly-concurrent Discourse/Puma instance with 10 processes and 60 threads, then runs a lot of repeatably-random-generated HTTP requests through it, and times the results.

The idea is that it’s a “real world” Rails benchmark. When somebody says “Ruby version so-and-so gives 50% better performance on this new microbenchmark!”, the response always starts with, “yeah, but what does that mean in terms of real-world Rails performance?” I like to think the Rails Ruby Bench results are a pretty good indicator. So let’s see how well 2.6 does compared to 2.5, shall…

Honeybadger Developer Blog 

Using Ruby on AWS Lamba

If you love Ruby and Lambda like we do, then re:Invent 2018 was like Christmas arriving early. Here's how you can get up to speed quickly with running Ruby code on Lambda.
Passenger - Phusion Blog 

Hello World! Meet: Passenger 6 / Generic Language Support

Hello World! Meet: Passenger 6 / Generic Language Support

Version 6.0 of the Passenger application server has been released. Earlier this year we launched our all-new Passenger Docs, replacing the 'Library'. And this year spring we celebrated our 10 year anniversary.

Our early days far behind us, over 650.000 applications came to rely on Passenger. But paraphrasing Sean Parker, Napster founder and early Facebook investor: "A million apps isn't cool. You know what is cool? A billion apps."

Generic Language Support

Per overwhelming request from language communities Passenger didn’t previously support out-of-the-box - from fringe frameworks to the likes of .NET - we added support for all languages to Passenger 6. For languages we consider first class…

The Bike Shed 

179: We CAN Just Use a Form!

On this episode of the Bike Shed, Matt Sumner returns to chat with Chris about their recent adventures. They start by discussing Matt's ongoing work building an open source Ethereum implementation in Elixir and the joys of a test suite guiding your work. From there, Matt asks Chris about Chris's recent trip to speak at GraphQL Summit and his take on the current state of affairs in the GraphQL world (hint, it's good).

Matt and Chris then discussed the progress they've made on simpler form handling in React applications and consider how far they could go with this, and then discuss the recent announcement of React Hooks.

And finally, they discuss the fact that thoughtbot is hiring,…

Awesome Ruby Newsletter 

Issue 132 - Why on earth do fibers exist?

Honeybadger Developer Blog 

Track Vue.js Errors with Honeybadger

Good news, 'badgers! We just shipped an official Vue.js integration for Honeybadger. When your Vue apps are on fire, Honeybadger alerts you of exceptions in real-time, helping to identify the root cause so that you can fix them—fast.
Ruby Conferences 'n' Camps in 2019 - What's Upcoming? 

Ruby Wine @ Chișinău, Moldova - Ruby Conferences 'n' Camps Update

Conferences 'n' Camps

What's News? What's Upcoming in 2019?

Ruby Wine
Apr/13 (1d) Sat @ Chișinău, Moldova

See all Conferences 'n' Camps in 2019».

Ruby Weekly 

What the inclusion of Bundler in Ruby means

#427 — November 29, 2018

Read on the Web

Ruby Weekly

Modulation: Explicit Dependency Management for Ruby — An interesting experiment that feels a bit like JavaScript’s import syntax. Intended for managing dependencies between source files inside Ruby apps and not for third-party dependencies.

Sharon Rosner

Bundler is Built Into Ruby 2.6 — What the inclusion of Bundler in Ruby means, including, what happens when you install Bundler as a gem. To me, this feels as big a step as when RubyGems became part of Ruby in 1.9.

Noah Gibbs

Monitoring and Distributed Tracing for Ruby Apps — Utilize flame…

Kir Shatrov 

Engineering Leadership Unconference

Engineering Leadership Unconference

Last weekend I went to the Engineering Leadership Unconference in London. It was the first time I attended the “unconference” sort of event, which unlike as a usual conference, doesn’t have a list of speakers or talks.

Instead, people meet and gather in front of a whiteboard and come up with topics to discuss. Each room is assigned a topic, and attendees are free to choose a room with the most interested discussion.

In each room there would be 5-10 people having a conversation for a given topic (let’s say about growing developers). There’s no leader and everyone is welcome to share an opinion. At the end of the time slot, they switch to another topic according to the whiteboard with the…

Riding Rails 

Rails 5.2.2.rc1 has been released

Hi everyone,

I am happy to announce that Rails 5.2.2.rc1 has been released.

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

CHANGES since 5.2.1

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

Full listing

To see the full list of changes, check out…

JRuby.org News 

JRuby 9.2.4.1 Released

The JRuby community is pleased to announce the release of JRuby 9.2.4.1

JRuby 9.2.x is our new major version of JRuby. It is expected to be compatible with Ruby 2.5.x and stay in sync with C Ruby. JRuby 9.2.0.0 is our first release for 2.5 support.

If you do find issues then report them on using our issue tracker at http://bugs.jruby.org. We also encourage users to join our IRC channel (#jruby on Freenode) and mailing lists. You may also follow @jruby on Twitter for updates.

This is a security release that updates the native Windows executables shipped in the bin directory. A user reported that several virus…

Justin Collins' Blugh 

Finding Ruby Performance Hotspots via Allocation Stats

RubyParser is a library written by Ryan Davis for parsing Ruby code and producing an abstract syntax tree. It is used by Brakeman and several other static analysis gems.

Recently I was poking around to see if there was any low-hanging fruit for performance improvements. At first, I was interested in the generated parsers. Racc outputs some crazy arrays of state machine changes. Instead of generating arrays of integers, it outputs arrays of strings, then splits those strings into integers which it loads into the final array. I thought for sure skipping this and starting with the final array of integers would be faster, but…somehow it wasn’t.

I moved on to thinking about frozen string…

All Ruby Podcasts by Devchat.tv 

MRS 071: Mark Bates

Panel: Charles Max Wood

Guest: Mark Bates

This week on My Ruby Story, Chuck talks with Mark Bates who is a consultant, trainer, entrepreneur, co-founder of PaperCall, and an author! Chuck and Mark talk about PaperCall, GO, Ruby, JavaScript, and helping others within the community. Check out today’s episode to hear more!

In particular, we dive pretty deep on:

0:00 – Get A Coder Job!

0:59 – Chuck: Hi! I saw we were on Episode 198! We talked about Ruby and different communities.

1:25 – Guest: Yes, we were talking about the conference we were trying to start, which never took-off!

1:50 – Chuck: You talked about how you are working with GO now. You are an author, too!

2:06 – Guest: That…

Passenger - Phusion Blog 

Stopping slow client DoS attacks with Puma on Passenger 6

Stopping slow client DoS attacks with Puma on Passenger 6

Imagine you're the proud owner of a guitar shop. One day, you wake up expecting to enjoy happy customers browsing the shop.

But something is amiss today... there is a crowd of robots, idling around in your shop and not buying anything. Your customers can't even enter your shop and leave in frustration. No business today.

Welcome to the slow client attack, and let's find out how you can supercharge Puma with the power of Passenger 6.

Stopping slow client DoS attacks with Puma on Passenger 6

What is the slow client attack?

A slow client attack is a form of Denial of Service. It's real: see the Slowloris attack. An attacker can open an HTTP connection and then send the request very slowly, receive the response very slowly, or both. The reason why…

RubySec 

Bypass vulnerability in Active Storage

RubySec 

Broken Access Control vulnerability in Active Job

Greater Than Code 

107: The Ruby Central Opportunity Scholarship Program

This episode was recorded live at RubyConf in Los Angeles. We talked to special guests, Jennifer Tran, Christine Seeman, and Jeremy Schuurmans about the Ruby Central Opportunity Scholarship Program. Check out this new podcast called The Local Maximum - it's hosted by Max Sklar who is a Machine Learning Engineer at Foursquare. He covers a lot of fascinating topics: AI, building better products, and the latest technology news from his unique perspective. Max interviews a wide diversity of guests, including Engineers, Entrepreneurs, and Creators of all types. You can see their bios at localmaxradio.com, and subscribe to the Local Maximum podcast wherever you listen! Panelists: Jamey…
Riding Rails 

Rails 4.2.11, 5.0.7.1, 5.1.6.1 and 5.2.1.1 have been released!

Hello everyone and happy Tuesday!

Rails 4.2.11, 5.0.7.1, 5.1.6.1 and 5.2.1.1 have been released! These contain the following important security fixes, and it is recommended that users upgrade as soon as possible:

RAils 5.2.1.1 also includes the following security fix:

The released versions can be found in the usual locations, and you can find a list of changes on GitHub:

We’ve done our best to minimize any impact to your applications, but if you run in to any issues, please f…

Engine Yard Blog 

RubyConf Round Up

The City: Los Angeles, California

BigBinary Blog 

Deploying feature branches to have a review app

BigBinary has been working with Gumroad for a while. Following blog post has been posted with permission from Gumroad and we are very grateful to Sahil for allowing us to discuss the work in such an open environment.

Staging environment helps us in testing the code before pushing the code to production. However it becomes hard to manage the staging environment when more people work on different parts of the application. This can be solved by implementing a system where feature branch can have its own individual staging environment.

Heroku has Review Apps feature which can deploy different branches separately. Gumroad, doesn’t use Heroku so we built a custom in-house solution.

The first…

Appfolio Engineering 

Bundler is Built Into Ruby 2.6.0preview3

Big Bundler changes are coming for Ruby 2.6 preview 3. No, not the really huge RubyGems 3 and 4 changes. Also not the Bundler 2.0 changes where Gemfile changes name to gems.rb. Those are still in the future, mostly.

No, preview3 is where Bundler got merged into Ruby proper. They’ve been working on it for awhile. When you build the Ruby source code, you get a Bundler executable right inside Ruby. It’s a lot like rdoc or irb now. It can also have better integration with RubyGems, which has been part of core Ruby since Ruby 1.9.

You could be joining your relatives to eat Thanksgiving leftovers as you listen to Uncle Bob’s highly-political take on the US President tear-gassing asylum seekers, or…

OmbuLabs Blog 

Kickoff Calls for New Projects

When starting a new software development project with a client, it is important to get started on the right foot. The way you communicate with a client at the beginning of a project can set the tone for how communication will be throughout the project.

Therefore, at Ombu Labs, we believe it is crucial to start off every new project with a Kickoff Call, where we can take time to get to know the client's team and speak in depth about their goals and priorities for the project. We like to discuss the following list of topics with clients during our calls:

Overview

During the Kickoff Call, we like to start off by introducing ourselves and getting to know the client and their team. It can…

Code with Jason 

“We don’t have time to write tests”

I wish I had a dollar for every time I heard some variation of “we would have written tests for this but we didn’t have time.” Let’s unpack the meaning of this statement.

The hidden (fallacious) beliefs behind “no time for tests”

If I say I didn’t write tests due to lack of time, I must view tests as something “extra”. Tests are an extra thing that take up time but aren’t strictly necessary. The real work of course is the feature development itself, writing application code. If I write tests for my code I can finish in 10 hours but if I skip the tests I can finish in 6 hours. So by excluding tests, I’m making the responsible choice for the business and focusing only on what’s essential.

If…

Ruby Magic by AppSignal 

Fibers and Enumerators in Ruby: Turning Blocks Inside Out

Ruby has various ways of performing iteration—loops, blocks and enumerators. Most Ruby programmers are at least familiar with loops and blocks but Enumerator and Fiber often stay in the dark. In this edition of Ruby Magic, guest author Julik shines a light on Enumerable and Fiber to explain flow controlling enumerables and turning blocks inside out.

Suspending Blocks and Chained Iteration

We've discussed Enumerator in a previous edition of Ruby Magic, where we described how to return an Enumerator from your own #each method and what it can be used for. An even broader use case for Enumerator and Fiber is that they can "suspend a block" mid-flight. Not just the block given to #each or the…

This is a…

All Ruby Podcasts by Devchat.tv 

RR 390: Creating a Heroku-Like Deployment Solution with Docker with Pedro Cavalheiro

Panel:

  • Dave Kimura
  • Eric Berry
  • Charles Max Wood
  • Nate Hopkins

Special Guest: Pedro Cavalheiro

In this episode of Ruby Rogues, the panelists talk with Pedro Cavalheiro who is from Brazil, but currently resides in Hamburg, Germany where he works at Xing. He is a software engineer, an actor, and has been working with the web since 2010. He has worked mostly with Ruby and PHP languages, and since 2015 has worked full-time with Ruby on Rails. The panelists and Pedro talk about his background and his article. Check it out!

Show Topics:

0:00 – Advertisement: Sentry.io

1:04 – Chuck: Hi! Panel is Eric, Dave, Nate, myself – and our special guest is Pedro Cavalheiro! Please introduce…

avdi.codes 

SIGAVDI #34: Headed down under

Hello, friends.

So here I am in a laundromat in Largo, FL at 10:51 PM and I feel the urge to write to you.

 

I'm visiting Largo because that's where my kids live now. I'm at a laundromat because I'm flying to Sydney in the morning and I don't want to travel with dirty laundry in my bag. I'm flying to Sydney because I'm speaking at a three-city conference tour called YOW!.

I feel like I am supposed to say that I'm super excited about this conference trip—and I am. It's a chance to see a country I've dreamed about visiting since I was a child, and an opportunity to speak to an audience beyond my usual Ruby conference audiences.

This newsletter is all about being real, though, and the truth…

Code with Jason 

Rails Scaffolding and TDD Are Incompatible

Testing + TDD = a serious learning curve

Learning Rails testing is pretty hard. There are a lot of principles and tools to learn. Getting comfortable with testing in Rails (or any framework) often takes developers years.

Compounding the difficulty is TDD. If I’m just starting out with testing, should I learn TDD? Writing tests at all is hard enough. How am I supposed to write a test first?

And if the “testing + TDD” combo doesn’t generate enough cognitive turmoil, “testing + TDD + scaffolding” makes the scenario even murkier.

Scaffolding and TDD

In my experience most Rails developers take advantage of scaffolding to generate CRUD interfaces really quickly. Scaffolding is of course awesome…

Martian Chronicles, Evil Martians’ team blog 

Errors in Go: From denial to acceptance

Author: Sergey Alexandrovich, Lead Developer at Evil Martians

Learn how to stop worrying and love error handling in Go. Author of Overmind and imgproxy describes his journey through all five stages of Kübler-Ross model—from denial to acceptance—as he went deeper into the language, and shares his favorite patterns for dealing with errors in Go code.

As an English poet once said, “To err is human, to forgive, divine”. Error handling is an integral part of programming, but in many popular languages, it comes as an afterthought.

The godfather of numerous programming dialects, C, never had a dedicated error or exception mechanism in the first place. It is up to the programmer to accurately…

RubyGuides 

How To Use Heredoc in Ruby

What is a heredoc? A heredoc is a way to define a multiline string, while maintaining the original indentation & formatting. This is used to embed snippets of code, like SQL or HTML. Here’s an example: query =

The post How To Use Heredoc in Ruby appeared first on RubyGuides. Don't miss your free gift here :)

Riding Rails 

Parallel tests on Windows, query cache with multiple databases and more!

Hello fellow Rubyists. This is Greg bringing you the latest updates from Rails.

Fix parallel tests on Windows

This pull request fixes an issue with running tests in parallel on Windows.

Allow using queue prefix with a default queue name

In Active Job, now if you define a queue_name_prefix it will be applied to the queue name set by default_queue_name as well.

Fix query cache for multiple connections

Active Records query cache now supports multiple database connections.

30 peoplecontributed to Rails last week. If you want to be part of that, check out the issues list. Until next time.

The way is long but you can make it easy on me 

Tensorflow journal, part 1

Hi Folks. This is a little post where I'm leaving a bunch of single line notes of things I've found useful in tensorflow, for image based tasks. I mostly have no idea what I'm doing, but I've found some things while working on it that work well for me. Maybe you'll find this useful!

  1. The RMSPropOptimizer seems to be very good for a wide range of tasks. 0.001 seems to be a good default learning rate
  2. Deeper networks need more training rounds to converge. Anecdotally, doubling the number of training rounds per layer (1000, 2000, 4000, etc) seems to be good
  3. The inception module is a very good tool for image discrimination tasks (e.g. recognition, the discriminator in a GAN, the encoder…
Awesome Ruby Newsletter 

Issue 131 - Fibers are the Right Solution

bogdanvlviv / Bogdan 

Rails Teens: день програмування для старшокласників - 08.12.2018 - м. Львів

Дуже часто коли ти старшокласник - це той час коли задаєшся питаннями про майбутню професію і про факультет в університеті, який пов’язаний ближче до того чим ти хочеш займатись в житті. Відповісти на такі питання досить важко, особливо коли тобі мало відомо про ту чи іншу професію.

Pivorak організовує подію Rails Teens: день програмування для старшокласників, яка відбудеться у суботу, 8 грудня 2018 року, цілий день з 10:00 до 18:00, у місті Львів.

Ні, за день ніхто не зможе навчитись програмувати, мета події познайомити учасників з програмування, дати можливість спробувати це на практиці, показати, що програмувати легко, а також допомогти відповісти на питання такі як “чи…

RubyMine Blog 

RubyMine 2018.3 Released: Code Insight for Struct & Rails Scopes, new I18n & refactoring features

RubyMine 2018.3 (build 183.4284.145), the final major update this year, is now available! Learn about all the new features on the What’s new page, or watch this video for a brief summary:


About this release

In a nutshell, with the new version you can:

  • Autocomplete and navigate Rails scopes
  • Discover full support for Struct
  • Create i18n translations on the go, and use other new i18n features
  • Work with GitHub pull requests right in the IDE
  • Extract parameters, inline methods, and variables more safely
  • Fix code smells faster with new intention actions
  • Enjoy the new cleaner Darcula color scheme
  • Search faster with the new Search Everywhere dialog

You will also discover new test gutters,…

RubyGuides 

Dup vs Clone in Ruby: Understanding The Differences

Did you know that you can copy an object in Ruby? Not only that, but there are two different methods to do this! These methods are: dup clone We will explore the differences in a moment, but first… Why would you want to clone an object? Many objects in Ruby are mutable, you can change […]

The post Dup vs Clone in Ruby: Understanding The Differences appeared first on RubyGuides. Don't miss your free gift here :)

Semaphore Engineering Blog 

Why Cloud Native Success Depends on High-Velocity CI/CD

Article originally published on The New Stack.

High Velocity CI/CD

The goal of every tech leader is to deliver bug-free products to customers at high velocity. Today’s cloud-native technology can empower engineering teams to iterate, at scale, faster than ever. But teams that don’t also change how they deliver software will struggle to benefit from the agility and speed to deployment that cloud native can offer.

Hosted CI/CD solutions can do a very good job of solving the “integration” part, such as compiling code and with varying degrees of performance and usability. Semaphore’s platform, for example, is based on bare metal hardware to provide the best possible performance. This makes a big…

Ruby Weekly 

Writing GraphQL Queries in Native Ruby

#426 — November 22, 2018

Read on the Web

Ruby Weekly

🦃 Hey - we're keeping things short this week in respect of Thanksgiving. If you celebrate, we hope you have a good one. Back to full service next week.
— Peter Cooper, Cooperpress

GQLi: Writing GraphQL Queries in Native Ruby — The folks at Contentful are working on a library (GQLi) that allows you to write GraphQL queries in native Ruby. Very promising.

Contentful

Building SQL Expressions with Sequel — A great, in-depth introduction to Sequel, an interesting alternative to Active Record. “Sequel’s API for building SQL expressions…

The Miners - Medium 

Scalable frontend #2 — Common patterns

Scalable Frontend #2 — Common Patterns

Patterns should fit nicely, like playing blocks

Let’s continue our conversation about frontend scalability! In the last post, we discussed architecture fundamentals in frontend applications, but only conceptually. Now we’re going to get our hands dirty with actual code.

Common patterns

How do we implement architecture as mentioned in the first post? What’s different compared to what we’re used to do? How can we combine all of that with dependency injection?

There are recurring patterns in frontend applications, no matter what library you’re using to abstract the view or to manage the state. Here we’re going to talk about some of them, so buckle up your…

Drivy Engineering 

Airflow Architecture at Drivy

Drivy has been using Airflow to orchestrate tasks for 2 years now. We thought it was the best tool on the market when we wanted to start digging into data. The purpose was to understand how well our features were performing. We didn’t really know how the data was going to be used, and by whom. We wanted something easy to use and set up. We set up everything on an ec2 instance. 75 workflows later, we wanted to upgrade our Airflow version and move from a local to a celeryExecutor mode. In a local mode there is only one worker (which is also the webserver and the scheduler). In the celeryExecutor, on the contrary, there are several workers which can execute tasks in parallel. Our number of…

Ruby on Rails Podcast 

251: An Honest Take on GraphQL with Ankita Gupta

Ankita Gupta works as an engineer at honestbee where she has been working on transitioning honestbee's monolith to smaller services. Brittany met Ankita at Rubyconf Malaysia and invited her to the show to discuss integrating GraphQL into a pre-existing Rails application.

Links for this episode:

Remote Ruby 

The Thanksgiving Travel Episode

Ruby Conferences 'n' Camps in 2019 - What's Upcoming? 

Rubyfuza @ Cape Town, South Africa - Ruby Conferences 'n' Camps Update

Conferences 'n' Camps

What's News? What's Upcoming in 2019?

Rubyfuza
Feb/7+8 (2d) Thu+Fri @ Cape Town, South Africa • (Updates)

See all Conferences 'n' Camps in 2019».

GoRails Screencasts 

User Avatars with ActiveStorage

Adding user avatars is pretty easy using Rails' ActiveStorage feature. We'll be using Devise in this example, but this applies to any user authentication system.
All Ruby Podcasts by Devchat.tv 

MRS 070: Michael King

Panel: Charles Max Wood

Guest: Michael King

This week on My Ruby Story, Chuck talks with Michael King who is a developer, an enthusiast for natural languages, developing, and mathematics. Charles and Michael talk about his background, and past/current projects that Michael is working on right now. Other topics of discussion include Ruby, Rails, Audacity, PHP, RubyMotion, and React Native. Check it out!

In particular, we dive pretty deep on:

0:00 – Get A Coder Job!

0:58 – Chuck: Say “hi” Michael! Introduce yourself.

1:12 – Michael: I am a big language learner: Spanish, Portuguese and Chinese. I learned through T.V. and music. I decided to build an app that helped with languages. I…

Janko’s Blog 

Building SQL Expressions with Sequel

This has been published on the Citrusbyte blog.

Greater Than Code 

106: Taking Up Space with Laurie Barth

In this episode, Laurie Barth talks about why it’s good to be a timesuck (aka taking up space and demanding the attention that you need from others), refining interviewing and hiring processes, whether learning is a skill or a mindset, and overcoming demoralization and overwhelm. This episode is sponsored by Crickstart. They make organic cricket protein bars, gourmet crackers, and fruit smoothie mixes made with organically farmed crickets and other delicious wholesome ingredients. Visit crickstart.com and get 20% off with promo code GREATERTHANCODE! Panelists: Jamey Hampton | John K. Sawers Special Guest: Laurie Barth: @laurieontech | laurieontech.com | Girls Who Code | Ten Mile…
Hi, we're Arkency 

I was a CRUDoholic

Imagine one of your non-IT friends. Yeah, the “normal”.

Think about what they do for a living.

Try to construct a few sentences describing their daily work.

This is my take:

Rafal runs a big chess school. He hires chess instructors and assigns them to specific regions where they educate the kids on the beauty of the game of chess. They invent new plays and they use them to simulate chess pieces. Thanks to this, the kids love the game and they practice strategic thinking while playing.

OK.

Now, the next part, let’s translate it into a language, which is basically English, but with just 4 verbs: create, read, update, destroy.

Rafal created a big chess school. He updates the team with…

RubyGarage Blog 

4 Ruby Conferences to Visit in Winter 2019

The upcoming cold snap isn’t a reason to hide under the blankets in your apartment. Get out and warm up your brain at the best Ruby conferences of this winter. We’ve prepared a selection of four high-level conferences where you can grow professionally. Explore, debate, and gain new skills. #1 RubyConf India https://rubygarage.s3.amazonaws.com/uploads/article_image/file/2192/rubyconf-india-2019-1x.png When: January 20–21 Where: Goa, India This is the tenth anniversary of RubyConf India, and you’re invited to celebrate it at the picturesque Park Regis in Goa. The venue is perfect, as it’s just five minutes from the famous Baga beach. Nearby, you can find restaurants and nightclubs for any…
Appfolio Engineering 

Ruby 3x3 and RubyConf Los Angeles

I’m fresh back from RubyConf in Los Angeles. And Keep Ruby Weird. Also, barely returned from, and just wrote an article about, RubyConf Malaysia. Have I mentioned that I’ll be traveling a lot this next year, too?

I’ve just talked to a lot of Rubyists. I’ve learned a few things, including about Ruby 3x3. Let’s talk about where that is, shall we?

Ruby Speed

I continue to update and run Rails Ruby Bench. Speed is one of my big interests. Let’s talk about how Ruby’s speed is doing.

The JIT’s good and getting better. Takashi Kokubun keeps working on it constantly. It’ll be in the Ruby 2.6.0 Christmas release, and it was also in all the recent Ruby preview releases. Method inlining, one of the big…

All Ruby Podcasts by Devchat.tv 

RR 389: Developer Environment with the Panelists

Panel:

  • David Kimura
  • Eric Berry

In this episode of Ruby Rogues, the panelists talk amongst themselves about their favorite software, equipment, and apps. Both Eric and David thoroughly share their preferred picks within these categories, and they explain how and why they use the specified item. Check out today’s episode to hear more!

Show Topics:

0:00 – Advertisement: Sentry.io

1:03 – David: Welcome! Today, Chuck is not feeling well. I am David and today we have Eric Berry on our panel today. It is just the two of us today. I want to talk about our development environment. What is your setup like? Do you have an office space and your hardware?

1:58 – Eric: I Have a room in my…

example.com 

Speaker Pro-Tips

I just gave my talk and I think it went swimmingly. One thing that really worked for me was putting it together in Keynote. Despite having a ton of movies and images, most of the tedium was automatically handled by using keynote to do almost all of the work.

My process:

  1. Come up with a talk proposal. Six, actually. Submit them.
  2. Hope one gets accepted.
  3. Assuming one gets accepted, accept the talk with the organizer.
  4. Procrastinate, but hope that you subconsciously chew on it.
  5. Work on an outline in omnioutliner. This is important.
  6. Print it out, scribble all over it, put edits back in document.
  7. Once I’m happy with it, export to powerpoint.
  8. Open in keynote.
  9. Select my theme,…
Ruby Conferences 'n' Camps in 2019 - What's Upcoming? 

RubyConf Australia @ Melbourne, Victoria, Australia - Ruby Conferences 'n' Camps Update

Conferences 'n' Camps

What's News? What's Upcoming in 2019?

RubyConf Australia
Feb/7-9 (3d) Thu-Sat @ Melbourne, Victoria, Australia • (Updates)

See all Conferences 'n' Camps in 2019».

RubyGuides 

What Is MJIT in Ruby 2.6 & How Does It Work?

Ruby’s performance has been improving a lot, version after version… and the Ruby development team is making every effort to make Ruby even faster! One of these efforts is the 3×3 project. The goal? Ruby 3.0 will be 3 times faster than Ruby 2.0. Part of this project is the new MJIT compiler, which is […]

The post What Is MJIT in Ruby 2.6 & How Does It Work? appeared first on RubyGuides. Don't miss your free gift here :)

Scout ~ The Blog 

Upgraded Ecto logging hooks to Telemetry in new Agent 0.4.8

image alt text

Recently the Ecto library released a major update - Version 3.0. As part of the changes, some of the hooks that Scout relied on to capture data have changed. No longer can we hook into Ecto's logging system to extract information about queries being run, and instead we have a proper Telemetry event to listen to.

This is exciting because the Telemetry system lets our agent be less dependent on the exact internals of each library we instrument, and so per-version gotchas will be fewer and further between. We're looking forward to Phoenix's Telemetry hooks, and hopefully this will inspire even more libraries to start exposing them as well.

We've updated our installation documentation to…

Code with Jason 

When I Use Controller/Request Specs in Rails and When I Don’t

Every so often I come across a question of controller or request specs and when to use them.

Before I can address this I need to get some terminology out of the way. In RSpec there are controller tests and request specs which are similar but subtly different. Let’s talk about what the difference is.

Controller specs vs. request specs

As of (apparently) July 2016, the Rails team and the RSpec core team recommend using request specs instead of controller specs. Here’s why, in their words:

For new Rails apps: we don’t recommend adding the rails-controller-testing gem to your application. The official recommendation of the Rails team and the RSpec core team is to write request specs instead.…

Julia Evans 

An example of how C++ destructors are useful in Envoy

For a while now I’ve been working with a C++ project (Envoy), and sometimes I need to contribute to it, so my C++ skills have gone from “nonexistent” to “really minimal”. I’ve learned what an initializer list is and that a method starting with ~ is a destructor. I almost know what an lvalue and an rvalue are but not quite.

But the other day when writing some C++ code I figured out something exciting about how to use destructors that I hadn’t realized! (the tl;dr of this post for people who know C++ is “julia finally understands what RAII is and that it is useful” :))

what’s a destructor?

C++ has objects. When an C++ object goes out of scope, the compiler inserts a call to…

Ruby Conferences 'n' Camps in 2019 - What's Upcoming? 

RubyConf (United States) @ Nashville, Tennessee, United States - Ruby Conferences 'n' Camps Update

Conferences 'n' Camps

What's News? What's Upcoming in 2019?

RubyConf (United States)
Nov/18-20 (3d) Mon-Wed @ Nashville, Tennessee, United States • (Updates)

See all Conferences 'n' Camps in 2019».

Ruby Conferences 'n' Camps in 2019 - What's Upcoming? 

RubyConf India @ Goa, India - Ruby Conferences 'n' Camps Update

Conferences 'n' Camps

What's News? What's Upcoming in 2019?

RubyConf India
Jan/20+21 (2d) Sun+Mon @ Goa, India • (Updates)

See all Conferences 'n' Camps in 2019».

Remote Ruby 

Ruby 3, Ruby 4!?, Matz's Long Term Plans, More StimulusJS, and a New Stripe Course

Ruby Conferences 'n' Camps in 2019 - What's Upcoming? 

Ruby on Ice @ Tegernsee, Bavaria, Germany - Ruby Conferences 'n' Camps Update

Conferences 'n' Camps

What's News? What's Upcoming in 2019?

Ruby on Ice
Feb/22-24 (3d) Fri-Sun @ Tegernsee, Bavaria, Germany • (Updates)

See all Conferences 'n' Camps in 2019».

Ruby Conferences 'n' Camps in 2019 - What's Upcoming? 

European Ruby Konference (EuRuKo) @ Rotterdam, South Holland, Netherlands - Ruby Conferences 'n' Camps Update

Conferences 'n' Camps

What's News? What's Upcoming in 2019?

European Ruby Konference (EuRuKo)
Jun/21+22 (2d) Fri+Sat @ Rotterdam, South Holland, Netherlands • (Updates)

See all Conferences 'n' Camps in 2019».