<?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: Scott Watermasysk</title>
    <description>The latest articles on Forem by Scott Watermasysk (@scottw).</description>
    <link>https://forem.com/scottw</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%2F132462%2F2b35adcc-09ef-447b-b2b0-c3c92f1c04e1.jpg</url>
      <title>Forem: Scott Watermasysk</title>
      <link>https://forem.com/scottw</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/scottw"/>
    <language>en</language>
    <item>
      <title>11 Things I Learned Migrating HowIVSCode to Rails 7.1</title>
      <dc:creator>Scott Watermasysk</dc:creator>
      <pubDate>Wed, 21 Feb 2024 16:42:43 +0000</pubDate>
      <link>https://forem.com/scottw/11-things-i-learned-migrating-howivscode-to-rails-71-2gj2</link>
      <guid>https://forem.com/scottw/11-things-i-learned-migrating-howivscode-to-rails-71-2gj2</guid>
      <description>&lt;p&gt;For reasons I will share in another post, I was forced to move two personal projects off of Heroku and onto HatchBox. The first, ThocStock, went very smoothly. I deployed the code, set a couple of ENVs, verified everything worked as expected, and finally updated the DNS.&lt;/p&gt;

&lt;p&gt;The second app, HowIVSCode, proved to be a bit more of a challenge. The first commits were about 4.5 years ago. Like many side projects with no revenue, apart from some gem security updates, it has not seen many changes over the last four years.&lt;/p&gt;

&lt;p&gt;The app was primarily built on Rails 5, TailwindCSS, webpacker, Administrate, and Delayed Job. Deploying to HatchBox yielded errors related to Python via Webpacker and led me down the trail of ripping out Webpacker, CSS building, and JS bundling. After a while, it felt like I was running in circles, putting out new small fires. All solvable problems, but then it hit me. This app has a total of 3 models and a couple of controllers. There is little value in maintaining the source history (and I still have it if needed).&lt;/p&gt;

&lt;p&gt;I wanted to try out LiteStack, so I told myself I could do this in an hour or two if I started from scratch and copied over the models, controllers, and views.&lt;/p&gt;

&lt;p&gt;In typical developer fashion, 2 hours was not a realistic estimate (probably closer to 6 to 8), but I learned quite a bit along the way.&lt;/p&gt;

&lt;p&gt;So here is what I learned upgrading a mostly kludgy Rails 5/webpacker app to a fresh Rails 7.1 app using LiteStack + ImportMaps + Avo.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; &lt;em&gt;I call this a migration instead of an upgrade because I am starting mostly fresh and pulling in the relevant pre-existing parts.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Running Rails New with the --skip-bundle flag Has Potentially Unintended Consequences
&lt;/h2&gt;

&lt;p&gt;I had initially &lt;a href="https://twitter.com/scottw/status/1756387596220129283"&gt;mentioned on X&lt;/a&gt; that using import maps required I execute the following on my own.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bin/rails importmap:install tailwindcss:install stimulus:install:importmap turbo::install:importmap
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is something I would have expected Rails to just do based on the flags I had set when running new (and primarily based upon what was in my .railsrc)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;--css=tailwind
--javascript=importmap
--database=sqlite3
--asset-pipeline=propshaft
--template=~/rails_template.rb
--skip-jbuilder
--skip-bundle
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;While writing this, I conducted several tests and discovered a few issues that may be bugs or inadequacies in the documentation. When using the --skip-bundle flag, the proper installation of Importmap, Tailwind, Stimulus, and Turbo is not facilitated. This might seem logical since installing them without bundling is challenging. However, I would have expected running the bundle manually later (or perhaps bin/setup) would resolve this issue.&lt;/p&gt;

&lt;p&gt;It also appears that with the &lt;code&gt;--skip-bundle&lt;/code&gt; flag, the Tailwind-Rails gem is not included when specified with the --css=tailwind flag.&lt;/p&gt;

