<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Nick Schwaderer</title>
    <description>The latest articles on Forem by Nick Schwaderer (@schwad).</description>
    <link>https://forem.com/schwad</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F275056%2F3a211938-512c-4b7a-b902-eb4d5f504fb1.jpeg</url>
      <title>Forem: Nick Schwaderer</title>
      <link>https://forem.com/schwad</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/schwad"/>
    <language>en</language>
    <item>
      <title>Matz talks mRuby at Barcelona Ruby Conf 2014</title>
      <dc:creator>Nick Schwaderer</dc:creator>
      <pubDate>Wed, 30 Sep 2020 11:21:54 +0000</pubDate>
      <link>https://forem.com/schwad/matz-talks-mruby-at-barcelona-ruby-conf-2014-399p</link>
      <guid>https://forem.com/schwad/matz-talks-mruby-at-barcelona-ruby-conf-2014-399p</guid>
      <description>&lt;p&gt;&lt;em&gt;Past Rubies is a tiny weekly newsletter that shares curated historical content from the Ruby community. Consider it Ruby's version of 'on this day in history'. New issues every Wednesday. &lt;a href="http://pastrubies.com"&gt;Subscribe to get this to your inbox&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;a href="https://www.youtube.com/watch?v=5FLrKg-b6o8"&gt;Yukihiro Matsumoto - mruby: AltRuby&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--n0dVTujt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/B5fxQzB.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--n0dVTujt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/B5fxQzB.png" alt="B5fxqzb"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Ruby is in satellites. Ruby is being used in hardware. A lot of this work is built off of mruby (embedded ruby) and affiliated projects. Here's a great talk Matz gave six years ago this week about a fair few things including mruby. :)&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://www.youtube.com/watch?v=IqrwPVtSHZI"&gt;Using Rust with Ruby, pair programming with Yehuda Katz in 2015&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_p4BJIIo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/JJ21myM.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_p4BJIIo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/JJ21myM.png" alt="Jj21mym"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Book out some time to sit down and watch this. We get to see *two hours* of pair programming with Yehuda Katz this week five years ago using Rust with Ruby&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://web.archive.org/web/20070210111025/http://tenderlovemaking.com/2006/09/28/new-ruby-betabrite-002/"&gt;Ruby with BetaBrite in 2007 with Aaron Patterson&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Q31wsBEC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/emKIaBd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Q31wsBEC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/emKIaBd.png" alt="Emkiabd"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This week THIRTEEN YEARS AGO Ruby hero tenderlove released a new version of the ruby BetaBrite sign library, allowing you to compose ruby to control betabrite signs. This was ruby in the IoT space many years before the phrase IoT existed! Write in if you get the code up and running. :)&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://i.imgur.com/emKIaBd.png"&gt;Making Javascript more Ruby-esque with JsClass in 2008&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IHn_fLHY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/dlBMGzc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IHn_fLHY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/dlBMGzc.png" alt="Dlbmgzc"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Twelve years ago this week people were turning their heads towards JsClass; which takes a lot of elements we love about ruby and implements them in Javascript. Note here in the screenshot that yes, that includes an Enumerable implementation! I would love to see if we could get this running on today's javascript.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>rails</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>Using AWS with Ruby - in 2007</title>
      <dc:creator>Nick Schwaderer</dc:creator>
      <pubDate>Wed, 08 Jul 2020 14:16:47 +0000</pubDate>
      <link>https://forem.com/schwad/using-aws-with-ruby-in-2007-226n</link>
      <guid>https://forem.com/schwad/using-aws-with-ruby-in-2007-226n</guid>
      <description>&lt;p&gt;This one is a bit of a treat. Normally I capture blog posts, articles, releases or talks. But this week I've found an AWS-with-Ruby tutorial archived from the AWS site this week in 2007! Check it out here: &lt;a href="http://www.pastrubies.com/"&gt;http://www.pastrubies.com/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>programming</category>
      <category>history</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>Ruby Conf 2005 Agenda Released</title>
      <dc:creator>Nick Schwaderer</dc:creator>
      <pubDate>Wed, 01 Jul 2020 17:56:40 +0000</pubDate>
      <link>https://forem.com/schwad/ruby-conf-2005-agenda-released-568j</link>
      <guid>https://forem.com/schwad/ruby-conf-2005-agenda-released-568j</guid>
      <description>&lt;p&gt;&lt;strong&gt;Enjoying PastRubies? Know a friend who would be into this type of content? Let em know! :)&lt;/strong&gt;   &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Past Rubies is a tiny weekly newsletter that shares curated historical content from the Ruby community. Consider it Ruby's version of 'on this day in history'. New issues every Wednesday. &lt;a href="http://pastrubies.com"&gt;Subscribe&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;a href="https://web.archive.org/web/20050708034507/http://www.rubyconf.org/agenda.html"&gt;RubyConf 2005 Agenda Released&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nce3BS4j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/JFxrKQD.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nce3BS4j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/JFxrKQD.png" alt="Jfxrkqd"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This week in 2005 saw the release of that year's RubyConf agenda. I always find these as a gold mine for really interesting information about what was going on in the Ruby Community at the time! I was tempted to make this week just highlighting the talks of the time but think you'll enjoy parsing the agenda as much as I did. Familiar faces included DHH and Matz, and other legends such as the late Jim Weirich and Ryan Davis. Would have loved to have been there!&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://web.archive.org/web/20080528153536/http://po-ru.com/diary/convert-ruby-to-javascript/"&gt;Converting Ruby to Javascript (fourteen years ago!)&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--crscK3Ch--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/kkml0C9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--crscK3Ch--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/kkml0C9.png" alt="Kkml0c9"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;In 2006 this week London's Paul Battley had written a Ruby-to-JS converter in under 200 lines of Ruby code. It's hairy, and I didn't even try to run it nowadays. However it's a real treat to see folks looking at these issues when even JavaScript still feels so young sometimes. If you play around with the code let us know! (But I'm unsure how much use you'd get out of 2006-JS these days...)&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/147345"&gt;Let's collect some garbage&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ee_Bk1X8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/eIj6SYx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ee_Bk1X8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/eIj6SYx.png" alt="Eij6syx"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Now if you want to dig into the real, REAL nitty gritty of Ruby history, it can be a lot to parse but the &lt;code&gt;ruby-talk&lt;/code&gt; community is great. It's something I'm going to try to feature more. Today's &lt;code&gt;ruby-forum&lt;/code&gt; only goes back to 2008, but you can still get back into the 2000's with some gumption. (Which we all have, right?) This week in 2005 we say an interesting post that piqued the Ruby community, having a dig into the &lt;strong&gt;GC&lt;/strong&gt; and finding weird failing edge cases. I think sometimes it's too easy to just think of the Garbage Collector as a &lt;strong&gt;there be dragons&lt;/strong&gt; area of Ruby and never play around with it. This thread and following discussion is a *great* example of that.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="http://www.rubyinside.com/web-spidering-with-anemone-1927.html"&gt;Web spidering back in the day&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LrxlEa_U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/IxLSQ1I.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LrxlEa_U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/IxLSQ1I.png" alt="Ixlsq1i"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;If _why is the Herodotus of Ruby circa 2003-2009, then &lt;a href="https://rubyweekly.com"&gt;Peter Cooper&lt;/a&gt; is the Tacitus of Ruby 2006-present. We are so grateful for all of his work the last decade to effectively chronicle the goings on of Ruby. Here he shares a neat tool of the time, Anemone, to manage your own spiders and configure your own web crawling. Neat!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>pastrubies</category>
    </item>
    <item>
      <title>How to use horizontal sharding in Rails 6.1</title>
      <dc:creator>Nick Schwaderer</dc:creator>
      <pubDate>Tue, 03 Mar 2020 16:28:15 +0000</pubDate>
      <link>https://forem.com/schwad/how-to-use-horizontal-sharding-in-rails-6-1-4e4k</link>
      <guid>https://forem.com/schwad/how-to-use-horizontal-sharding-in-rails-6-1-4e4k</guid>
      <description>&lt;p&gt;&lt;strong&gt;NOTE: As of writing Rails 6.1 has not been released, and to follow along you'll need to pointing to Rails Master, which is a handy thing to know how to do.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aiIwo2U6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/D28IKgt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aiIwo2U6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/D28IKgt.png" alt="alt"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We saw some big news this week, as Rails continues to &lt;a href="https://guides.rubyonrails.org/active_record_multiple_databases.html"&gt;get better and better&lt;/a&gt; when it comes to supporting multiple databases.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/eileencodes"&gt;Eileen Uchitelle&lt;/a&gt; and &lt;a href="https://github.com/seejohnrun"&gt;John Crepezzi&lt;/a&gt; shipped a commit to Rails master that allows full, &lt;strong&gt;out-of-the-box&lt;/strong&gt; support &lt;a href="https://github.com/rails/rails/pull/38531/files"&gt;for horizontal sharding&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wait, shard what?
