<?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>DEV Community: Lang Sharpe</title>
    <description>The latest articles on DEV Community by Lang Sharpe (@langsharpe).</description>
    <link>https://dev.to/langsharpe</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%2F152662%2Fe6ab1cba-433e-4122-ad66-94fed7632d70.png</url>
      <title>DEV Community: Lang Sharpe</title>
      <link>https://dev.to/langsharpe</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/langsharpe"/>
    <language>en</language>
    <item>
      <title>Introduction to Timezones in Rails</title>
      <dc:creator>Lang Sharpe</dc:creator>
      <pubDate>Wed, 17 Feb 2021 23:21:02 +0000</pubDate>
      <link>https://dev.to/langsharpe/introduction-to-timezones-in-rails-4gk</link>
      <guid>https://dev.to/langsharpe/introduction-to-timezones-in-rails-4gk</guid>
      <description>&lt;p&gt;One day I'll do the perfect presentation about timezones.&lt;/p&gt;

&lt;p&gt;For now, I did a talk at RoRoSyd in December 2020. This is called "Introduction to Timezones" and discusses what a time zone is, how Rails handles them and how to use them in a way that makes sense.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/FfUay3iBSOc"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>timezones</category>
      <category>ruby</category>
      <category>rails</category>
    </item>
    <item>
      <title>Creating indexes in PostgreSQL isn't always idempotent</title>
      <dc:creator>Lang Sharpe</dc:creator>
      <pubDate>Mon, 14 Oct 2019 08:29:30 +0000</pubDate>
      <link>https://dev.to/langsharpe/creating-indexes-in-postgresql-isn-t-always-idempotent-2d9d</link>
      <guid>https://dev.to/langsharpe/creating-indexes-in-postgresql-isn-t-always-idempotent-2d9d</guid>
      <description>&lt;p&gt;Usually, when you call &lt;code&gt;CREATE INDEX&lt;/code&gt; in Postgres, you expect the index to be created, or an error to be raised. However, if you are doing each of these:-&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Creating a UNIQUE index&lt;/li&gt;
&lt;li&gt;The data is not unique&lt;/li&gt;
&lt;li&gt;Creating the index CONCURRENTLY&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;An index will be created, but be INVALID. From the documentation:-&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If a problem arises while scanning the table, such as a deadlock or a uniqueness violation in a unique index, the CREATE INDEX command will fail but leave behind an “invalid” index.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://www.postgresql.org/docs/current/static/sql-createindex.html#SQL-CREATEINDEX-CONCURRENTLY"&gt;Source&lt;/a&gt;&lt;/p&gt;

</description>
      <category>todayilearned</category>
      <category>postgres</category>
    </item>
    <item>
      <title>Rails Seed tasks</title>
      <dc:creator>Lang Sharpe</dc:creator>
      <pubDate>Wed, 09 Oct 2019 08:02:36 +0000</pubDate>
      <link>https://dev.to/langsharpe/rails-seed-tasks-2ech</link>
      <guid>https://dev.to/langsharpe/rails-seed-tasks-2ech</guid>
      <description>&lt;p&gt;A few tasks will load your seed data&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rails db:setup
rails db:reset
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This surprised me. I had thought they were only loaded when &lt;code&gt;db:seed&lt;/code&gt; is run specifically.&lt;/p&gt;

</description>
      <category>todayilearned</category>
    </item>
    <item>
      <title>Using netcat as a test statsd server</title>
      <dc:creator>Lang Sharpe</dc:creator>
      <pubDate>Thu, 03 Oct 2019 08:02:20 +0000</pubDate>
      <link>https://dev.to/langsharpe/using-netcat-as-a-test-statsd-server-4en9</link>
      <guid>https://dev.to/langsharpe/using-netcat-as-a-test-statsd-server-4en9</guid>
      <description>&lt;p&gt;Netcat will listen on a port and write what it receives to stdout.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nc &lt;span class="nt"&gt;-u&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; 8125
&lt;span class="c"&gt;# -u UDP&lt;/span&gt;
&lt;span class="c"&gt;# -l Listen&lt;/span&gt;
&lt;span class="c"&gt;# -p Port&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It only works for a single line/connection. (Other versions have an option to keep listening. However, I wasn’t able to find one that ran on MacOS).&lt;/p&gt;

</description>
      <category>todayilearned</category>
      <category>netcat</category>
    </item>
  </channel>
</rss>