&lt;p&gt;Again, there is some chicken and egg here. It is on my list to dig into the source more to figure this out. But you will likely be up and running quicker if you do not use the skip-bundle flag.&lt;/p&gt;

&lt;h2&gt;
  
  
  ImportMap Limitations
&lt;/h2&gt;

&lt;p&gt;The short answer here is that everything you typically bundle with JavaScript is always an option (today) with importmaps. This is something to consider beforehand, especially if you have a list of JavaScript libraries you need to use. In the case of HowIVSCode, I could not experiment with DaisyUI. However, the long-term benefit of an app that will not get many updates is too good to ignore.&lt;/p&gt;

&lt;h2&gt;
  
  
  OmniAuth Login 'Links' (Likely) Require an HTTP Post
&lt;/h2&gt;

&lt;p&gt;The only way to log in or create an account with HowIVSCode is via GitHub + OAuth. OmniAuth now recommends adding the gem &lt;code&gt;omniauth-rails_csrf_protection&lt;/code&gt;. I didn't think much about it and just added it.&lt;/p&gt;

&lt;p&gt;However, once in place, you can no longer use a href as part of your sign-up flow. The reasoning for this makes sense, but in quickly trying to move to the most recent gem updates, I spun my tires here for far longer than I care to admit.&lt;/p&gt;

&lt;h2&gt;
  
  
  No Arrays in SQLite
&lt;/h2&gt;

&lt;p&gt;When relational data is small and often just a word or two, I use an array in PostgreSQL.&lt;/p&gt;

&lt;p&gt;For example, a migration for a small blog post table might look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;create_table&lt;/span&gt; &lt;span class="ss"&gt;:posts&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
    &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt; &lt;span class="ss"&gt;:title&lt;/span&gt;
    &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt; &lt;span class="ss"&gt;:body&lt;/span&gt;
    &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt; &lt;span class="ss"&gt;:tags&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;array: &lt;/span&gt;&lt;span class="kp"&gt;true&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I no longer need a separate &lt;code&gt;tags&lt;/code&gt; table or a &lt;code&gt;tags_in_posts&lt;/code&gt; related table. PostgreSQL provides the necessary functions to query this as needed.&lt;/p&gt;

&lt;p&gt;Unfortunately, there are no Arrays in SQLite. However, all is not lost. SQLite does support JSON, so for now, I added a json column called data and the necessary arrays. This is just data I am recording, so we will have to see in the future if this holds up when querying by specific tags becomes necessary.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a class="mentioned-user" href="https://dev.to/apply"&gt;@apply&lt;/a&gt; warnings
&lt;/h2&gt;

&lt;p&gt;For better or worse, I occasionally use &lt;a class="mentioned-user" href="https://dev.to/apply"&gt;@apply&lt;/a&gt; with my Tailwind CSS. VSCode kept complaining about (although it still worked) an &lt;code&gt;Unknown Rule&lt;/code&gt;. The fix is to set the *.css file association to &lt;code&gt;tailwindcss&lt;/code&gt;. Full details &lt;a href="https://cssf1.com/how-to/fix-unknown-at-rule-tailwind-warning-vscode"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Default Layout for SitePress
&lt;/h2&gt;

&lt;p&gt;My markdown content views previously used the markdown-views gem. This time around, I decided to go with SitePress. Overall, SitePress has been great to work with. However, one thing I struggled with was how to use a different layout for my content pages.&lt;/p&gt;