&lt;/h2&gt;

&lt;p&gt;It is very possible you've gone your entire dev career without needing to shard, or even know vaguely what it is. That's okay. Rails has intentionally been constructed in such a way that you don't need to be a DB expert to use it.&lt;/p&gt;

&lt;p&gt;However, &lt;a href="https://en.wikipedia.org/wiki/Shard_(database_architecture)"&gt;here are a few links&lt;/a&gt; giving background on &lt;a href="https://blog.yugabyte.com/how-data-sharding-works-in-a-distributed-sql-database/"&gt;what sharding is&lt;/a&gt;, and maybe &lt;a href="https://www.nuodb.com/blog/understanding-whens-and-whys-database-sharding"&gt;why you'd want to use it&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Forget it, I have no idea what I'm doing, but I want to shard &lt;em&gt;NOW&lt;/em&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jWadWRLm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/QoKtHpu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jWadWRLm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/QoKtHpu.png" alt="alt"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sweet! Me too.&lt;/p&gt;

&lt;p&gt;First off, this is a Rails 6.1 feature (heh, which doesn't exist yet), so you'll need to spin up a Rails application off of the master branch.&lt;/p&gt;

&lt;p&gt;You can do that by first generating a new rails app off of the latest stable branch:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;rails new myapp --edge&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then, to point to the master branch, change the rails line to the below:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gem 'rails', github: "rails/rails", branch: "master"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Rebundle and voilá!&lt;/p&gt;

&lt;h3&gt;
  
  
  Let's make a bunch of databases
&lt;/h3&gt;

&lt;p&gt;Update your &lt;code&gt;database.yml&lt;/code&gt; like so (much of what comes being taken from the commit's docs):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;development&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;primary&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="s"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;*default&lt;/span&gt;
    &lt;span class="na"&gt;database&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my_primary_database&lt;/span&gt;
  &lt;span class="na"&gt;primary_replica&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;database&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my_primary_database&lt;/span&gt;
    &lt;span class="na"&gt;replica&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;
  &lt;span class="na"&gt;primary_shard_one&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="s"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;*default&lt;/span&gt;
    &lt;span class="na"&gt;database&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my_primary_shard_one&lt;/span&gt;
  &lt;span class="na"&gt;primary_shard_one_replica&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="s"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;*default&lt;/span&gt;
    &lt;span class="na"&gt;database&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my_primary_shard_one&lt;/span&gt;
    &lt;span class="na"&gt;replica&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;You can use whatever database or adapter you want. I normally hook up Postgres, today playing around with SQLite3. For more advanced systems, these could all be pointing to different databases, local or remote, in vastly different locations. Pretty cool, huh?&lt;/p&gt;

&lt;p&gt;In this setup from the docs, we have a primary and primary_shard, and each has a replica. Nifty!&lt;/p&gt;

&lt;p&gt;Then run:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;rails db:create; rails db:migrate&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Created database 'my_primary_database'
Created database 'my_primary_shard_one'
Created database 'db/test.sqlite3'
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Time to fill the database
&lt;/h2&gt;

&lt;p&gt;Let's generate a model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rails g model Person name:string
rails db:migrate
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;





&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#=&amp;gt;
== 20200303155421 CreatePeople: migrating ====================================
-- create_table(:animals)
   -&amp;gt; 0.0026s
== 20200303155421 CreatePeople: migrated (0.0028s) ===========================

== 20200303155421 CreatePeople: migrating ====================================
-- create_table(:animals)
   -&amp;gt; 0.0040s
== 20200303155421 CreatePeople: migrated (0.0041s) ===========================

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;And either in a seeds file or our console, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="no"&gt;Person&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="ss"&gt;name: &lt;/span&gt;&lt;span class="s1"&gt;'Frieda'&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="no"&gt;Person&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="ss"&gt;name: &lt;/span&gt;&lt;span class="s1"&gt;'Bill'&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="no"&gt;Person&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="ss"&gt;name: &lt;/span&gt;&lt;span class="s1"&gt;'Penelope'&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Playing with the databases
&lt;/h2&gt;

&lt;p&gt;Now, let's update our &lt;code&gt;application_record.rb&lt;/code&gt; like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ApplicationRecord&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;ActiveRecord&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Base&lt;/span&gt;
  &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;abstract_class&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kp"&gt;true&lt;/span&gt;

  &lt;span class="n"&gt;connects_to&lt;/span&gt; &lt;span class="ss"&gt;shards: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="ss"&gt;default: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="ss"&gt;writing: :primary&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;reading: :primary_replica&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="ss"&gt;shard_one: &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="ss"&gt;writing: :primary_shard_one&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;reading: :primary_shard_one_replica&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;We will now reload our console and see what we can do, using &lt;code&gt;ActiveRecord::Base.connected_to&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="no"&gt;ActiveRecord&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Base&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;connected_to&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;role: :reading&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;shard: :shard_one&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  &lt;span class="no"&gt;Person&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;first&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="c1"&gt;#=&amp;gt; nil&lt;/span&gt;


&lt;span class="c1"&gt;# Now let's write to :shard_one,&lt;/span&gt;
&lt;span class="no"&gt;ActiveRecord&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Base&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;connected_to&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;role: :writing&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;shard: :shard_one&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
   &lt;span class="no"&gt;Person&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
     &lt;span class="ss"&gt;name: &lt;/span&gt;&lt;span class="s1"&gt;'John'&lt;/span&gt;
     &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="no"&gt;Person&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="ss"&gt;name: &lt;/span&gt;&lt;span class="s1"&gt;'Georgina'&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
 &lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="c1"&gt;#=&amp;gt; #&amp;lt;Person id: 2, name: "Georgina", created_at: "2020-03-03 16:10:14", updated_at: "2020-03-03 16:10:14"&amp;gt;&lt;/span&gt;

&lt;span class="c1"&gt;# And we'll read from :shard_one's replica:&lt;/span&gt;
&lt;span class="no"&gt;ActiveRecord&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Base&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;connected_to&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;role: :reading&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;shard: :shard_one&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  &lt;span class="no"&gt;Person&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;count&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="c1"&gt;#=&amp;gt; 2&lt;/span&gt;

&lt;span class="c1"&gt;# And finally confirm that shard one's data has not been written to primary:&lt;/span&gt;

&lt;span class="no"&gt;ActiveRecord&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Base&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;connected_to&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;role: :reading&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;shard: :default&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  &lt;span class="no"&gt;Person&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;count&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="c1"&gt;#=&amp;gt; 3&lt;/span&gt;

&lt;span class="c1"&gt;# This is correct, remember the three people we created earlier who default to the primary database.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Not too tricky
&lt;/h2&gt;

&lt;p&gt;That was.... not as involved as one would inspect. Cheers to the Rails core team for once again making things as straightforward and developer friendly as possible! 💖&lt;/p&gt;

&lt;p&gt;You can use this code however you like, and write and read from databases in whatever architecture is justified by your business logic.&lt;/p&gt;

&lt;p&gt;Once again, for all the full details on using this feature in the wild, &lt;a href="https://github.com/rails/rails/pull/38531/files"&gt;see the full PR here&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>todayilearned</category>
      <category>database</category>
      <category>scaling</category>
    </item>
    <item>
      <title>Ruby Science Saturday: use Mixin Modules or Reopen Classes? 👩‍🔬🔬🧬🧪</title>
      <dc:creator>Nick Schwaderer</dc:creator>
      <pubDate>Sat, 22 Feb 2020 14:11:39 +0000</pubDate>
      <link>https://forem.com/schwad/ruby-science-saturday-use-mixin-modules-or-reopen-classes-2i9m</link>
      <guid>https://forem.com/schwad/ruby-science-saturday-use-mixin-modules-or-reopen-classes-2i9m</guid>
      <description>&lt;p&gt;Ruby legend &lt;a href="https://twitter.com/fxn"&gt;Xavier Noria&lt;/a&gt; recently penned a tweet that got me thinking about how we organize and package up our native Ruby code:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YP4Dd_qJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/NNpVk4Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YP4Dd_qJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/NNpVk4Q.png" alt="Xavier Noria Tweet"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;How often do we just dump our code into mix-in modules (that never get reused) when our classes get too large? What if we continued to organize our code into separate files, but reopened classes?&lt;/p&gt;

&lt;p&gt;This is something we can debate all day in the comments, but that sparked my &lt;strong&gt;Ruby Science&lt;/strong&gt; question:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What if one of these approaches was faster?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Well, thanks to &lt;a href="https://github.com/evanphx/benchmark-ips"&gt;benchmark-ips&lt;/a&gt;, (which I have also bundled into my own &lt;a href="https://github.com/Schwad/schwad_performance_logger"&gt;performance logging gem&lt;/a&gt;) we don't have to wonder. &lt;/p&gt;

&lt;p&gt;I fired up three example cases (Reopen, Include mixin module, Extend mixin module) and ran them against each other in a simple test case. Code below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;module MixinDependency
  def open_door
    puts 'Door is open!'
  end
end

class DoorOpenerMixin
  include MixinDependency

  def close_door
    puts 'Door is closed!'
  end
end

class DoorOpenerMixinExtend
  extend MixinDependency
end

class DoorOpenerReopen
  def close_door
    puts 'Door is closed!'
  end
end

class DoorOpenerReopen
  def open_door
    puts 'Door is open!'
  end
end
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;And we tested it with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;require 'benchmark/ips'

Benchmark.ips do |x|

  x.report('Include') { DoorOpenerMixin.new.open_door }
  x.report('Extend') { DoorOpenerMixinExtend.open_door }
  x.report('Reopen') { DoorOpenerReopen.new.open_door }

  x.compare!
end
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Results? Nothing exciting.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Comparison:
              Extend:   214816.5 i/s
              Reopen:   197784.3 i/s - same-ish: difference falls within error
             Include:   182298.2 i/s - same-ish: difference falls within error
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Even inconclusive findings are still &lt;strong&gt;findings&lt;/strong&gt;, and I hope you enjoyed seeing how I picked through this hypothesis to give a clear answer. If you're unfamiliar with benchmark-ips, copy this code and try it out yourself! It really is one of my favorite tools in my toolbox.&lt;/p&gt;

&lt;p&gt;One &lt;em&gt;small&lt;/em&gt; but fun finding, I tried running this on different Ruby versions, you can see a clear speed bump since Ruby 2.1! Here's the results on the old version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Comparison:
              Extend:   178840.8 i/s
             Include:   167210.7 i/s - same-ish: difference falls within error
              Reopen:   166005.2 i/s - same-ish: difference falls within error
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;If you have any 'experiments', feel free to share your results and thoughts below! 🥼 🤔&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>performance</category>
      <category>todayilearned</category>
      <category>benchmarking</category>
    </item>
    <item>
      <title>Dev.to is one of the best open-source Rails apps you can contribute to</title>
      <dc:creator>Nick Schwaderer</dc:creator>
      <pubDate>Thu, 02 Jan 2020 13:25:58 +0000</pubDate>
      <link>https://forem.com/schwad/dev-to-is-one-of-the-best-open-source-rails-apps-you-can-contribute-to-2bb1</link>
      <guid>https://forem.com/schwad/dev-to-is-one-of-the-best-open-source-rails-apps-you-can-contribute-to-2bb1</guid>
      <description>&lt;p&gt;This week the &lt;a href="http://5by5.tv/rubyonrails"&gt;Ruby on Rails podcast&lt;/a&gt; released &lt;a href="http://5by5.tv/rubyonrails/301"&gt;episode 301&lt;/a&gt;, which I was &lt;em&gt;very&lt;/em&gt; lucky to be a part of. &lt;/p&gt;

&lt;p&gt;On the episode &lt;a href="https://twitter.com/BrittJMartin"&gt;Brittany Martin&lt;/a&gt; and &lt;a href="https://twitter.com/Schwad4HD14"&gt;I&lt;/a&gt; talked about several topics, including ParisRB and combating imposter syndrome with chess and bodyPUMP.&lt;/p&gt;

&lt;p&gt;Also, I went on at length about the &lt;a href="https://github.com/thepracticaldev/dev.to"&gt;dev.to source code on Github&lt;/a&gt;. For those who don't know, this application is primarily a Ruby on Rails backend. &lt;/p&gt;

&lt;p&gt;As a bonus, it handles millions in monthly traffic and is a very mature, elegant application. It hooks into tooling such as Algolia and Pusher, and other very interesting technologies. The most beautiful part is it's &lt;strong&gt;open source&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That means if you've been working on Rails webapps for anywhere from 1-10 years, it's a fantastic and evolving codebase to explore and learn. &lt;/p&gt;

&lt;p&gt;Never written a publicly accessible API before? Just have a look at how it's been architected for dev.to!&lt;/p&gt;

&lt;p&gt;Unsure about notification handling on a large scale for the first time? Fear not- there's a great example to be had here!&lt;/p&gt;

&lt;p&gt;Very often people look to Discourse (another fantastic open source Rails app)- but if you're really looking to upskill from Junior to Middleweight or Middleweight to Senior as a Rails developer, working through this codebase could be the boost you need!&lt;/p&gt;

&lt;p&gt;Check out the episode:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://5by5.tv/rubyonrails/301"&gt;http://5by5.tv/rubyonrails/301&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>programming</category>
      <category>opensource</category>
    </item>
    <item>
      <title>_why interviews DHH</title>
      <dc:creator>Nick Schwaderer</dc:creator>
      <pubDate>Wed, 18 Dec 2019 13:20:35 +0000</pubDate>
      <link>https://forem.com/schwad/why-interviews-dhh-9oa</link>
      <guid>https://forem.com/schwad/why-interviews-dhh-9oa</guid>
      <description>&lt;p&gt;&lt;em&gt;Past Rubies is a tiny weekly newsletter that shares curated historical content from the Ruby community. Consider it Ruby's version of 'on this day in history'. New issues every Wednesday. &lt;a href="https://www.getdrip.com/forms/275494850/submissions"&gt;Get issues straight to your inbox&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;a href="https://web.archive.org/web/20090126211003/http://redhanded.hobix.com/5.gets/getsWithDavidHeinemeierHansson.html"&gt;_why interviews DHH&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TAOVDsZ_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/hQppR59.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TAOVDsZ_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/hQppR59.png" alt="Hqppr59"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Christmas Eve 2004 (!) saw our favorite &lt;strong&gt;why the lucky stiff&lt;/strong&gt; interviewing DHH. They cover Instiki, the future of Rails, music and skyscrapers.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://web.archive.org/web/20090220132631/http://www.rubyinside.com/advent2006/"&gt;Peter Cooper's RubyInside releases the ultimate Ruby advent calendar&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WkBsbiMy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/jFbBNJD.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WkBsbiMy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/jFbBNJD.png" alt="Jfbbnjd"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;_What a treat for our readers to peruse over the Christmas Holiday break. As hinted last week, here is Peter Cooper's amazing Ruby advent calendar released back in 2006. You have interesting Ruby snippets, cool links, and even shnazzy wallpaper. If you're a Ruby history buff like me, this is a &lt;strong&gt;gold mine&lt;/strong&gt; _&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://web.archive.org/web/20080101080007/http://weblog.raganwald.com/2007/12/why-rubinius-matters-to-rubys-future.html"&gt;Why Rubinius matters to Ruby's future&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uadmDtyC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/sNQM5mo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uadmDtyC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/sNQM5mo.png" alt="Snqm5mo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This post released 11 years ago this week by Reg Braithwaite goes into the importance of Rubinius. At that time Engine Yard had five full time staffers working on Rubinius. Pretty interesting discussion in the comments below.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://www.quora.com/What-makes-Rails-a-framework-worth-learning-in-2017/answer/David-Heinemeier-Hansson?srid=tfS=1"&gt;What makes Rails a framework worth learning in 2017&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LNKcw8-I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/rz3HMZI.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LNKcw8-I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/rz3HMZI.png" alt="Rz3hmzi"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Once in a while I'm allowed to treat myself to a link *not* on this week in history, right? We are likely to take a break during the festive season so it feels appropriate to wrap things up with this post from DHH. Enjoy!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>todayilearned</category>
      <category>ruby</category>
      <category>rails</category>
      <category>pastrubies</category>
    </item>
    <item>
      <title>Rails 1.0 turns 14</title>
      <dc:creator>Nick Schwaderer</dc:creator>
      <pubDate>Thu, 12 Dec 2019 16:28:44 +0000</pubDate>
      <link>https://forem.com/schwad/rails-1-0-turns-14-1698</link>
      <guid>https://forem.com/schwad/rails-1-0-turns-14-1698</guid>
      <description>&lt;p&gt;&lt;em&gt;Past Rubies is a tiny weekly newsletter that shares curated historical content from the Ruby community. Consider it Ruby's version of 'on this day in history'. New issues every Wednesday. &lt;a href="https://www.getdrip.com/forms/275494850/submissions"&gt;Get copies to your inbox&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;a href="https://tom-lord.github.io/10-More-New-Features-In-Ruby-2.5/"&gt;10 more features in Ruby 2.5&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zXHB0e1i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/oDWGr6O.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zXHB0e1i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/oDWGr6O.png" alt="Odwgr6o"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;It's Christmas which means new Ruby time! But I think it's all too easy to forget the new features of recent versions so we can utilize the latest Ruby goodness! Here's a great writeup published this week in 2017 on those features in Ruby 2.5&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://web.archive.org/web/20090815113042/http://redhanded.hobix.com/inspect/aPaginationHelperForRails.html"&gt;A pagination helper for Rails in 2004&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rXxhC2Lq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/HyRr5SK.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rXxhC2Lq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/HyRr5SK.png" alt="Hyrr5sk"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Well would you look at that! A little cheeky banter between Ruby legends _why and DHH this week fifteen years ago. This is a neat little peek into Rails pagination in 2004, a year before 1.0 was released! (Yes, it's that old of a problem space)&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://web.archive.org/web/20120222115215/https://www.engineyard.com/blog/2011/what-are-events-why-might-you-care-and-how-can-eventmachine-help"&gt;What are events, why you might care, and how EventMachine can help&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZEsvqSrr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/BiqgLMx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZEsvqSrr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/BiqgLMx.png" alt="Biqglmx"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This is a great little writeup on the EngineYard blog by Kirk Haines on events and event machine (published this week in 2011)&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://web.archive.org/web/20061115100130/http://farm.tucows.com/_archives/2005/12/16/"&gt;The 2005 Ruby Advent Calendar&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bf0Ce3c2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/6CM9fyY.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bf0Ce3c2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/6CM9fyY.png" alt="6cm9fyy"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Who remembers reading the Tucows blog back in the day? It was a massive source of info for Rubyists in the early coding days. Here's a glimpse into the Ruby Advent Calendar they were hosting in 2005 (note: the famous PeterC also had a few that may yet get featured this month!)&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://web.archive.org/web/20061115100130/http://farm.tucows.com/_archives/2005/12/16/"&gt;Neat Ruby snippets 2004&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_J-TxNrV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/aOO2VI1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_J-TxNrV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/aOO2VI1.png" alt="Aoo2vi1"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Gosh, I haven't hustled through the RubyTalk archives yet... That changes this week! Here's a pleasant fifteen year old (this week) thread on interesting Ruby snippets that accomplish cool things. (We're talking servers in six lines)&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>rails</category>
      <category>history</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>The Ruby on Rails Whitepaper [Past Rubies]</title>
      <dc:creator>Nick Schwaderer</dc:creator>
      <pubDate>Wed, 04 Dec 2019 15:37:51 +0000</pubDate>
      <link>https://forem.com/schwad/the-ruby-on-rails-whitepaper-past-rubies-288d</link>
      <guid>https://forem.com/schwad/the-ruby-on-rails-whitepaper-past-rubies-288d</guid>
      <description>&lt;p&gt;&lt;strong&gt;Past Rubies is a tiny weekly newsletter that shares curated historical content from the Ruby community. Consider it Ruby's version of 'on this day in history'. New issues every Wednesday - &lt;a href="https://www.getdrip.com/forms/275494850/submissions"&gt;subscribe here&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://web.archive.org/web/20110818131411/http://infoether.com/RubyRailsEcosystemFall2009.pdf"&gt;The Ruby on Rails White Paper, 10 years later&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RX_706xr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/4vGcZuU.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RX_706xr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/4vGcZuU.png" alt="4vgczuu"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This was actually released in the &lt;em&gt;autumn&lt;/em&gt; of 2009, but was making the rounds on blogs a decade ago this week as more people discovered it. InfoEther and Mark Gardner released a very comprehensive Ruby on Rails whitepaper which covered everything from the current state of the framework, estimated developer population, to the community and ecosystem. For those of us who have been around a while or even fancy ourselves a bit of a "Ruby Historian", this is an unrivaled snapshot into the "State of Rails" in 2009.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://www.youtube.com/watch?v=kgDqUHWVw4A"&gt;It's time for... SCIENCE!&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Taj9JXLv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/TTbZ6zs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Taj9JXLv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/TTbZ6zs.png" alt="Ttbz6zs"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This week five years ago we got to see &lt;a href="http://jesseplusplus.com/"&gt;Jesse Toth&lt;/a&gt; give a talk about their work on Github's &lt;a href="https://github.com/github/scientist"&gt;Scientist&lt;/a&gt;. This allows developers to compare, via the lens of 'science experiments', old code and refactored code. Enjoy the talk and the code!&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://web.archive.org/web/20060115033010/http://snakesandrubies.com/event/"&gt;Snakes and Rubies Conf&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--t3GuKBXP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/SIyaykR.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--t3GuKBXP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/SIyaykR.png" alt="Siyaykr"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;A whopping fourteen years ago saw Snakes and Rubies Conf, a collaborative conference between the Ruby and Python programming communities. &lt;a href="https://web.archive.org/web/20080128102833/http://www.djangoproject.com/weblog/2005/dec/04/snakes_and_rubies/"&gt;You can check out a wrapup here&lt;/a&gt;, and plenty from DHH and crew at the link above. Since I run everything through the wayback machine, most of the old links SHOULD work.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://www.youtube.com/watch?v=xG1S9ZPCy2Q"&gt;In memory of Ezra Zygmuntowicz&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_zxzu4NX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/ITYLwip.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_zxzu4NX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/ITYLwip.png" alt="Itylwip"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;In a massive loss for the Ruby community, we found out about the passing of Ezra five years ago this last week. To honor his memory, we have this very kind tribute from Mike Perham back in 2014. &lt;a href="https://www.youtube.com/watch?v=Alko6wQo8mk"&gt;There is also this magnificent talk from Ezra himself where he goes through a lot of his journey.&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>rails</category>
    </item>
    <item>
      <title>Using Rubyfmt with Atom</title>
      <dc:creator>Nick Schwaderer</dc:creator>
      <pubDate>Mon, 02 Dec 2019 16:16:17 +0000</pubDate>
      <link>https://forem.com/schwad/using-rubyfmt-with-atom-2oa0</link>
      <guid>https://forem.com/schwad/using-rubyfmt-with-atom-2oa0</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--d1XV8EmD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/cdkKQBu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--d1XV8EmD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/cdkKQBu.png" alt="Favorite"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Rubyfmt, the exciting project from &lt;a href="https://twitter.com/penelope_zone"&gt;@penelope_zone&lt;/a&gt; continues to grow by the day. After being a fan of this work for quite a while, I set out to hack together a way to get it running slick on Atom. I'm writing today to share those few steps so that you, too, can enjoy the magic of Rubyfmt on Atom!&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Rubyfmt?
&lt;/h2&gt;

&lt;p&gt;I reckon 90% of people reading this article will already be intimately familiar with this project. If not, here's the quick hits.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/penelopezone/rubyfmt"&gt;Rubyfmt&lt;/a&gt; is inspired by &lt;a href="https://golang.org/cmd/gofmt/"&gt;gofmt&lt;/a&gt;. It formats existing Ruby code, and you can set this up as you like (today we will do it after save). It is mature enough to be able to run against all of rspec-core without breaking. You can read more details on the Github README.&lt;/p&gt;

&lt;p&gt;I first heard about this when Penelope discussed it with &lt;a href="https://twitter.com/sgrif?lang=en"&gt;@sgrif&lt;/a&gt; on the &lt;a href="http://yakshave.fm/"&gt;Yak Shave&lt;/a&gt; podcast. The subject came up in multiple episodes, and if I'm honest the technical details of creating this awesome tool likely went over my head. I still recommend taking a listen!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8G2yyr8I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/DdzSG3u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8G2yyr8I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/DdzSG3u.png" alt="Favorite"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Okay, let's get this running on Atom
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. &lt;a href="https://github.com/penelopezone/rubyfmt"&gt;Follow initial README instructions&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;At time of writing these are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;git init&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git clone https://github.com/penelopezone/rubyfmt.git&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;make&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;make install&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Set up Atom 'after-save' listener.
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://atom.io/packages/save-commands"&gt;Install Atom package save-commands&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;add the following to your save-commands.json in your directory:&lt;/li&gt;
&lt;li&gt;&lt;code&gt;"**/*.rb": "ruby --disable=gems path/to/bin/rubyfmt.rb -i {absPath}{filename}"&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Full example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# save-commands.json
{
    "commands": [
        "**/*.rb : ruby --disable=gems /path/to/bin/rubyfmt.rb -i {absPath}{filename}"
  ]
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;And voila! You should be in business. As a test you can add something unRuby-ish to a Ruby file (or just excess whitespace), save, and it should autoformat!&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Gotchas:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Atom didn't like the recommended command on RubyFmt of &lt;code&gt;ruby --disable=gems ~/bin/rubyfmt.rb -i ${file}&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;To get around this I manually passed in the actual path, obtained with &lt;code&gt;realpath rubyfmt.rb&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Happy to improve this if a reader has a more elegant solution&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Moving forward:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;I will try to keep this post updated, but following &lt;a href="https://twitter.com/penelope_zone"&gt;@penelope_zone&lt;/a&gt; on Twitter and checking out the &lt;a href="https://github.com/penelopezone/rubyfmt"&gt;README&lt;/a&gt; are the current best sources of truth&lt;/li&gt;
&lt;li&gt;It would be nice to wrap this up automatically in an atom package in future, so these steps aren't necessary. I've started looking into this but it may be more straightforward with someone more familiar with writing Atom package plugin code&lt;/li&gt;
&lt;li&gt;If you have any "this doesn't format correctly" feedback, hold fire for the moment as there's &lt;a href="https://twitter.com/penelope_zone/status/1199674689578295301?s=20"&gt;a lot of work happening on this right now&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Thanks, Penelope! ❤️
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://schwad.github.io/"&gt;Never miss one of my posts by signing up for my newsletter here&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>rails</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