&lt;p&gt;With my SitePress pages, everything that is not the markdown body is set in a different Layout file. This way, I did not have to try and overly mix Markdown and ERB in my content (and as far as I can tell, you cannot even access SitePress's page variables&lt;/p&gt;

&lt;p&gt;I tried various ways to make this work, but I settled on creating a new controller derived from Sitepress::SiteController. Then, in my routes file, I specified that this controller would be used &lt;code&gt;sitepress_pages(controller: "content")&lt;/code&gt; for my pages.&lt;/p&gt;

&lt;h2&gt;
  
  
  Meta Tags with SitePress
&lt;/h2&gt;

&lt;p&gt;Similar to the above concern, I wanted to be still able to set various meta tags via the meta-tags gem.&lt;/p&gt;

&lt;p&gt;Again, trying to avoid any ERB in my Markdown as much as possible, I added a meta section to my frontmatter and wired it up like this in the SitePress layout.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight erb"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;%&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;meta_data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;current_page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"meta"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="cp"&gt;%&amp;gt;&lt;/span&gt;
  &lt;span class="cp"&gt;&amp;lt;%&lt;/span&gt; &lt;span class="n"&gt;set_meta_tags&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;meta_data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_h&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="cp"&gt;%&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;&amp;lt;%&lt;/span&gt; &lt;span class="k"&gt;end&lt;/span&gt; &lt;span class="cp"&gt;%&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Markdown Escaping in SitePress
&lt;/h2&gt;

&lt;p&gt;I have a Stimulus controller that adds your API key to the clipboard when you click on it. Previously, I rendered a partial which wired up the controller &lt;code&gt;&amp;lt;%= render partial: "auth_token" %&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The partial approach still worked (I know, ERB in MD), but the &lt;code&gt;#&lt;/code&gt; in  &lt;code&gt;data-action="click-&amp;gt;copy-auth-key#copy&lt;/code&gt; is causing RedCarpret (SitePress's markdown processer) to start escaping everything after. The markdown-views gem uses Commonmarker for processing markdown and doesn't appear to have this issue (I have tests to compare if someone is interested).&lt;/p&gt;

&lt;p&gt;If I were using more stimulus in the project, I would probably need to dig deeper and/or swap Markdown libraries. My usage was simple enough; I just dropped the data-action attribute and wired up an event listener in my controller.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Controller&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@hotwired/stimulus&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;Controller&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;copy&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;clipboard&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;writeText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerText&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;trim&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nf"&gt;initialize&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;click&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;copy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;bind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sometimes, being lazy is the correct answer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Importing Data from PG to Sqlite
&lt;/h2&gt;

&lt;p&gt;Sadly, there does not appear to be an easy off-the-self option to go in this direction. Most articles recommended doing a pg_dump to SQL and then massaging the file to work with Sqlite. Depending on the data complexity, this might be your best option. I was going from the old to the new app with roughly the same ActiveRecord models (minus the arrays).&lt;/p&gt;

&lt;p&gt;I found generating a couple of JSON files from the original app and then looping over each of them with my new models to be the simplest repeatable option.&lt;/p&gt;

&lt;h2&gt;
  
  
  Configuring Where LiteStack Puts The SQLite Databases in Production
&lt;/h2&gt;

&lt;p&gt;Hatchbox provides each app with a persistent storage location. Using the database.yml, it is simple to set this as the folder for your data.sqlite3 file. However, I wanted to be sure that the other Sqlite databases, such as queue.sqlite3, are also correctly persisted. For the litequeue.yml, there is a db path option, but this is relative to the main app configuration.&lt;/p&gt;

&lt;p&gt;Looking at the LiteStack docs, there was no obvious answer. However, digging through the source, there is an ENV variable you can set: &lt;code&gt;LITESTACK_DATA_PATH&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The benefit of the ENV is it also handles the data.sqlite3 file as well, so I could remove the hardcoded production path from my database.yml.&lt;/p&gt;

&lt;p&gt;Side note: It still sticks the files in a production sub-directory. It is not the end of the world, but I hope it becomes optional.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bundle Only Supports "arm64-darwin"
&lt;/h2&gt;

&lt;p&gt;I believe this is related to the non-bundle issue I had previously. Essentially, my bundle was only valid as is for M1 Macs.&lt;/p&gt;

&lt;p&gt;The fix was as easy as &lt;code&gt;bundle lock --add-platform x86_64_linux&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you watch the output from a &lt;code&gt;rails new&lt;/code&gt; without the &lt;code&gt;--skip-bundle&lt;/code&gt; flag, you can see the &lt;code&gt;--add-platform&lt;/code&gt; flag is set.&lt;/p&gt;

</description>
      <category>rails</category>
      <category>litestack</category>
      <category>sqlite</category>
      <category>sitepress</category>
    </item>
    <item>
      <title>HowIVSCode Contest - Win a Free Dev.to Gift Card and more</title>
      <dc:creator>Scott Watermasysk</dc:creator>
      <pubDate>Tue, 12 Nov 2019 17:00:56 +0000</pubDate>
      <link>https://forem.com/scottw/howivscode-contest-win-a-free-dev-to-gift-card-and-more-1mi9</link>
      <guid>https://forem.com/scottw/howivscode-contest-win-a-free-dev-to-gift-card-and-more-1mi9</guid>
      <description>&lt;p&gt;Over on &lt;a href="https://howivscode.com"&gt;HowIVSCode&lt;/a&gt; I am running a content over the next 2 weeks. All you have to do to enter is sign up and sync your VSCode data.&lt;/p&gt;

&lt;p&gt;I am hoping after the content is over to be able to share some aggregate data around what themes and fonts are used most often.&lt;/p&gt;

&lt;p&gt;Full contest details here: &lt;a href="https://howivscode.com/contest"&gt;HowIVSCode Contest Details&lt;/a&gt;&lt;/p&gt;

</description>
      <category>vscode</category>
      <category>contest</category>
    </item>
    <item>
      <title>zsh-syntax-highlighting</title>
      <dc:creator>Scott Watermasysk</dc:creator>
      <pubDate>Thu, 10 Oct 2019 20:18:55 +0000</pubDate>
      <link>https://forem.com/scottw/zsh-syntax-highlighting-3m99</link>
      <guid>https://forem.com/scottw/zsh-syntax-highlighting-3m99</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/zsh-users/zsh-syntax-highlighting"&gt;zsh-syntax-highlighting&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Heard about this on Syntax.fm today: Fish shell-like syntax highlighting for Zsh. It is a great way to see errors before you hit enter.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This package provides syntax highlighting for the shell zsh. It enables highlighting of commands whilst they are typed at a zsh prompt into an interactive terminal. This helps in reviewing commands before running them, particularly in catching syntax errors.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>zsh</category>
    </item>
    <item>
      <title>Dank Mono</title>
      <dc:creator>Scott Watermasysk</dc:creator>
      <pubDate>Mon, 07 Oct 2019 13:03:09 +0000</pubDate>
      <link>https://forem.com/scottw/dank-mono-a2c</link>
      <guid>https://forem.com/scottw/dank-mono-a2c</guid>
      <description>&lt;p&gt;&lt;a href="https://dank.sh"&gt;Dank Mono&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I switched&lt;sup id="fnref1"&gt;1&lt;/sup&gt; my main programming font last week from Fira Code 2 to &lt;a href="https://dank.sh"&gt;Dank Mono&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;After a couple of days, I have to say I am enjoying it.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The italic crossed with script (cursive) is a nice visual change.&lt;/li&gt;
&lt;li&gt;Supports ligatures which is now a must have for me.&lt;/li&gt;
&lt;li&gt;There are two types of developers. Those who love change and those who hate change. Neither are right or wrong, but I am in the love change camp. The small visual update makes everything feel more fresh.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The recommended font-size with it is 14. I had been running Fira Code (which I still love) at 24px. For Dank I switched to 20px and bumped the font-weight up to 500 in Visual Studio Code.&lt;/p&gt;




&lt;ol&gt;

&lt;li id="fn1"&gt;
&lt;p&gt;&lt;a href="https://howivscode.com/scottwater"&gt;Check out&lt;/a&gt; if you want to see if I stick with Dank Mono ↩&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;

</description>
      <category>vscode</category>
      <category>fonts</category>
      <category>dankmono</category>
    </item>
    <item>
      <title>How I Use VSCode</title>
      <dc:creator>Scott Watermasysk</dc:creator>
      <pubDate>Mon, 30 Sep 2019 23:44:02 +0000</pubDate>
      <link>https://forem.com/scottw/how-i-use-vscode-5pb</link>
      <guid>https://forem.com/scottw/how-i-use-vscode-5pb</guid>
      <description>&lt;p&gt;I recently updated and shared my &lt;a href="https://howivscode.com/scottwater"&gt;Visual Studio Code settings&lt;/a&gt; on &lt;a href="https://howivscode.com"&gt;How I VSCode&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Check them out and share yours as well!&lt;/p&gt;

</description>
      <category>vscode</category>
    </item>
    <item>
      <title>Select Multiple Fields With Fauna</title>
      <dc:creator>Scott Watermasysk</dc:creator>
      <pubDate>Thu, 26 Sep 2019 12:52:17 +0000</pubDate>
      <link>https://forem.com/scottw/select-multiple-fields-with-fauna-4enc</link>
      <guid>https://forem.com/scottw/select-multiple-fields-with-fauna-4enc</guid>
      <description>&lt;p&gt;I am thinking of using &lt;a href="https://fauna.com"&gt;Fauna&lt;/a&gt; for my next small side project and began experimenting with it last night. I wanted to return two fields from a document, but I could not get the syntax correct.&lt;/p&gt;

&lt;p&gt;I was working under the assumption that &lt;a href="https://docs.fauna.com/fauna/current/api/fql/functions/selectall"&gt;&lt;code&gt;SelectAll&lt;/code&gt;&lt;/a&gt; would allow me to extract multiple fields, but it turns out this is for returning multiple items from an array.&lt;/p&gt;

&lt;p&gt;I posted a message in their slack group&lt;sup id="fnref1"&gt;1&lt;/sup&gt; and learned that you could pass an array to the Lambda with more than one &lt;a href="https://docs.fauna.com/fauna/current/api/fql/functions/select"&gt;&lt;code&gt;Select&lt;/code&gt;&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Map(
  Paginate(Match(Index("all_customers"))),
  Lambda("X", [
    Select(["data", "firstName"], Get(Var("X"))),
    Select(["data", "lastName"], Get(Var("X")))
    ]
  )
)

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

&lt;/div&gt;






&lt;ol&gt;

&lt;li id="fn1"&gt;
&lt;p&gt;Slack is such a bad option for support like this. All the answers are locked in their walled garden. ↩&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;

</description>
      <category>fauna</category>
    </item>
    <item>
      <title>Markdown Views ❤️</title>
      <dc:creator>Scott Watermasysk</dc:creator>
      <pubDate>Mon, 23 Sep 2019 15:12:39 +0000</pubDate>
      <link>https://forem.com/scottw/markdown-views-35po</link>
      <guid>https://forem.com/scottw/markdown-views-35po</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/zarqman/markdown_views"&gt;Markdown Views ❤️&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is kind of like MDX in Gatsby/React. Really useful for managing content in your rails apps.&lt;/p&gt;

</description>
      <category>rails</category>
      <category>markdown</category>
      <category>ruby</category>
    </item>
    <item>
      <title>Rails Meta Tags</title>
      <dc:creator>Scott Watermasysk</dc:creator>
      <pubDate>Mon, 23 Sep 2019 13:50:16 +0000</pubDate>
      <link>https://forem.com/scottw/rails-meta-tags-3h99</link>
      <guid>https://forem.com/scottw/rails-meta-tags-3h99</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/kpumuk/meta-tags"&gt;Rails Meta Tags&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is a really easy way to consistently implement and set meta tags in your rails apps (title, meta, noindex, open graph, etc).&lt;/p&gt;

</description>
      <category>rails</category>
      <category>seo</category>
    </item>
    <item>
      <title>Active Decorator</title>
      <dc:creator>Scott Watermasysk</dc:creator>
      <pubDate>Mon, 09 Sep 2019 13:50:04 +0000</pubDate>
      <link>https://forem.com/scottw/active-decorator-4ncl</link>
      <guid>https://forem.com/scottw/active-decorator-4ncl</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/amatsuda/active_decorator"&gt;Active Decorator&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have been using this on &lt;a href="https://howivscode.com"&gt;@howIVSCode&lt;/a&gt; over my normal goto, Draper.&lt;/p&gt;

&lt;p&gt;So far it has been great. No special setup and it just works when the delegator exists.&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>rails</category>
    </item>
    <item>
      <title>Rails Global Ids</title>
      <dc:creator>Scott Watermasysk</dc:creator>
      <pubDate>Tue, 03 Sep 2019 20:01:30 +0000</pubDate>
      <link>https://forem.com/scottw/rails-global-ids-46p7</link>
      <guid>https://forem.com/scottw/rails-global-ids-46p7</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/rails/globalid"&gt;Rails Global Ids&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A Global ID is an app-wide​ URI that uniquely identifies a model instance&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I was looking over some ActiveJob docs and came across Global Ids. Not exactly sure how/what I would use it for, but looks interesting.&lt;/p&gt;

</description>
      <category>rails</category>
    </item>
    <item>
      <title>VSCode Tailwind Extension And Rails (ERB)</title>
      <dc:creator>Scott Watermasysk</dc:creator>
      <pubDate>Tue, 27 Aug 2019 02:53:14 +0000</pubDate>
      <link>https://forem.com/scottw/vscode-tailwind-extension-and-rails-erb-4jja</link>
      <guid>https://forem.com/scottw/vscode-tailwind-extension-and-rails-erb-4jja</guid>
      <description>&lt;p&gt;If you are having trouble getting an extension like &lt;a href="https://github.com/bradlc/vscode-tailwindcss"&gt;VSCode Tailwind&lt;/a&gt; to work in VSCode, a smart place to start debugging is the language mode.&lt;/p&gt;

&lt;p&gt;For example, for me, a file named &lt;code&gt;application.html.erb&lt;/code&gt; had the language set to &lt;code&gt;html.erb&lt;/code&gt; instead of the expected &lt;code&gt;erb&lt;/code&gt;. This in turn, caused the VSCode Tailwind extension to be ignored since it was not registered for &lt;code&gt;html.erb&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Long term, there may be a way to have this extension look for any erb (*.erb - although that too may be problematic). In the short run, we can tell VSCode to map any &lt;code&gt;html.erb&lt;/code&gt; file back to &lt;code&gt;erb&lt;/code&gt; like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"files.associations": {
    "*.html.erb": "erb"
  }

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

&lt;/div&gt;



&lt;p&gt;This change fixed my immediate issue, but it ended up causing another bug. Previously, I had done a similar fix for Emmet by mapping &lt;code&gt;html.erb&lt;/code&gt; to &lt;code&gt;html&lt;/code&gt;. Now of course since the file type was being changed to &lt;code&gt;erb&lt;/code&gt; Emmet needed the following update:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; "emmet.includeLanguages": {
    "html.erb": "html",
    "erb": "html"
  }

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

&lt;/div&gt;



&lt;p&gt;The ease of configuration overrides is both a blessing and a curse. It is very easy to make one small change and have it run amuck. But it is much better than being boxed into something with no way making it work (even just temporarily).&lt;/p&gt;

</description>
      <category>tailwindcss</category>
      <category>rails</category>
      <category>erb</category>
      <category>vscode</category>
    </item>
    <item>
      <title>VSCode Settings Sync</title>
      <dc:creator>Scott Watermasysk</dc:creator>
      <pubDate>Tue, 18 Jun 2019 20:00:27 +0000</pubDate>
      <link>https://forem.com/scottw/vscode-settings-sync-4d27</link>
      <guid>https://forem.com/scottw/vscode-settings-sync-4d27</guid>
      <description>&lt;p&gt;&lt;a href="https://smw.fyi/6F"&gt;VSCode Settings Sync&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Not as easy as just backing up your dotfiles with Vim, but still nice to be able to reload everything with a click or two.&lt;/p&gt;

</description>
      <category>vscode</category>
    </item>
  </channel>
</rss>
