<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Log on Dave Lage</title>
    <link>https://davelage.com/posts/</link>
    <description>Recent content in Log on Dave Lage</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Tue, 24 Mar 2026 18:17:01 -0400</lastBuildDate>
    <atom:link href="https://davelage.com/posts/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Neovim LspAttach Autocommand</title>
      <link>https://davelage.com/posts/neovim-lsp-attach-autocommand/</link>
      <pubDate>Fri, 28 Mar 2025 23:34:42 -0400</pubDate>
      <guid>https://davelage.com/posts/neovim-lsp-attach-autocommand/</guid>
      <description>&lt;h1 id=&#34;neovim-lspattach-autocommand&#34;&gt;Neovim LspAttach autocommand&lt;/h1&gt;&#xA;&lt;p&gt;An example LspAttach autocommand I use for Neovim. Adds some keybinds but&#xA;configure as desired.&lt;/p&gt;&#xA;&lt;p&gt;We run on &lt;code&gt;LspAttach&lt;/code&gt; commands.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lua&#34; data-lang=&#34;lua&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;local&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;group&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;vim.api&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;nvim_create_augroup&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;LspMappings&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;clear&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;true&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;})&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;vim.api&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;nvim_create_autocmd&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;LspAttach&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&lt;span class=&#34;n&#34;&gt;group&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;group&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&lt;span class=&#34;n&#34;&gt;callback&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kr&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;args&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&lt;span class=&#34;kd&#34;&gt;local&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;opts&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;buffer&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;args.buf&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;silent&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;true&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&lt;span class=&#34;n&#34;&gt;set&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;n&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;gd&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kr&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;vim.lsp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;buf.definition&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;({})&lt;/span&gt; &lt;span class=&#34;kr&#34;&gt;end&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;opts&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&lt;span class=&#34;n&#34;&gt;set&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;n&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;K&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;vim.lsp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;buf.hover&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;opts&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&lt;span class=&#34;n&#34;&gt;set&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;n&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&amp;lt;c-s-K&amp;gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;vim.lsp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;buf.signature_help&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;opts&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&lt;span class=&#34;n&#34;&gt;set&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;n&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;gD&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kr&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;vim.lsp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;buf.implementation&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;({})&lt;/span&gt; &lt;span class=&#34;kr&#34;&gt;end&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;opts&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&lt;span class=&#34;n&#34;&gt;set&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;n&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;1gD&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kr&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;vim.lsp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;buf.type_definition&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;({})&lt;/span&gt; &lt;span class=&#34;kr&#34;&gt;end&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;opts&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&lt;span class=&#34;n&#34;&gt;set&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;n&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;gr&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kr&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;vim.lsp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;buf.references&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;kr&#34;&gt;end&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;opts&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&lt;span class=&#34;n&#34;&gt;set&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;n&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&amp;lt;c-]&amp;gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kr&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;vim.lsp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;buf.declaration&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;({})&lt;/span&gt; &lt;span class=&#34;kr&#34;&gt;end&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;opts&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&lt;span class=&#34;n&#34;&gt;set&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;n&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&amp;lt;Leader&amp;gt;re&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;vim.lsp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;buf.rename&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;opts&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&lt;span class=&#34;n&#34;&gt;set&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;n&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&amp;lt;Leader&amp;gt;ca&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;vim.lsp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;buf.code_action&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;opts&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&lt;span class=&#34;n&#34;&gt;set&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;n&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&amp;lt;Leader&amp;gt;ih&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kr&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;c1&#34;&gt;-- toggles inlay hints&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&#x9;&lt;span class=&#34;n&#34;&gt;vim.lsp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;inlay_hint.enable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;ow&#34;&gt;not&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;vim.lsp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;inlay_hint.is_enabled&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&lt;span class=&#34;kr&#34;&gt;end&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;opts&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&lt;span class=&#34;c1&#34;&gt;-- diagnostics&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&lt;span class=&#34;n&#34;&gt;set&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;n&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&amp;lt;Leader&amp;gt;di&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;vim.diagnostic&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;open_float&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;opts&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&lt;span class=&#34;n&#34;&gt;set&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;n&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&amp;lt;Leader&amp;gt;k&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kr&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&#x9;&lt;span class=&#34;n&#34;&gt;vim.diagnostic&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;jump&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;({&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;float&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;count&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;})&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&lt;span class=&#34;kr&#34;&gt;end&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;opts&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&lt;span class=&#34;n&#34;&gt;set&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;n&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&amp;lt;Leader&amp;gt;j&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kr&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&#x9;&lt;span class=&#34;n&#34;&gt;vim.diagnostic&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;jump&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;({&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;float&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;count&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;})&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&lt;span class=&#34;kr&#34;&gt;end&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;opts&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&lt;span class=&#34;kr&#34;&gt;end&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;})&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <title>Neovim LSP 0.11</title>
      <link>https://davelage.com/posts/neovim-lsp-0.11/</link>
      <pubDate>Fri, 28 Mar 2025 00:00:00 +0000</pubDate>
      <guid>https://davelage.com/posts/neovim-lsp-0.11/</guid>
      <description>&lt;h1 id=&#34;neovim-lsp-011&#34;&gt;Neovim LSP 0.11&lt;/h1&gt;&#xA;&lt;p&gt;In Neovim LSP 0.11 they added more support for LSP. This enables you to have&#xA;native support for your LSP&amp;rsquo;s without requiring any plugins.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lua&#34; data-lang=&#34;lua&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;vim.lsp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;config&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;lua_ls&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;cmd&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;lua-language-server&amp;#39;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;filetypes&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;lua&amp;#39;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;root_markers&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;s1&#34;&gt;&amp;#39;.luarc.json&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;s1&#34;&gt;&amp;#39;.luarc.jsonc&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;s1&#34;&gt;&amp;#39;.luacheckrc&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;s1&#34;&gt;&amp;#39;.stylua.toml&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;s1&#34;&gt;&amp;#39;stylua.toml&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;s1&#34;&gt;&amp;#39;selene.toml&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;s1&#34;&gt;&amp;#39;selene.yml&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;s1&#34;&gt;&amp;#39;.git&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;And then you start enable it to autostart when it runs the filetype and finds&#xA;the &lt;code&gt;root_marker&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-lua&#34; data-lang=&#34;lua&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;vim.lsp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;enable&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;lua_ls&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now lua language server will be available when it matches the configuration&lt;/p&gt;</description>
    </item>
    <item>
      <title>Streaming chat scroll to bottom with React</title>
      <link>https://davelage.com/posts/chat-scroll-react/</link>
      <pubDate>Wed, 13 Nov 2024 00:00:00 +0000</pubDate>
      <guid>https://davelage.com/posts/chat-scroll-react/</guid>
      <description>&lt;h1 id=&#34;streaming-chat-scroll-to-bottom-with-react&#34;&gt;Streaming chat scroll to bottom with React&lt;/h1&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s say you&amp;rsquo;re making a chat application. You are? Great. And we&amp;rsquo;re streaming&#xA;text from tokens as they are generated from the server.&lt;/p&gt;&#xA;&lt;p&gt;But the text scrolls off the page!&lt;/p&gt;&#xA;&lt;h2 id=&#34;lets-scroll-into-view&#34;&gt;Let&amp;rsquo;s scroll into view&lt;/h2&gt;&#xA;&lt;p&gt;We can fix this by using &lt;code&gt;scrollIntoView&lt;/code&gt; on the element we want to view.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;element&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;querySelector&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;#my-element&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;element&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;scrollIntoView&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;By default this scrolls to the top, left are at 0, 0 for the element relative to&#xA;the viewport.&lt;/p&gt;</description>
    </item>
    <item>
      <title>WebFinger response as application/json using Cloudflare Sites</title>
      <link>https://davelage.com/posts/webfinger-application-json-cloudflare-sites/</link>
      <pubDate>Mon, 16 Sep 2024 16:00:58 -0400</pubDate>
      <guid>https://davelage.com/posts/webfinger-application-json-cloudflare-sites/</guid>
      <description>&lt;h1 id=&#34;webfinger-response-as-applicationjson-using-cloudflare-sites&#34;&gt;WebFinger response as application/json using Cloudflare Sites&lt;/h1&gt;&#xA;&lt;h2 id=&#34;transform-rules&#34;&gt;Transform rules&lt;/h2&gt;&#xA;&lt;p&gt;Go to the rules part of your site on Cloudflare. We&amp;rsquo;ll want to add a response&#xA;header to modify the &lt;code&gt;Content-Type&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Rules -&amp;gt; Transform Rules -&amp;gt; Modify Response Header&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;  &lt;picture&gt;&#xA;    &#xA;&#xA;    &#xA;    &lt;img&#xA;      src=&#34;https://davelage.com/img/post/cloudflare-webfinger/cloudflare-rule-1.png&#34;&#xA;      alt=&#34;Cloudflare rule 1&#34;&#xA;      loading=&#34;lazy&#34;&#xA;      decoding=&#34;async&#34;&#xA;    /&gt;&#xA;  &lt;/picture&gt;&#xA;  &lt;figcaption&gt;Cloudflare rule 1&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;And then we update the &lt;code&gt;Content-Type&lt;/code&gt; to &lt;code&gt;application/json&lt;/code&gt;&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;  &lt;picture&gt;&#xA;    &#xA;&#xA;    &#xA;    &lt;img&#xA;      src=&#34;https://davelage.com/img/post/cloudflare-webfinger/cloudflare-rule-2.png&#34;&#xA;      alt=&#34;Cloudflare rule 2&#34;&#xA;      loading=&#34;lazy&#34;&#xA;      decoding=&#34;async&#34;&#xA;    /&gt;&#xA;  &lt;/picture&gt;&#xA;  &lt;figcaption&gt;Cloudflare rule 2&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;Then you should be able to get the JSON to load in your browser as opposed to it&#xA;downloading it.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Add WebFinger to Your Site</title>
      <link>https://davelage.com/posts/add-webfinger-to-your-site/</link>
      <pubDate>Mon, 16 Sep 2024 15:39:19 -0400</pubDate>
      <guid>https://davelage.com/posts/add-webfinger-to-your-site/</guid>
      <description>&lt;h1 id=&#34;add-webfinger-to-your-site&#34;&gt;Add WebFinger to your site&lt;/h1&gt;&#xA;&lt;!--toc:start--&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#add-webfinger-to-your-site&#34;&gt;Add WebFinger to your site&lt;/a&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#how-discovery-works&#34;&gt;How discovery works&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#common-link-types&#34;&gt;Common link types&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#example&#34;&gt;Example&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#conclusion&#34;&gt;Conclusion&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#related-links&#34;&gt;Related links&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;!--toc:end--&gt;&#xA;&lt;p&gt;WebFinger lets other services discover information about your site or identity&#xA;across the internet. It&amp;rsquo;s a key component of federated networks like Mastodon&#xA;and essential for cross-site interactions.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;WebFinger is used to discover information about people or other entities on&#xA;the Internet that are identified by a URI using standard Hypertext Transfer&#xA;Protocol (HTTP) methods over a secure transport.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Change GTK font</title>
      <link>https://davelage.com/posts/change_gtk_font/</link>
      <pubDate>Fri, 19 Jul 2024 19:21:58 -0400</pubDate>
      <guid>https://davelage.com/posts/change_gtk_font/</guid>
      <description>&lt;h1 id=&#34;change-gtk-font&#34;&gt;Change GTK font&lt;/h1&gt;&#xA;&lt;figure&gt;&#xA;  &lt;picture&gt;&#xA;    &#xA;&#xA;    &#xA;    &lt;img&#xA;      src=&#34;https://davelage.com/img/logo-gtk.png&#34;&#xA;      alt=&#34;GTK Logo&#34;&#xA;      loading=&#34;lazy&#34;&#xA;      decoding=&#34;async&#34;&#xA;    /&gt;&#xA;  &lt;/picture&gt;&#xA;  &lt;figcaption&gt;GTK Logo&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;GTK has a setting for the font name. This can be a huge component across all GTK&#xA;applications. Try alternative fonts in your GTK applications.&lt;/p&gt;&#xA;&lt;p&gt;Suggested on modern GTK is through the &lt;code&gt;gsettings&lt;/code&gt; command. GTK 3.0+ which&#xA;should cover most applications. Otherwise, through the &lt;code&gt;settings.ini&lt;/code&gt; in the&#xA;appropriate GTK 2.0 configuration directory.&lt;/p&gt;&#xA;&lt;p&gt;Set the font-name. And the base font size.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;gsettings &lt;span class=&#34;nb&#34;&gt;set&lt;/span&gt; org.gnome.desktop.interface font-name &lt;span class=&#34;s2&#34;&gt;&amp;#34;Monospace, 13&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will change the font immediately in the GTK applications. Check to see if&#xA;it&amp;rsquo;s working in your GTK applications like Firefox.&lt;/p&gt;</description>
    </item>
    <item>
      <title>DWM to DWL</title>
      <link>https://davelage.com/posts/dwm-to-dwl/</link>
      <pubDate>Wed, 17 Jul 2024 12:37:44 -0400</pubDate>
      <guid>https://davelage.com/posts/dwm-to-dwl/</guid>
      <description>&lt;h1 id=&#34;dwm-to-dwl&#34;&gt;DWM to DWL&lt;/h1&gt;&#xA;&lt;!--toc:start--&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#dwm-to-dwl&#34;&gt;DWM to DWL&lt;/a&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#issues-i-ran-into&#34;&gt;Issues I ran into&lt;/a&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#terminal&#34;&gt;Terminal&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#browser&#34;&gt;Browser&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#refresh-rate&#34;&gt;Refresh rate&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#no-top-bar&#34;&gt;No top bar&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;!--toc:end--&gt;&#xA;&lt;p&gt;DWM is a simple window manager for Linux. Moving to Wayland you can not use DWM&#xA;because DWM is X based. DWL is a similar application in the same spirit. A&#xA;simple window manager.&lt;/p&gt;&#xA;&lt;h2 id=&#34;issues-i-ran-into&#34;&gt;Issues I ran into&lt;/h2&gt;&#xA;&lt;h3 id=&#34;terminal&#34;&gt;Terminal&lt;/h3&gt;&#xA;&lt;p&gt;Make sure your terminal is using Wayland. &lt;code&gt;foot&lt;/code&gt; or &lt;code&gt;alacritty&lt;/code&gt; are one if you&#xA;are having issues.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Fetch images into Uint8Array/UInt8Buffer for WASM web applications</title>
      <link>https://davelage.com/posts/fetch-images-into-uint8-buffer/</link>
      <pubDate>Mon, 01 Jul 2024 14:29:35 -0400</pubDate>
      <guid>https://davelage.com/posts/fetch-images-into-uint8-buffer/</guid>
      <description>&lt;h1 id=&#34;fetch-images-into-uint8arrayuint8buffer-for-wasm-web-applications&#34;&gt;Fetch images into Uint8Array/UInt8Buffer for WASM web applications&lt;/h1&gt;&#xA;&lt;p&gt;When using WASM, we may want to load an image into WASM flow. One way to get an&#xA;image into WASM is getting a Uint8Array version. In Rust, we can represent this&#xA;as a slice &lt;code&gt;&amp;amp;[u8]&lt;/code&gt;. We can then use this to load the image using the &lt;code&gt;image&lt;/code&gt;&#xA;crate for example.&lt;/p&gt;&#xA;&lt;p&gt;To do this in the browser we have 2 main options.&lt;/p&gt;</description>
    </item>
    <item>
      <title>WASM Heap Allocated Never Cleared</title>
      <link>https://davelage.com/posts/wasm-heap-allocated-never-cleared/</link>
      <pubDate>Fri, 26 Jan 2024 15:39:36 -0500</pubDate>
      <guid>https://davelage.com/posts/wasm-heap-allocated-never-cleared/</guid>
      <description>&lt;h1 id=&#34;wasm-heap-allocated-never-cleared&#34;&gt;WASM Heap allocated never cleared&lt;/h1&gt;&#xA;&lt;!--toc:start--&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#wasm-heap-allocated-never-cleared&#34;&gt;WASM Heap allocated never cleared&lt;/a&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#dropping-memory&#34;&gt;Dropping memory&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#allocator-freed-pages&#34;&gt;Allocator freed pages&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;!--toc:end--&gt;&#xA;&lt;h2 id=&#34;dropping-memory&#34;&gt;Dropping memory&lt;/h2&gt;&#xA;&lt;p&gt;Make sure your code is dropping memory. WASM lets you reallocate memory, so you&#xA;need to drop the memory in your code.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-rust&#34; data-lang=&#34;rust&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;struct&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;X&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;u32&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;impl&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;X&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;fn&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;drop&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{}&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;fn&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;main&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;kd&#34;&gt;let&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;X&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;c1&#34;&gt;// Usually x goes out of scope and would get dropped.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;c1&#34;&gt;// But we can drop it here to profile memory.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;c1&#34;&gt;// Remember the allocation of WASM happens in chunks so&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;c1&#34;&gt;// we want to see if we be deallocating appropriately for reuse &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;c1&#34;&gt;// by watching if a memory growth happens&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;drop&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;allocator-freed-pages&#34;&gt;Allocator freed pages&lt;/h2&gt;&#xA;&lt;p&gt;Some allocators can be optimized to not return freed pages to the WebAssembly&#xA;engine/operating system. Make sure your allocator is reallocating appropriate to&#xA;your needs. Rust default allocator allows reuse of memory with WebAssembly, for&#xA;example.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Fine-tuning BLIP Using PEFT</title>
      <link>https://davelage.com/posts/fine-tuning-blip-using-peft/</link>
      <pubDate>Mon, 22 Jan 2024 23:55:17 -0500</pubDate>
      <guid>https://davelage.com/posts/fine-tuning-blip-using-peft/</guid>
      <description>&lt;h1 id=&#34;fine-tuning-blip-using-peft&#34;&gt;Fine-tuning BLIP using PEFT&lt;/h1&gt;&#xA;&lt;p&gt;BLIP is a good model for image captioning. Has a good architecture for this&#xA;task. We can fine-tune this model to have it learn domain specific captioning.&lt;/p&gt;&#xA;&lt;h2 id=&#34;peft&#34;&gt;PEFT&lt;/h2&gt;&#xA;&lt;p&gt;Hugging face has a PEFT library which allows us to hook into other models and&#xA;capture Linear or Conv2D layers. We can use this to fine-tune the BLIP model&#xA;with the attention and convolution layers.&lt;/p&gt;&#xA;&lt;h2 id=&#34;dependencies-and-environment&#34;&gt;Dependencies and environment&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;python -m venv venv&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;source&lt;/span&gt; ./venv/bin/activate &lt;span class=&#34;c1&#34;&gt;# linux&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;call ./venv/scripts/Activate.bat  &lt;span class=&#34;c1&#34;&gt;# windows?&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;install-our-dependencies&#34;&gt;Install our dependencies&lt;/h3&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;pip install transformers peft datasets&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;install-pytorch&#34;&gt;Install PyTorch&lt;/h3&gt;&#xA;&lt;p&gt;Use the PyTorch instructions for your machine:&#xA;&lt;a href=&#34;https://pytorch.org/get-started/locally/&#34;&gt;Get started — PyTorch&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Stable diffusion pipeline from video</title>
      <link>https://davelage.com/posts/stable-diffusion-pipeline-from-video/</link>
      <pubDate>Mon, 22 Jan 2024 23:15:11 -0500</pubDate>
      <guid>https://davelage.com/posts/stable-diffusion-pipeline-from-video/</guid>
      <description>&lt;h1 id=&#34;stable-diffusion-pipeline-from-video&#34;&gt;Stable diffusion pipeline from video&lt;/h1&gt;&#xA;&lt;p&gt;The major purpose is utilizing videos in Stable Diffusion: first, we need to&#xA;extract images by using FFmpeg. During image extraction, issues such as&#xA;blurriness or unrelated content could arise. We have the following solutions:&lt;/p&gt;&#xA;&lt;h2 id=&#34;capturing-frames&#34;&gt;Capturing frames&lt;/h2&gt;&#xA;&lt;h3 id=&#34;1-keyframes&#34;&gt;1. Keyframes&lt;/h3&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://en.wikipedia.org/wiki/Key_frame&#34;&gt;Keyframes&lt;/a&gt; help solidify the frames according to the video creator&#xA;for when to bring the video together. Ideally these won&amp;rsquo;t have bad encoded&#xA;frames and also limit the number of frames we capture.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Alloc_error_web_worker</title>
      <link>https://davelage.com/posts/alloc_error_web_worker/</link>
      <pubDate>Tue, 09 Jan 2024 03:44:33 -0500</pubDate>
      <guid>https://davelage.com/posts/alloc_error_web_worker/</guid>
      <description>&lt;h1 id=&#34;alloc_error-when-using-web-worker&#34;&gt;Alloc_error when using Web Worker&lt;/h1&gt;&#xA;&lt;p&gt;Using Rust WASM you may run into panics. The suggested crate is to use&#xA;&lt;a href=&#34;https://github.com/rustwasm/console_error_panic_hook&#34;&gt;&lt;code&gt;console_error_panic_hook&lt;/code&gt;&lt;/a&gt;&#xA;to see the panic with a helpful backtrace.&lt;/p&gt;&#xA;&lt;p&gt;Even with using this crate it may continue to panic with&#xA;&lt;code&gt;RuntimeError: unreachable executed&lt;/code&gt; without the backtrace. I spent some time&#xA;trying to identify the issue but no matter how I set up the crate it would&#xA;continue with this error.&lt;/p&gt;&#xA;&lt;p&gt;I broke out the code that was running into a separate &lt;code&gt;wasm-bindgen-test&lt;/code&gt; crate&#xA;test. This allows you to run your WASM tests in the browser. Then ran the&#xA;associated code in the test. This finally gave me a backtrace in the code with&#xA;an interesting bug. An &lt;code&gt;alloc_error&lt;/code&gt;. Like the following:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Dedicated Worker Global Scope</title>
      <link>https://davelage.com/posts/dedicated-worker-global-scope/</link>
      <pubDate>Thu, 14 Dec 2023 22:35:27 -0500</pubDate>
      <guid>https://davelage.com/posts/dedicated-worker-global-scope/</guid>
      <description>&lt;h1 id=&#34;dedicated-worker-global-scope&#34;&gt;Dedicated Worker Global Scope&lt;/h1&gt;&#xA;&lt;p&gt;With DedicatedWorkerGlobalScope it gives you direct interaction with both sides&#xA;of worker/main thread.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;main.js&lt;/code&gt;&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;worker&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;Worker&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;/worker.js&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;worker&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;postMessage&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;hello from main&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;// now we can listen for messages from the DedicatedWorkerGlobalScope&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;// note we are adding the event listener to the worker&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;worker&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;addEventListener&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;message&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;e&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;log&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;message from worker&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;e&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;});&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;worker.js&lt;/code&gt;&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;onmessage&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;e&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;log&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;message from main&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;e&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;c1&#34;&gt;// note we are using self here&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;  &lt;span class=&#34;nx&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;postMessage&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;hello from worker&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;links&#34;&gt;Links&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/API/DedicatedWorkerGlobalScope&#34;&gt;https://developer.mozilla.org/en-US/docs/Web/API/DedicatedWorkerGlobalScope&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
    </item>
    <item>
      <title>Error: null pointer passed to rust</title>
      <link>https://davelage.com/posts/error-null-pointer-passed-to-rust/</link>
      <pubDate>Thu, 14 Dec 2023 22:03:42 -0500</pubDate>
      <guid>https://davelage.com/posts/error-null-pointer-passed-to-rust/</guid>
      <description>&lt;h1 id=&#34;error-null-pointer-passed-to-rust&#34;&gt;Error: null pointer passed to rust&lt;/h1&gt;&#xA;&lt;p&gt;Working with WASM and rust and finding this error.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Error: null pointer passed to rust&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And a snippet of the code&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-rust&#34; data-lang=&#34;rust&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cp&#34;&gt;#[wasm_bindgen]&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;impl&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Something&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;pub&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;fn&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;a&lt;/span&gt;: &lt;span class=&#34;nc&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;pub&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;fn&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;y&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;a&lt;/span&gt;: &lt;span class=&#34;nc&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;With the JavaScript side:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;something&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;Something&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;something&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;x&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;// null pointer here&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;something&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;y&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Well what&amp;rsquo;s happening is the first method is eating the value &lt;code&gt;x(self)&lt;/code&gt; and then&#xA;&lt;code&gt;y(self)&lt;/code&gt; has no pointer.&lt;/p&gt;</description>
    </item>
    <item>
      <title>React Suspense for Static Site Generation</title>
      <link>https://davelage.com/posts/react-suspense-for-static-site-generation/</link>
      <pubDate>Thu, 14 Sep 2023 11:31:51 -0400</pubDate>
      <guid>https://davelage.com/posts/react-suspense-for-static-site-generation/</guid>
      <description>&lt;h1 id=&#34;react-suspense-for-static-site-generation&#34;&gt;React Suspense for static site generation&lt;/h1&gt;&#xA;&lt;!--toc:start--&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#react-suspense-for-static-site-generation&#34;&gt;React Suspense for static site generation&lt;/a&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#wrap-promise&#34;&gt;Wrap promise&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#suspense-components&#34;&gt;Suspense components&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#render-to-readable-stream&#34;&gt;Render to readable stream&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;!--toc:end--&gt;&#xA;&lt;p&gt;In 18.2 of React there is an addition of Suspense. This allows an interface for&#xA;handling async data sources and interactions for smoother interface management&#xA;and also handling concurrent rendering.&lt;/p&gt;&#xA;&lt;p&gt;For static site generation we can use these new suspense functionality to&#xA;process data and create static HTML pages. For my usage I want to use React as a&#xA;templating language. Then we can use data (ex. JSON) to populate our template.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Make particle emissions masks using abstract shapes in Godot 4</title>
      <link>https://davelage.com/posts/particle-masks-cone-sphere-area/</link>
      <pubDate>Sat, 22 Jul 2023 14:08:40 -0400</pubDate>
      <guid>https://davelage.com/posts/particle-masks-cone-sphere-area/</guid>
      <description>&lt;h1 id=&#34;make-particle-emissions-masks-using-abstract-shapes-in-godot-4&#34;&gt;Make particle emissions masks using abstract shapes in Godot 4&lt;/h1&gt;&#xA;&lt;p&gt;We can use emissions masks to create emissions shapes to spawn particles. This&#xA;allows us to create custom areas for spawning particles. Useful for spawning&#xA;inside rooms or in shapes like cones.&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;  &lt;picture&gt;&#xA;    &#xA;&#xA;    &#xA;    &lt;img&#xA;      src=&#34;https://davelage.com/img/post/emission-mask-shapes/2023-07-22_14-20.png&#34;&#xA;      alt=&#34;Particles in a cone shape&#34;&#xA;      loading=&#34;lazy&#34;&#xA;      decoding=&#34;async&#34;&#xA;    /&gt;&#xA;  &lt;/picture&gt;&#xA;  &lt;figcaption&gt;Particles in a cone shape&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;To do this we need a mask to generate. You can use any image that has&#xA;transparent pixels so your sprites.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Why Arch Linux</title>
      <link>https://davelage.com/posts/why-arch-linux/</link>
      <pubDate>Tue, 04 Jul 2023 07:49:53 -0400</pubDate>
      <guid>https://davelage.com/posts/why-arch-linux/</guid>
      <description>&lt;h1 id=&#34;why-arch-linux&#34;&gt;Why Arch Linux&lt;/h1&gt;&#xA;&lt;!--toc:start--&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#why-arch-linux&#34;&gt;Why Arch Linux&lt;/a&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#gentoo&#34;&gt;Gentoo&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#fedoracentos&#34;&gt;Fedora/CentOS&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#debian&#34;&gt;Debian&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#ubuntu&#34;&gt;Ubuntu&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#arch-linux&#34;&gt;Arch Linux&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#conclusion&#34;&gt;Conclusion&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;!--toc:end--&gt;&#xA;&lt;p&gt;I moved to Arch Linux in 2020. This was after trying various Linux distros.&#xA;Starting with Gentoo, and into Fedora, CentOS, Ubuntu, and Debian. These distros&#xA;are all generally good for different reasons.&lt;/p&gt;&#xA;&lt;h2 id=&#34;gentoo&#34;&gt;Gentoo&lt;/h2&gt;&#xA;&lt;p&gt;Gentoo was my first Linux distro. Known as a more difficult distribution. You&#xA;will need to compile every software when using the Portage system. There seems&#xA;to be some binary distributions available, but this is not the main way of&#xA;installing software. This can mean installing can take many hours of heavy CPU&#xA;work to get many things installed and running.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cole Pulice - If I Don&#39;t See You in the Future I&#39;ll See You in the Pasture</title>
      <link>https://davelage.com/posts/cole-pulice-if-i-dont-see-you-in-the-future-i-ll-see-you-in-the-pasture/</link>
      <pubDate>Fri, 30 Jun 2023 18:33:11 -0400</pubDate>
      <guid>https://davelage.com/posts/cole-pulice-if-i-dont-see-you-in-the-future-i-ll-see-you-in-the-pasture/</guid>
      <description>&lt;h1 id=&#34;cole-pulice--if-i-dont-see-you-in-the-future-ill-see-you-in-the-pasture&#34;&gt;Cole Pulice — If I Don’t See You in the Future, I’ll See You in the Pasture&lt;/h1&gt;&#xA;&lt;aside class=&#34;youtube-embed&#34; aria-labelledby=&#34;youtube-embed-rlcjvlF2d-4&#34;&gt;&#xA;&#x9;&lt;iframe width=&#34;560&#34; height=&#34;315&#34; src=&#34;https://www.youtube-nocookie.com/embed/rlcjvlF2d-4&#34; frameborder=&#34;0&#34; allow=&#34;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&#34; style=&#34;max-width: 100%&#34; allowfullscreen&gt;&lt;/iframe&gt;&#xA;&#x9;&lt;h4 id=&#34;youtube-embed-rlcjvlF2d-4&#34;&gt;Cole Pulice - If I Don&amp;#39;t See You in the Future I&amp;#39;ll See You in the Pasture&lt;/h4&gt;&#xA;&lt;/aside&gt;</description>
    </item>
    <item>
      <title>7038634357 – Square Heart</title>
      <link>https://davelage.com/posts/7038634357-square-heart/</link>
      <pubDate>Fri, 30 Jun 2023 18:26:53 -0400</pubDate>
      <guid>https://davelage.com/posts/7038634357-square-heart/</guid>
      <description>&lt;h1 id=&#34;7038634357--square-heart&#34;&gt;7038634357 – Square Heart&lt;/h1&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Neo Gibson records, performs, and produces under the alias 7038634357. Their music is characterized by its formal precision, melodic structure, and an idiosyncratic emotional tenor. Up until this point, it has been primarily self-released on small-batch CD-R’s and performed in intimate settings. Synthesized and recorded entirely on their computer, Neo Seven is their first vinyl record, and perhaps their seventh release depending on where you begin amidst their prolific and fluid output.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Recommended environments for machine learning on Arch Linux with Python</title>
      <link>https://davelage.com/posts/python-machine-learning-on-arch-linux/</link>
      <pubDate>Tue, 20 Jun 2023 12:42:32 -0400</pubDate>
      <guid>https://davelage.com/posts/python-machine-learning-on-arch-linux/</guid>
      <description>&lt;h1 id=&#34;recommended-environments-for-machine-learning-on-arch-linux-with-python&#34;&gt;Recommended environments for machine learning on Arch Linux with Python&lt;/h1&gt;&#xA;&lt;!--toc:start--&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#recommended-environments-for-machine-learning-on-arch-linux-with-python&#34;&gt;Recommended environments for machine learning on Arch Linux with Python&lt;/a&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#anaconda&#34;&gt;Anaconda&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#dockerpodman&#34;&gt;Docker/Podman&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#cog&#34;&gt;Cog&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#distrobox&#34;&gt;Distrobox&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#considerations&#34;&gt;Considerations&lt;/a&gt; - &lt;a href=&#34;#venv&#34;&gt;venv&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;!--toc:end--&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;figure&gt;&#xA;  &lt;picture&gt;&#xA;    &#xA;&#xA;      &#xA;&#xA;    &#xA;    &lt;img&#xA;      src=&#34;https://davelage.com/img/post/machine-learning-python-environment.jpg&#34;&#xA;      alt=&#34;machine-learning-python-environment poster image of a cyborg cyber face with a neural network on it&#34;&#xA;      loading=&#34;lazy&#34;&#xA;      decoding=&#34;async&#34;&#xA;    /&gt;&#xA;  &lt;/picture&gt;&#xA;  &lt;figcaption&gt;machine-learning-python-environment poster image of a cyborg cyber face with a neural network on it&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;Arch Linux runs a rolling release. This gets you the most up-to-date packages.&#xA;This also means you may need to update certain drivers or libraries to new&#xA;versions.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Using Warp&#39;s query to handle GET array key values</title>
      <link>https://davelage.com/posts/warp-query-array/</link>
      <pubDate>Thu, 08 Jun 2023 14:38:36 -0400</pubDate>
      <guid>https://davelage.com/posts/warp-query-array/</guid>
      <description>&lt;h1 id=&#34;using-warps-query-to-handle-get-array-key-values&#34;&gt;Using Warp&amp;rsquo;s query to handle GET array key values&lt;/h1&gt;&#xA;&lt;!--toc:start--&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#using-warps-query-to-handle-get-array-key-values&#34;&gt;Using Warp&amp;rsquo;s query to handle GET array key values&lt;/a&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#using-warps-query&#34;&gt;Using Warp&amp;rsquo;s query&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#test-result&#34;&gt;Test result&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;!--toc:end--&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Note: Generally it&amp;rsquo;s not a valid format. Avoid using the same key to pass array&#xA;like values.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://github.com/seanmonstar/warp&#34;&gt;Warp&lt;/a&gt; will parse your query string into a&#xA;data structure using serialization. We will use this to parse into&#xA;&lt;code&gt;Vec&amp;lt;(String, String)&amp;gt;&lt;/code&gt; which allows us to have 2 of the same key. Then we&amp;rsquo;d&#xA;need to parse this down more but gets us the flexibility if we just need to pass&#xA;it on or if this format is the appropriate format. We could also use other&#xA;formats like into a struct and then using other serde libraries for parsing that&#xA;down if you need more control over the data structure.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Add Model Tensors to Tensorboard Histogram</title>
      <link>https://davelage.com/posts/how-to-add-model-tensors-to-tensorboard-histogram/</link>
      <pubDate>Mon, 08 May 2023 16:42:18 -0400</pubDate>
      <guid>https://davelage.com/posts/how-to-add-model-tensors-to-tensorboard-histogram/</guid>
      <description>&lt;h1 id=&#34;how-to-add-model-tensors-to-tensorboard-histogram&#34;&gt;How to add model tensors to TensorBoard histogram&lt;/h1&gt;&#xA;&lt;p&gt;TensorBoard supports histograms, which you can use to showcase your tensors.&#xA;Helpful to see the change in the weights over the training.&lt;/p&gt;&#xA;&lt;p&gt;To get the tensors from your model you can check the &lt;code&gt;network.state_dict()&lt;/code&gt; for&#xA;the named tensor. Then we can save that tensor into the histogram.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kn&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;nn&#34;&gt;torch.utils.tensorboard&lt;/span&gt; &lt;span class=&#34;kn&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SummaryWriter&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;sw&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;SummaryWriter&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;network&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CNN&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;dataloader&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;sample data&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;batch&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;dataloader&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;network&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;train&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;param_tensor&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;network&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;state_dict&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;():&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;sw&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;add_histogram&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;param_tensor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;network&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;state_dict&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()[&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;param_tensor&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;],&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;global_step&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;global_step&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This will save a bucketed version of the tensors. See arguments for&#xA;&lt;code&gt;add_histogram&lt;/code&gt; for more info.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Finding the location of objects in a selection group for fabric.js</title>
      <link>https://davelage.com/posts/fabric-selection-group-positioning/</link>
      <pubDate>Wed, 30 Nov 2022 13:12:50 -0500</pubDate>
      <guid>https://davelage.com/posts/fabric-selection-group-positioning/</guid>
      <description>&lt;h1 id=&#34;finding-the-location-of-objects-in-a-selection-for-fabricjs&#34;&gt;Finding the location of objects in a selection for fabric.js&lt;/h1&gt;&#xA;&lt;figure&gt;&#xA;  &lt;picture&gt;&#xA;    &#xA;&#xA;      &#xA;&#xA;    &#xA;    &lt;img&#xA;      src=&#34;https://davelage.com/img/post/fabric-js-1-0020.jpg&#34;&#xA;      alt=&#34;abstract image of shapes on a canvas&#34;&#xA;      loading=&#34;lazy&#34;&#xA;      decoding=&#34;async&#34;&#xA;    /&gt;&#xA;  &lt;/picture&gt;&#xA;  &lt;figcaption&gt;abstract image of shapes on a canvas&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;Selections are just groups. In fabric.js &amp;lt; 6, the objects are moved from the canvas&#xA;into the selection group. This causes typical object position to be relative to&#xA;the selection instead of the position on the canvas.&lt;/p&gt;&#xA;&lt;p&gt;To find the location of objects, we can use the &lt;code&gt;obj.calcTransformMatrix()&lt;/code&gt;.&#xA;This is the true position of the object on the canvas.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Tauri - Save Files</title>
      <link>https://davelage.com/posts/tauri-save-files/</link>
      <pubDate>Tue, 18 Oct 2022 19:42:35 -0400</pubDate>
      <guid>https://davelage.com/posts/tauri-save-files/</guid>
      <description>&lt;h1 id=&#34;tauri--save-files&#34;&gt;Tauri — Save Files&lt;/h1&gt;&#xA;&lt;p&gt;Tauri has a save interface for saving files to the file system. Because of&#xA;security, you will need to go through this route to handle downloading things&#xA;that are inside the browser side. Like generating something on the canvas and&#xA;then exporting it.&lt;/p&gt;&#xA;&lt;p&gt;To save you can use the JS API save dialog from Tauri, and then write the file&#xA;to the disk.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;save&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;@tauri-apps/api/dialog&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;saveImage&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kr&#34;&gt;async&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;dataUrl&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;suggestedFilename&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;image.png&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;c1&#34;&gt;// Save into the default downloads directory, like in the browser&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;  &lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;filePath&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kr&#34;&gt;await&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;save&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;({&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;defaultPath&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kr&#34;&gt;await&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;downloadsDir&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;/&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;suggestedFilename&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;});&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;c1&#34;&gt;// Now we can write the file to the disk&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;  &lt;span class=&#34;kr&#34;&gt;await&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;writeBinaryFile&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;file&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kr&#34;&gt;await&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;dataUrl&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;then&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;((&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;res&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;res&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;blob&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()));&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;// then something like&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;saveImage&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;canvas&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;toDataURL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;());&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Possibly there &lt;a href=&#34;https://github.com/tauri-apps/wry/pull/530&#34;&gt;will be APIs&lt;/a&gt; that&#xA;allow this to happen through the &lt;code&gt;&amp;lt;a href=&amp;quot;x&amp;quot; download=&amp;quot;image.png&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;/code&gt; browser&#xA;interface in the future.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Neovim 0.8 release notes and highlights</title>
      <link>https://davelage.com/posts/neovim-0.8/</link>
      <pubDate>Fri, 30 Sep 2022 00:00:00 +0000</pubDate>
      <guid>https://davelage.com/posts/neovim-0.8/</guid>
      <description>&lt;h1 id=&#34;neovim-08&#34;&gt;Neovim 0.8&lt;/h1&gt;&#xA;&lt;h2 id=&#34;release-notes&#34;&gt;Release notes&lt;/h2&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://github.com/neovim/neovim/releases/tag/v0.8.0&#34;&gt;v0.8.0&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;highlights&#34;&gt;Highlights&lt;/h2&gt;&#xA;&lt;h3 id=&#34;tree-sitter-and-highlights&#34;&gt;Tree-sitter and highlights&lt;/h3&gt;&#xA;&lt;p&gt;Highlight names now support &lt;code&gt;@&lt;/code&gt; and &lt;code&gt;.&lt;/code&gt; in names, so you can prefix your plugin&#xA;and segment your names by &lt;code&gt;.&lt;/code&gt; and &lt;code&gt;@&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-vimscript&#34; data-lang=&#34;vimscript&#34;&gt;highlight @boo.normal guifg=#000000 guibg=#ffffff&#xA;highlight link Normal @boo.normal&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;With Tree-sitter now setting these variables.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;@tag&#xA;@text&#xA;@keyword&#xA;@function&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;See others with &lt;code&gt;:hi @&amp;lt;Tab&amp;gt;&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;set-cmdheight0&#34;&gt;&lt;code&gt;set cmdheight=0&lt;/code&gt;&lt;/h3&gt;&#xA;&lt;p&gt;New option, allows you to collapse your vim cmd line to 0 when not used.&#xA;Considered experimental.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Azure DevOps Pipelines API Object Moved Curl</title>
      <link>https://davelage.com/posts/azure-pipelines-api-object-moved-curl/</link>
      <pubDate>Fri, 09 Sep 2022 15:09:01 -0400</pubDate>
      <guid>https://davelage.com/posts/azure-pipelines-api-object-moved-curl/</guid>
      <description>&lt;h1 id=&#34;azure-devops-pipelines-api-object-moved-error&#34;&gt;Azure DevOps Pipelines API, Object Moved error&lt;/h1&gt;&#xA;&lt;p&gt;Using curl you may find documentation to use &lt;code&gt;Authorization: Basic $PAT&lt;/code&gt; to pass&#xA;your personal access token (PAT).&lt;/p&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s say we want to trigger a pipeline run. This is the version you may see&#xA;around. This &lt;em&gt;does not work&lt;/em&gt; and causes a Object Moved page to be loaded with a&#xA;&lt;a&gt; tag. The link basically logs you into Azure DevOps.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sh&#34; data-lang=&#34;sh&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;curl --request POST --header &lt;span class=&#34;s2&#34;&gt;&amp;#34;Content-Type: application/json&amp;#34;&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;&#x9;--header &lt;span class=&#34;s2&#34;&gt;&amp;#34;Authorization: Basic &lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$AZURE_RELEASE_TRIGGER_TOKEN&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;&#x9;--data &lt;span class=&#34;s1&#34;&gt;&amp;#39;{ resources: { repositories: { self: { refName: &amp;#34;refs/heads/master&amp;#34; } } } }&amp;#39;&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;se&#34;&gt;&lt;/span&gt;&#x9;&lt;span class=&#34;s2&#34;&gt;&amp;#34;https://dev.azure.com/{organization}/{project}/_apis/pipelines/{pipelineId}/runs?api-version=6.0-preview.1&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The issue is it&amp;rsquo;s not logging you in properly through the PAT. This could be a&#xA;PAT error or due to invalid authorization format. What works though is if you&#xA;use the user option for &lt;code&gt;curl&lt;/code&gt;, passing your PAT as a password (empty username).&lt;/p&gt;</description>
    </item>
    <item>
      <title>nvim-dap — Getting Started</title>
      <link>https://davelage.com/posts/nvim-dap-getting-started/</link>
      <pubDate>Mon, 18 Jul 2022 16:35:03 -0400</pubDate>
      <guid>https://davelage.com/posts/nvim-dap-getting-started/</guid>
      <description>&lt;h1 id=&#34;nvim-dap--getting-started&#34;&gt;&lt;code&gt;nvim-dap&lt;/code&gt; — Getting started&lt;/h1&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://github.com/mfussenegger/nvim-dap&#34;&gt;nvim-dap&lt;/a&gt; implements a client for the &lt;a href=&#34;https://microsoft.github.io/debug-adapter-protocol/overview&#34;&gt;Debug Adapter&#xA;Protocol&lt;/a&gt;. This allows a client to control a debugger over a&#xA;documented API. That allows us to control the debugger from inside neovim, being&#xA;able to set breakpoints, evaluate runtime values of variables, and much more.&lt;/p&gt;&#xA;&lt;p&gt;We&amp;rsquo;ll work through setting up &lt;a href=&#34;https://github.com/mfussenegger/nvim-dap&#34;&gt;&lt;code&gt;nvim-dap&lt;/code&gt;&lt;/a&gt;. It is expected your debugger is&#xA;installed and accessible from a terminal. Some documented installation of&#xA;popular debuggers is available on the &lt;code&gt;nvim-dap&lt;/code&gt;&#xA;&lt;a href=&#34;https://github.com/mfussenegger/nvim-dap/wiki/Debug-Adapter-installation&#34;&gt;Debug-Adapter-Installation&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>BOO Neovim colorscheme</title>
      <link>https://davelage.com/posts/boo-neovim-colorscheme/</link>
      <pubDate>Mon, 18 Jul 2022 14:05:05 -0400</pubDate>
      <guid>https://davelage.com/posts/boo-neovim-colorscheme/</guid>
      <description>&lt;h1 id=&#34;boo&#34;&gt;BOO&lt;/h1&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://github.com/rockerBOO/boo-colorscheme-nvim&#34;&gt;BOO&lt;/a&gt; is a Neovim colorscheme built using Lua, Tree-sitter, and LSP.&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;  &lt;picture&gt;&#xA;    &#xA;&#xA;    &#xA;    &lt;img&#xA;      src=&#34;https://user-images.githubusercontent.com/15027/178179115-3e238800-8c53-4160-962f-90b9d1ad3747.png&#34;&#xA;      alt=&#34;BOO colorscheme&#34;&#xA;      loading=&#34;lazy&#34;&#xA;      decoding=&#34;async&#34;&#xA;    /&gt;&#xA;  &lt;/picture&gt;&#xA;  &lt;figcaption&gt;BOO colorscheme&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;Newest addition for 0.5 is 3 new themes to the previous theme, &lt;code&gt;sunset_cloud&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;themes&#34;&gt;Themes&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#sunset_cloud&#34;&gt;&lt;code&gt;sunset_cloud&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#radioactive_waste&#34;&gt;&lt;code&gt;radioactive_waste&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#forest_stream&#34;&gt;&lt;code&gt;forest_stream&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#crimson_moonlight&#34;&gt;&lt;code&gt;crimson_moonlight&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;sunset_cloud&#34;&gt;&lt;code&gt;sunset_cloud&lt;/code&gt;&lt;/h3&gt;&#xA;&lt;figure&gt;&#xA;  &lt;picture&gt;&#xA;    &#xA;&#xA;    &#xA;    &lt;img&#xA;      src=&#34;https://user-images.githubusercontent.com/15027/162499722-a703531e-e9ac-461e-befb-dc9040234869.png&#34;&#xA;      alt=&#34;sunset_cloud screenshot&#34;&#xA;      loading=&#34;lazy&#34;&#xA;      decoding=&#34;async&#34;&#xA;    /&gt;&#xA;  &lt;/picture&gt;&#xA;  &lt;figcaption&gt;sunset_cloud screenshot&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;h3 id=&#34;radioactive_waste&#34;&gt;&lt;code&gt;radioactive_waste&lt;/code&gt;&lt;/h3&gt;&#xA;&lt;figure&gt;&#xA;  &lt;picture&gt;&#xA;    &#xA;&#xA;    &#xA;    &lt;img&#xA;      src=&#34;https://user-images.githubusercontent.com/15027/178177587-620c2623-c31a-469a-944f-e2c5bbc1bea6.png&#34;&#xA;      alt=&#34;radioactive_waste screenshot&#34;&#xA;      loading=&#34;lazy&#34;&#xA;      decoding=&#34;async&#34;&#xA;    /&gt;&#xA;  &lt;/picture&gt;&#xA;  &lt;figcaption&gt;radioactive_waste screenshot&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;h3 id=&#34;forest_stream&#34;&gt;&lt;code&gt;forest_stream&lt;/code&gt;&lt;/h3&gt;&#xA;&lt;figure&gt;&#xA;  &lt;picture&gt;&#xA;    &#xA;&#xA;    &#xA;    &lt;img&#xA;      src=&#34;https://user-images.githubusercontent.com/15027/178177588-cfe53f8c-08a3-49af-b44a-6667574b1fda.png&#34;&#xA;      alt=&#34;forest_stream screenshot&#34;&#xA;      loading=&#34;lazy&#34;&#xA;      decoding=&#34;async&#34;&#xA;    /&gt;&#xA;  &lt;/picture&gt;&#xA;  &lt;figcaption&gt;forest_stream screenshot&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;h3 id=&#34;crimson_moonlight&#34;&gt;&lt;code&gt;crimson_moonlight&lt;/code&gt;&lt;/h3&gt;&#xA;&lt;figure&gt;&#xA;  &lt;picture&gt;&#xA;    &#xA;&#xA;    &#xA;    &lt;img&#xA;      src=&#34;https://user-images.githubusercontent.com/15027/178177589-bcfe7280-9c43-4d41-abf4-f40e56be9803.png&#34;&#xA;      alt=&#34;crimson_moonlight screenshot&#34;&#xA;      loading=&#34;lazy&#34;&#xA;      decoding=&#34;async&#34;&#xA;    /&gt;&#xA;  &lt;/picture&gt;&#xA;  &lt;figcaption&gt;crimson_moonlight screenshot&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;Please check out the &lt;a href=&#34;https://github.com/rockerBOO/boo-colorscheme-nvim&#34;&gt;boo-colorscheme-nvim README&lt;/a&gt; for more install and&#xA;usage info. Thank you.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Overwatch 2— First Beta</title>
      <link>https://davelage.com/posts/overwatch-2-first-beta/</link>
      <pubDate>Tue, 03 May 2022 13:23:52 -0400</pubDate>
      <guid>https://davelage.com/posts/overwatch-2-first-beta/</guid>
      <description>&lt;h1 id=&#34;overwatch-2-first-beta&#34;&gt;Overwatch 2— First Beta&lt;/h1&gt;&#xA;&lt;p&gt;Needed to write out my opinion on the first Overwatch 2 beta. In response to a post on&#xA;&lt;a href=&#34;https://www.reddit.com/r/Competitiveoverwatch/comments/ugoaeg/american_tornado_head_coach_wheats_shares/i71daha/&#34;&gt;Reddit&lt;/a&gt;&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;p&gt;I personally feel lucky to be able to play this beta. No other game is like OW&#xA;and OW2. I tried a lot of other games, but this is it for me. I hope others will&#xA;enjoy the game and the developers can make a game they feel proud of.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Testing Fabricjs Mouse Events Using Testing Library</title>
      <link>https://davelage.com/posts/testing-fabricjs-mouse-events-using-testing-library/</link>
      <pubDate>Fri, 01 Apr 2022 15:40:36 -0400</pubDate>
      <guid>https://davelage.com/posts/testing-fabricjs-mouse-events-using-testing-library/</guid>
      <description>&lt;h1 id=&#34;testing-fabricjs-mouse-events-using-testing-librarys-fireevent&#34;&gt;Testing fabric.js mouse events using Testing Library&amp;rsquo;s fireEvent&lt;/h1&gt;&#xA;&lt;p&gt;When testing fabric.js you may want to trigger events based on inputs to make&#xA;sure your components or other interactions work properly.&lt;/p&gt;&#xA;&lt;p&gt;To do this you may have or create a canvas element and then try to run mouse&#xA;events on that element. The problem is the events should be triggered on the&#xA;upper canvas element that fabric.js use for interactions. To properly trigger&#xA;these events use &lt;code&gt;canvas.upperCanvasEl&lt;/code&gt; instead of your canvas element.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Using Systemd to Handle Restarts</title>
      <link>https://davelage.com/posts/using-systemd-to-handle-restarts/</link>
      <pubDate>Wed, 23 Mar 2022 16:53:12 -0400</pubDate>
      <guid>https://davelage.com/posts/using-systemd-to-handle-restarts/</guid>
      <description>&lt;h1 id=&#34;using-systemd-to-handle-restarts&#34;&gt;Using systemd to handle restarts&lt;/h1&gt;&#xA;&lt;p&gt;&lt;code&gt;systemd&lt;/code&gt; is a common system daemon that works with running services in linux. A&#xA;common scenario is wanting services to automatically start on boot or to restart&#xA;if they crash. Lots of things can happen to computers. You want your service to&#xA;be resistant to a minimal degree.&lt;/p&gt;&#xA;&lt;p&gt;Keeping a service up minimally can happen through a simple &lt;code&gt;.service&lt;/code&gt; file. I&#xA;use this pattern to make sure services stay up after restarts of the machine or&#xA;handling errors in the service which can take it down.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Fabric active selection is a group</title>
      <link>https://davelage.com/posts/fabric-selection-is-a-group/</link>
      <pubDate>Mon, 21 Mar 2022 19:41:58 -0400</pubDate>
      <guid>https://davelage.com/posts/fabric-selection-is-a-group/</guid>
      <description>&lt;h1 id=&#34;fabric-active-selection-is-a-group&#34;&gt;Fabric active selection is a group&lt;/h1&gt;&#xA;&lt;p&gt;In fabric when you select objects they get added either as the target object or&#xA;in a new group containing the selected objects. This generally works fine until&#xA;you want to get the location of a selected item in a group. Doing &lt;code&gt;object.top&lt;/code&gt;&#xA;or &lt;code&gt;object.left&lt;/code&gt; now has changed from the original location to this new location&#xA;based on the group.&lt;/p&gt;&#xA;&lt;p&gt;This can be bad if you are trying to get or save the location of all the&#xA;selected objects.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Using Firejail</title>
      <link>https://davelage.com/posts/using-firejail/</link>
      <pubDate>Mon, 21 Mar 2022 18:55:03 -0400</pubDate>
      <guid>https://davelage.com/posts/using-firejail/</guid>
      <description>&lt;h1 id=&#34;using-firejail&#34;&gt;Using Firejail&lt;/h1&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Firejail is a SUID (&lt;code&gt;S&lt;/code&gt;et owner &lt;code&gt;U&lt;/code&gt;ser &lt;code&gt;ID&lt;/code&gt; up on execution) program that&#xA;reduces the risk of security breaches by restricting the running environment&#xA;of untrusted applications using Linux namespaces and seccomp-bpf. It allows a&#xA;process and all its descendants to have their own private view of the globally&#xA;shared kernel resources, such as the network stack, process table, mount&#xA;table.&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;Firejail gives you a sandbox for your applications to run, limiting the&#xA;resources it sees and can access. This is useful to limit exposure applications&#xA;have, to undesired effects by limiting files, network, processes it can see.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Neovim laststatus 3</title>
      <link>https://davelage.com/posts/neovim-laststatus-3/</link>
      <pubDate>Thu, 17 Mar 2022 18:25:29 -0400</pubDate>
      <guid>https://davelage.com/posts/neovim-laststatus-3/</guid>
      <description>&lt;h1 id=&#34;neovim-laststatus-3&#34;&gt;Neovim laststatus 3&lt;/h1&gt;&#xA;&lt;p&gt;statusline comes at the bottom of each window in Neovim. With &lt;code&gt;laststatus&lt;/code&gt; 3 you&#xA;can now have statusline per neovim instance. Meaning you have 1 statusbar at the&#xA;bottom showing the current window&amp;rsquo;s status.&lt;/p&gt;&#xA;&lt;video preload=&#34;auto&#34; width=&#34;100%&#34;  autoplay loop poster=&#34;/posts/neovim-laststatus-3/0001-0250.webm.png&#34; playsinline class=&#34;html-video&#34;&gt;&#xA;    &lt;source src=&#34;https://davelage.com/posts/neovim-laststatus-3/0001-0250.webm&#34; type=&#34;video/webm&#34;&gt;&#xA;  &lt;span&gt;Your browser doesn&#39;t support embedded videos, but don&#39;t worry, you can &lt;a href=&#34;https://davelage.com/posts/neovim-laststatus-3/0001-0250.webm&#34;&gt;download it&lt;/a&gt; and watch it with your favorite video player!&lt;/span&gt;&#xA;&lt;/video&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://github.com/neovim/neovim/pull/17266&#34;&gt;feat(statusline): add global statusline #17266&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;usage&#34;&gt;Usage&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;vimscript&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-vimscript&#34; data-lang=&#34;vimscript&#34;&gt;set laststatus=3&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;code&gt;lua&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Setup playwright for dev and production e2e testing</title>
      <link>https://davelage.com/posts/playwright-setup-dev-ci/</link>
      <pubDate>Tue, 01 Mar 2022 14:30:08 -0500</pubDate>
      <guid>https://davelage.com/posts/playwright-setup-dev-ci/</guid>
      <description>&lt;h1 id=&#34;setup-playwright-for-dev-and-production-e2e-testing&#34;&gt;Setup playwright for dev and production e2e testing&lt;/h1&gt;&#xA;&lt;p&gt;Playwright can help run your tests in browsers and setup tests to run in the&#xA;browser.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://playwright.dev/docs/intro&#34;&gt;Getting started&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Because Playwright uses browsers, it needs to install them. At this point you&#xA;could skip to installing and using the docker version which installs the&#xA;browsers for you on an Ubuntu based container.&lt;/p&gt;&#xA;&lt;h2 id=&#34;incorporating-containers&#34;&gt;Incorporating containers&lt;/h2&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://playwright.dev/docs/docker&#34;&gt;Docker&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;production-config&#34;&gt;Production config&lt;/h2&gt;&#xA;&lt;p&gt;This is an example from the docs which I set the base URL for production. Change&#xA;the baseURL based on the environment you want to test on.&lt;/p&gt;</description>
    </item>
    <item>
      <title>OR Type in Gleam</title>
      <link>https://davelage.com/posts/or-type-gleam/</link>
      <pubDate>Wed, 23 Feb 2022 12:18:50 -0500</pubDate>
      <guid>https://davelage.com/posts/or-type-gleam/</guid>
      <description>&lt;h1 id=&#34;or-type-in-gleam&#34;&gt;OR Type in Gleam&lt;/h1&gt;&#xA;&lt;p&gt;I am diving deeper into gleam with making an interface for an Erlang sqlite&#xA;library and is common to have a &lt;code&gt;OR&lt;/code&gt; type.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-erlang&#34; data-lang=&#34;erlang&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;ok&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{:&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;error&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;error&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;After reading&#xA;&lt;a href=&#34;https://gleam.run/book/tour/custom-types.html#erlang-interop&#34;&gt;gleam.run/…/custom-types.html#erlang-interop&lt;/a&gt;,&#xA;which suggests blank constructor(?) types are atoms in Erlang.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-gleam&#34; data-lang=&#34;gleam&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;pub&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;k&#34;&gt;type&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;OkOrError&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;err&#34;&gt;O&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;k&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;   &lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;Error&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;S&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;tring&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Which results in the Gleam to Erlang version:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-erlang&#34; data-lang=&#34;erlang&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;ni&#34;&gt;type&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ok_or_error&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;::&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ok&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;error&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;binary&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()}.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The error can be a blank type in the Erlang libraries so is suggested to use the&#xA;Dynamic type. Then convert the dynamic type into the proper type to handle the&#xA;type differences appropriately.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Loading image using `fetch` and promises</title>
      <link>https://davelage.com/posts/loading-images-using-fetch/</link>
      <pubDate>Thu, 20 Jan 2022 14:11:07 -0500</pubDate>
      <guid>https://davelage.com/posts/loading-images-using-fetch/</guid>
      <description>&lt;h1 id=&#34;loading-images-using-fetch-and-promises&#34;&gt;Loading images using &lt;code&gt;fetch&lt;/code&gt; and promises&lt;/h1&gt;&#xA;&lt;p&gt;If you use fetch to load images you may want to show them on the page or use&#xA;them in other applications.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-js&#34; data-lang=&#34;js&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;loadImage&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;kr&#34;&gt;async&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;url&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;url&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;c1&#34;&gt;// Extract as a blob&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;      &lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;then&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;((&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;resp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;resp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;blob&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;then&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;((&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;blob&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;URL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;createObjectURL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;blob&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;      &lt;span class=&#34;p&#34;&gt;})&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then you can use the Object URL as you do any other URL.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-html&#34; data-lang=&#34;html&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;img&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;src&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;placeholder.jpg&amp;#34;&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;id&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;imageid&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;/&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;script&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;img&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;document&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;querySelector&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;#imageid&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;loadImage&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;myimage.jpg&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;then&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;((&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;url&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;nx&#34;&gt;img&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;src&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;url&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;});&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;script&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you want to use in other cases, you want a fully loaded &lt;code&gt;img&lt;/code&gt; element. You&#xA;probably should wait for the image to be loaded as it can take a period of time&#xA;to load up the image blob into memory.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Testing Library with Mousetrap</title>
      <link>https://davelage.com/posts/testing-library-mousetrap/</link>
      <pubDate>Thu, 30 Dec 2021 20:58:22 -0500</pubDate>
      <guid>https://davelage.com/posts/testing-library-mousetrap/</guid>
      <description>&lt;h1 id=&#34;testing-library-with-mousetrap&#34;&gt;Testing library with Mousetrap&lt;/h1&gt;&#xA;&lt;p&gt;Mousetrap is a library for handling keyboard events. testing-library is a tool&#xA;to help testing React components. If you use both of these you may find it&#xA;difficult to trigger mousetrap events inside components. The suggested&#xA;&lt;code&gt;userEvent.keyboard&lt;/code&gt; does not seem to trigger it.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-jsx&#34; data-lang=&#34;jsx&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;X&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;({&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;undo&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;})&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&lt;span class=&#34;nx&#34;&gt;useEffect&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;mt&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;Mousetrap&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&lt;span class=&#34;nx&#34;&gt;mt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;bind&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;ctrl+z&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;undo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;function&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;cleanup&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&#x9;&lt;span class=&#34;nx&#34;&gt;mt&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;unbind&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;ctrl+z&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&#x9;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&lt;span class=&#34;p&#34;&gt;})&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;div&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;na&#34;&gt;testid&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;yo&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;/&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-jsx&#34; data-lang=&#34;jsx&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;test&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;that undo fires&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;undo&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;jest&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;fn&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;render&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;X&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;undo&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;undo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;/&amp;gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;userEvent&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;keyboard&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;{Ctrl&amp;gt;}z{/Ctrl}&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nx&#34;&gt;expect&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;undo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;toHaveBeenCalled&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;});&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This test fails as not triggering the event.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Unmount Component Error with React and Jest with Testing Library</title>
      <link>https://davelage.com/posts/unmount-react-jest-testing-library/</link>
      <pubDate>Mon, 27 Dec 2021 14:08:04 -0500</pubDate>
      <guid>https://davelage.com/posts/unmount-react-jest-testing-library/</guid>
      <description>&lt;h1 id=&#34;unmount-component-error-with-react-jest-and-testing-library&#34;&gt;Unmount Component Error with React, Jest, and Testing Library&lt;/h1&gt;&#xA;&lt;p&gt;Using the @testing-library/react you can write jsx to test your components.&lt;/p&gt;&#xA;&lt;p&gt;If you use:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-js&#34; data-lang=&#34;js&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;render&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;o&#34;&gt;&amp;lt;&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;MyComponent&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;/&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;SecondComponent&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;/&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;/&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You may get an error saying it can&amp;rsquo;t unmount the component.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Warning: unmountComponentAtNode(): The node you&amp;#39;re attempting to unmount was rendered by another copy of React.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Possibly related to the &lt;code&gt;&amp;lt;&amp;gt;&amp;lt;/&amp;gt;&lt;/code&gt; not properly being a main component for a react&#xA;tree. Removing or replacing this prevents the error.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Deploy Feature Branches</title>
      <link>https://davelage.com/posts/deploy-feature-branches/</link>
      <pubDate>Sun, 21 Nov 2021 13:59:27 -0500</pubDate>
      <guid>https://davelage.com/posts/deploy-feature-branches/</guid>
      <description>&lt;h1 id=&#34;deploy-feature-branches&#34;&gt;Deploy feature branches&lt;/h1&gt;&#xA;&lt;figure&gt;&#xA;  &lt;picture&gt;&#xA;    &#xA;&#xA;    &#xA;    &lt;img&#xA;      src=&#34;https://davelage.com/img/post/deploy-feature-branches.png&#34;&#xA;      alt=&#34;Showcasing Gitlab CI, Nginx, lego.&#34;&#xA;      loading=&#34;lazy&#34;&#xA;      decoding=&#34;async&#34;&#xA;    /&gt;&#xA;  &lt;/picture&gt;&#xA;  &lt;figcaption&gt;Showcasing Gitlab CI, Nginx, &lt;code&gt;lego&lt;/code&gt;.&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;If you use pull requests or merge requests as part of your workflow; making and&#xA;deploying feature branches can be helpful for sharing testable versions.&lt;/p&gt;&#xA;&lt;p&gt;For this example lets take a look at deploying a web app to a web-server, with&#xA;Lets Encrypt on a wildcard certificate.&lt;/p&gt;&#xA;&lt;p&gt;A static typescript-based web app. Need to install dependencies on the build&#xA;server, run tests, build app. Need to point the domain to the feature&#xA;distribution on a web-server.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Linode Wildcard Certificate DNS with lego</title>
      <link>https://davelage.com/posts/linode-wildcard-certificate-dns/</link>
      <pubDate>Sat, 20 Nov 2021 23:55:53 -0500</pubDate>
      <guid>https://davelage.com/posts/linode-wildcard-certificate-dns/</guid>
      <description>&lt;h1 id=&#34;linode-wildcard-certificate-dns&#34;&gt;Linode Wildcard Certificate DNS&lt;/h1&gt;&#xA;&lt;p&gt;To get a wildcard LetsEncrypt certificate you need DNS authentication.&lt;/p&gt;&#xA;&lt;p&gt;Requirements:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://github.com/go-acme/lego&#34;&gt;go-acme/lego: Let&amp;rsquo;s Encrypt client and ACME library written in Go&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;I would suggest downloading a release for your operating system as not wildly&#xA;distributed yet.&lt;/p&gt;&#xA;&lt;p&gt;Using &lt;code&gt;lego&lt;/code&gt;, which has built in Linode capability to automatically add the&#xA;correct DNS to authenticate your domain.&lt;/p&gt;&#xA;&lt;p&gt;You need to make a personal access token. To get a token go to your account&#xA;dropdown, login &amp;amp; authentication, Create a Personal Access Token. You need read&#xA;and write permissions for the domains.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cloudflare A Record DNS for Cloudflare Pages</title>
      <link>https://davelage.com/posts/cloudflare-a-record-dns-cloudflare-pages/</link>
      <pubDate>Fri, 19 Nov 2021 23:52:50 -0500</pubDate>
      <guid>https://davelage.com/posts/cloudflare-a-record-dns-cloudflare-pages/</guid>
      <description>&lt;h1 id=&#34;cloudflare-a-record-dns-for-cloudflare-pages&#34;&gt;Cloudflare A record DNS for Cloudflare Pages&lt;/h1&gt;&#xA;&lt;p&gt;A Records are not recommended for the pages platform due to the distributed&#xA;nature. The suggested process is to set a CNAME your root domain to your&#xA;pages.dev address.&lt;/p&gt;&#xA;&lt;p&gt;If you want to use Cloudflare DNS with Cloudflare Pages it can be tricky to get&#xA;working due to 2 different systems needing to work.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Cloudflare DNS needs to point to your pages URL.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;You need to point a CNAME the root domain to your pages.dev URL. If you are&#xA;moving nameservers it may take some time for this to process.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Use Vale on Neovim</title>
      <link>https://davelage.com/posts/use-vale-on-neovim/</link>
      <pubDate>Fri, 05 Nov 2021 22:56:00 -0400</pubDate>
      <guid>https://davelage.com/posts/use-vale-on-neovim/</guid>
      <description>&lt;h1 id=&#34;use-vale-on-neovim&#34;&gt;Use Vale on Neovim&lt;/h1&gt;&#xA;&lt;figure&gt;&#xA;  &lt;picture&gt;&#xA;    &#xA;&#xA;    &#xA;    &lt;img&#xA;      src=&#34;https://davelage.com/img/2021-11-05_23-25.png&#34;&#xA;      alt=&#34;Showing warnings from Vale inside Neovim using EFM-langserver&#34;&#xA;      loading=&#34;lazy&#34;&#xA;      decoding=&#34;async&#34;&#xA;    /&gt;&#xA;  &lt;/picture&gt;&#xA;  &lt;figcaption&gt;Showing warnings from Vale inside Neovim using EFM-langserver&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://docs.errata.ai/vale/about&#34;&gt;Vale&lt;/a&gt; is a command-line tool that brings code-like linting to prose. Very fast and works well with markup.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;#update&#34;&gt;Update: June 26th 2022, Use nvim-lint.&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;To use Vale with Neovim you will need to be able to run vale, process, and show the errors. A few plugins that can support this nvim-lint (builtin support), ale. As well as LSP servers EFM-langserver or null-ls.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Glorious Mouse O/D/I/N Configure on Linux with Ratbag &amp; Piper</title>
      <link>https://davelage.com/posts/glorious-mouse-linux-ratbag-piper/</link>
      <pubDate>Tue, 09 Mar 2021 16:48:39 -0500</pubDate>
      <guid>https://davelage.com/posts/glorious-mouse-linux-ratbag-piper/</guid>
      <description>&lt;h1 id=&#34;glorious-mouse-odin-configure-on-linux-with-ratbag--piper&#34;&gt;Glorious Mouse O/D/I/N Configure on Linux with Ratbag &amp;amp; Piper&lt;/h1&gt;&#xA;&lt;p&gt;Glorious Mouse comes with configuration software for the LED and DPIs. This is a windows only application, so users of linix will need another tool. Ratbag is a daemon for configuring these mice. Piper is a GUI for configuring.&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;  &lt;picture&gt;&#xA;    &#xA;&#xA;    &#xA;    &lt;img&#xA;      src=&#34;piper.png&#34;&#xA;      alt=&#34;piper&#34;&#xA;      loading=&#34;lazy&#34;&#xA;      decoding=&#34;async&#34;&#xA;    /&gt;&#xA;  &lt;/picture&gt;&#xA;  &lt;figcaption&gt;piper&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;Note: Currently there is no image (404) but this is working.&lt;/p&gt;&#xA;&lt;p&gt;Note: Currently only the 3rd option works as it is not able to change the profile in Piper&lt;/p&gt;</description>
    </item>
    <item>
      <title>Gitlab Runner Cache using Linode Object Storage</title>
      <link>https://davelage.com/posts/gitlab-runner-linode-object-storage/</link>
      <pubDate>Mon, 04 Jan 2021 23:46:14 -0500</pubDate>
      <guid>https://davelage.com/posts/gitlab-runner-linode-object-storage/</guid>
      <description>&lt;h1 id=&#34;gitlab-runner-cache-using-linode-object-storage&#34;&gt;Gitlab Runner Cache using Linode Object Storage&lt;/h1&gt;&#xA;&lt;p&gt;Linode offers 250 GB of object storage for $5 a month. Using this creates a cache for use in Gitlab Runner. This allows proper access to a cache when running your own runners.&lt;/p&gt;&#xA;&lt;h2 id=&#34;setup-linode-object-storage&#34;&gt;Setup Linode Object Storage&lt;/h2&gt;&#xA;&lt;p&gt;First need to set up your Linode Object Storage. Using this setup, the base $5/month price, and you get 250 GB of storage.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://cloud.linode.com/object-storage/buckets&#34;&gt;https://cloud.linode.com/object-storage/buckets&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;setup-linode-object-storage-bucket&#34;&gt;Setup Linode Object Storage Bucket&lt;/h2&gt;&#xA;&lt;p&gt;Make a bucket for the cache.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Simple SVG Icon Shadow Effect</title>
      <link>https://davelage.com/posts/simple-svg-icon-shadow-effect/</link>
      <pubDate>Sun, 27 Dec 2020 00:00:00 +0000</pubDate>
      <guid>https://davelage.com/posts/simple-svg-icon-shadow-effect/</guid>
      <description>&lt;p&gt;If you want to have shadows on your SVG icons, the options can be tough to apply. They require injecting shadows into the SVG logic, making it tough to work with third party icons.&lt;/p&gt;&#xA;&lt;p&gt;The solution I found is to&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Duplicate the icon.&lt;/li&gt;&#xA;&lt;li&gt;Embed the SVG into the HTML to allow for CSS styling.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;We can then use any SVG and layer them. And then we can use native CSS styling.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Rebuild Font Cache on Linux</title>
      <link>https://davelage.com/posts/rebuild-font-cache-linux/</link>
      <pubDate>Tue, 29 Sep 2020 11:08:00 -0400</pubDate>
      <guid>https://davelage.com/posts/rebuild-font-cache-linux/</guid>
      <description>&lt;h1 id=&#34;rebuild-font-cache-on-linux&#34;&gt;Rebuild Font Cache on Linux&lt;/h1&gt;&#xA;&lt;!--toc:start--&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#rebuild-font-cache-on-linux&#34;&gt;Rebuild Font Cache on Linux&lt;/a&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#help-docs&#34;&gt;Help docs&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#rebuild&#34;&gt;Rebuild&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;!--toc:end--&gt;&#xA;&lt;p&gt;When you add fonts, for instance to your &lt;code&gt;~/.fonts&lt;/code&gt; folder, you&amp;rsquo;ll need to force&#xA;rebuild the font cache.&lt;/p&gt;&#xA;&lt;h2 id=&#34;help-docs&#34;&gt;Help docs&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;fc-cache --help&#xA;Build font information caches in [dirs]&#xA;(all directories in font configuration by default).&#xA;    -f, --force              scan directories with apparently valid caches&#xA;    -v, --verbose            display status information while busy&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;rebuild&#34;&gt;Rebuild&lt;/h2&gt;&#xA;&lt;p&gt;We can force it to re scan the valid caches to find our new fonts.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Use Lua files to configure Neovim</title>
      <link>https://davelage.com/posts/neovim_lua_init/</link>
      <pubDate>Mon, 07 Sep 2020 16:49:14 -0400</pubDate>
      <guid>https://davelage.com/posts/neovim_lua_init/</guid>
      <description>&lt;h1 id=&#34;use-lua-files-to-configure-neovim&#34;&gt;Use Lua files to configure Neovim&lt;/h1&gt;&#xA;&lt;p&gt;Using plugins with Neovim tend to have a considerable amount of lua.&lt;/p&gt;&#xA;&lt;p&gt;You can add your lua config to vimscript in Neovim using:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-vimscript&#34; data-lang=&#34;vimscript&#34;&gt;lua &amp;lt;&amp;lt;EOF&#xA;require(&amp;#39;module&amp;#39;)&#xA;EOF&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-vimscript&#34; data-lang=&#34;vimscript&#34;&gt;lua require(&amp;#39;module&amp;#39;)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;use-a-file-to-setup-your-config&#34;&gt;Use a file to setup your config&lt;/h2&gt;&#xA;&lt;p&gt;Lua looks up files based on a list of paths. Neovim is setup to use &lt;code&gt;~/.config/nvim/&lt;/code&gt; as your lookup directory. This allows us to use the pattern of lookup that uses &lt;code&gt;~/.config/nvim/lua/my_config.lua&lt;/code&gt; to match for &lt;code&gt;require(&#39;my_config&#39;)&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Map Capslock to Escape on Linux</title>
      <link>https://davelage.com/posts/keyboard-map-capslock-to-escape/</link>
      <pubDate>Fri, 14 Aug 2020 11:32:44 -0400</pubDate>
      <guid>https://davelage.com/posts/keyboard-map-capslock-to-escape/</guid>
      <description>&lt;h1 id=&#34;map-capslock-to-escape-on-linux&#34;&gt;Map Capslock to Escape on Linux&lt;/h1&gt;&#xA;&lt;p&gt;If you do VIM you may want to remap your escape key to capslock. I personally never use capslock but it is easier to reach than ESC.&lt;/p&gt;&#xA;&lt;h2 id=&#34;x-keyboard-extension&#34;&gt;X Keyboard Extension&lt;/h2&gt;&#xA;&lt;p&gt;If you use X11/Xorg you should have XKeyboard installed. This gives you access to the &lt;code&gt;setxkbmap&lt;/code&gt; program.&lt;/p&gt;&#xA;&lt;h2 id=&#34;setxkbmap&#34;&gt;setxkbmap&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-sh-script&#34; data-lang=&#34;sh-script&#34;&gt;setxkbmap -option caps:escape&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Note: &lt;code&gt;setxkbmap&lt;/code&gt; only sets the current xorg session.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;If you want it to set on starting xorg (&lt;code&gt;startx&lt;/code&gt;) then you should put it in your startup scripts for xorg.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Best of Last Week - Aug 07 2020</title>
      <link>https://davelage.com/posts/best_of_last_week_08_07_2020/</link>
      <pubDate>Thu, 06 Aug 2020 12:35:42 -0400</pubDate>
      <guid>https://davelage.com/posts/best_of_last_week_08_07_2020/</guid>
      <description>&lt;h1 id=&#34;best-of-last-week&#34;&gt;Best of Last Week&lt;/h1&gt;&#xA;&lt;p&gt;Previous week of Aug 07, 2020&lt;/p&gt;&#xA;&lt;h2 id=&#34;music&#34;&gt;Music&lt;/h2&gt;&#xA;&lt;h3 id=&#34;f12---loouuies-edamame&#34;&gt;F12 - Loouuies, Edamame&lt;/h3&gt;&#xA;&lt;aside class=&#34;youtube-embed&#34; aria-labelledby=&#34;youtube-embed-6dW_JcPz8EI&#34;&gt;&#xA;&#x9;&lt;iframe width=&#34;560&#34; height=&#34;315&#34; src=&#34;https://www.youtube-nocookie.com/embed/6dW_JcPz8EI&#34; frameborder=&#34;0&#34; allow=&#34;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&#34; style=&#34;max-width: 100%&#34; allowfullscreen&gt;&lt;/iframe&gt;&#xA;&#x9;&lt;h4 id=&#34;youtube-embed-6dW_JcPz8EI&#34;&gt;F12 - Loouuies, Edamame&lt;/h4&gt;&#xA;&lt;/aside&gt;&#xA;&#xA;&lt;h3 id=&#34;forwardism---rival-consoles&#34;&gt;Forwardism - Rival Consoles&lt;/h3&gt;&#xA;&lt;aside class=&#34;youtube-embed&#34; aria-labelledby=&#34;youtube-embed-1d6EBsa9nho&#34;&gt;&#xA;&#x9;&lt;iframe width=&#34;560&#34; height=&#34;315&#34; src=&#34;https://www.youtube-nocookie.com/embed/1d6EBsa9nho&#34; frameborder=&#34;0&#34; allow=&#34;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&#34; style=&#34;max-width: 100%&#34; allowfullscreen&gt;&lt;/iframe&gt;&#xA;&#x9;&lt;h4 id=&#34;youtube-embed-1d6EBsa9nho&#34;&gt;Forwardism - Rival Consoles&lt;/h4&gt;&#xA;&lt;/aside&gt;&#xA;&#xA;&lt;h3 id=&#34;water-fjk-remix---little-dragon&#34;&gt;Water (FJK Remix) - Little Dragon&lt;/h3&gt;&#xA;&lt;aside class=&#34;youtube-embed&#34; aria-labelledby=&#34;youtube-embed-z4004OfHADM&#34;&gt;&#xA;&#x9;&lt;iframe width=&#34;560&#34; height=&#34;315&#34; src=&#34;https://www.youtube-nocookie.com/embed/z4004OfHADM&#34; frameborder=&#34;0&#34; allow=&#34;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&#34; style=&#34;max-width: 100%&#34; allowfullscreen&gt;&lt;/iframe&gt;&#xA;&#x9;&lt;h4 id=&#34;youtube-embed-z4004OfHADM&#34;&gt;Water (FJK Remix) - Little Dragon&lt;/h4&gt;&#xA;&lt;/aside&gt;</description>
    </item>
    <item>
      <title>Neovim 0.5 LSP with ElixirLS</title>
      <link>https://davelage.com/posts/neovim-0.5-lsp-elixirls/</link>
      <pubDate>Sat, 01 Aug 2020 20:44:25 -0400</pubDate>
      <guid>https://davelage.com/posts/neovim-0.5-lsp-elixirls/</guid>
      <description>&lt;h1 id=&#34;neovim-05-lsp-with-elixirls&#34;&gt;Neovim 0.5 LSP with ElixirLS&lt;/h1&gt;&#xA;&lt;p&gt;Neovim 0.5 comes with a built in LSP client. This allows you to access LS&#xA;Language Servers which services the LSP, &lt;em&gt;Language Server Protocol&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Elixir has a Language Server that is built on the shoulders of other analytic&#xA;services.&lt;/p&gt;&#xA;&lt;p&gt;But you won&amp;rsquo;t be able to boot Neovim 0.5 and connect automatically to the LS.&#xA;You need to configure Neovim to connect to your LS.&lt;/p&gt;&#xA;&lt;h2 id=&#34;install-nvim-lspconfig&#34;&gt;Install &lt;code&gt;nvim-lspconfig&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;p&gt;To connect to your LS, Neovim 0.5 has a plugin to configure the LSP client in&#xA;Neovim.&lt;/p&gt;</description>
    </item>
    <item>
      <title>argument error, :erlang.byte_size</title>
      <link>https://davelage.com/posts/argument-error-erlang-byte_size/</link>
      <pubDate>Sun, 28 Jun 2020 00:00:00 +0000</pubDate>
      <guid>https://davelage.com/posts/argument-error-erlang-byte_size/</guid>
      <description>&lt;h1 id=&#34;argument-error-erlangbyte_size&#34;&gt;&lt;code&gt;argument error, :erlang.byte_size&lt;/code&gt;&lt;/h1&gt;&#xA;&lt;p&gt;This error comes when you don&amp;rsquo;t pass a binary to Elixir string operators.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-elixir&#34; data-lang=&#34;elixir&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;kd&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;remove_hash&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;_&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;channel&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;  &lt;span class=&#34;k&#34;&gt;do&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;   &#x9;&lt;span class=&#34;n&#34;&gt;channel&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;k&#34;&gt;end&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you do:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-elixir&#34; data-lang=&#34;elixir&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;remove_hash&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;rockerboo&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;you&amp;rsquo;ll get an error.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;** (ArgumentError) argument error&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    :erlang.byte_size(&amp;#39;#rockerboo&amp;#39;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Needs to be:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-elixir&#34; data-lang=&#34;elixir&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;remove_hash&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;#&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;rockerboo&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-elixir&#34; data-lang=&#34;elixir&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;iex&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;ss&#34;&gt;:erlang&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;byte_size&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;rockerboo&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;**&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;ArgumentError&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;argument&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;error&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;ss&#34;&gt;:erlang&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;byte_size&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;rockerboo&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;iex&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;ss&#34;&gt;:erlang&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;byte_size&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;rockerboo&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;mi&#34;&gt;9&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <title>Zoom to Middle of fabric.js Canvas</title>
      <link>https://davelage.com/posts/zoom-to-middle-of-fabricjs-canvas/</link>
      <pubDate>Sat, 06 Jun 2020 00:00:00 +0000</pubDate>
      <guid>https://davelage.com/posts/zoom-to-middle-of-fabricjs-canvas/</guid>
      <description>&lt;h1 id=&#34;zoom-to-middle-of-fabricjs-canvas&#34;&gt;Zoom to Middle of fabric.js Canvas&lt;/h1&gt;&#xA;&lt;p&gt;If you are working with mapping software, zooming is usually done to the middle of the viewport. By default zoom will use the top left as the origin.&lt;/p&gt;&#xA;&lt;p&gt;First we&amp;rsquo;ll need to find the center of the canvas.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-ts&#34; data-lang=&#34;ts&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;center&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;canvas&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;getCenter&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;centerPoint&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;fabric&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;Point&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;center&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;left&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;center&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;top&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then we can zoom to the point.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-ts&#34; data-lang=&#34;ts&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;canvas&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;zoomToPoint&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;centerPoint&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;canvas&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;requestRenderAll&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <title>TypeScript as a Solo Developer</title>
      <link>https://davelage.com/posts/typescript-as-a-solo-developer/</link>
      <pubDate>Sat, 23 May 2020 10:53:40 -0400</pubDate>
      <guid>https://davelage.com/posts/typescript-as-a-solo-developer/</guid>
      <description>&lt;h1 id=&#34;typescript-as-a-solo-developer&#34;&gt;TypeScript as a Solo Developer&lt;/h1&gt;&#xA;&lt;p&gt;Deciding on whether to jump into using TypeScript or using vanilla JavaScript&#xA;can be difficult. TypeScript requires more definition to your code, which can&#xA;take more time. Vanilla JavaScript has no static analysis which can make bugs&#xA;come up more often in production. What opportunities for value are available&#xA;using TypeScript over JavaScript?&lt;/p&gt;&#xA;&lt;h2 id=&#34;code-based-self-documentation&#34;&gt;Code-based Self-Documentation&lt;/h2&gt;&#xA;&lt;p&gt;Documentation can be a struggle to keep up with as a solo developer. Speeding&#xA;around the code-base keeping things updated can be a struggle.&lt;/p&gt;</description>
    </item>
    <item>
      <title>100vw Is Bait</title>
      <link>https://davelage.com/posts/100vw-is-bait/</link>
      <pubDate>Wed, 20 May 2020 11:03:29 -0400</pubDate>
      <guid>https://davelage.com/posts/100vw-is-bait/</guid>
      <description>&lt;h1 id=&#34;100vw-is-bait&#34;&gt;100vw Is Bait&lt;/h1&gt;&#xA;&lt;p&gt;If you want something to fit across the viewport, using 100vw would make sense. It stretches across the screen and responds to all screen size changes.&lt;/p&gt;&#xA;&lt;p&gt;The problems comes when you have the screen need to scroll vertically. Most websites work this way so it starts to have problems. The scroll bar now takes viewport space without it reflecting on the &lt;code&gt;vw&lt;/code&gt; variable.&lt;/p&gt;&#xA;&lt;p&gt;The work around for &lt;code&gt;100vw&lt;/code&gt; is to use a lower &lt;code&gt;vw&lt;/code&gt;, &lt;code&gt;94vw&lt;/code&gt; maybe. You need to account for all screens scrollbar size so it starts to fall apart.&lt;/p&gt;</description>
    </item>
    <item>
      <title>IntrinsicAttributes Error for Invalid Props</title>
      <link>https://davelage.com/posts/intrinsicattributes-error-for-invalid-props/</link>
      <pubDate>Sat, 15 Feb 2020 00:00:00 +0000</pubDate>
      <guid>https://davelage.com/posts/intrinsicattributes-error-for-invalid-props/</guid>
      <description>&lt;h1 id=&#34;intrinsicattributes-error-for-invalid-props&#34;&gt;IntrinsicAttributes Error for Invalid Props&lt;/h1&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-jsx&#34; data-lang=&#34;jsx&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;Button&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;onClick&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;{()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;setX&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)}&amp;gt;&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;X&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;Button&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Type &amp;#39;{ children: ReactNode; onClick: () =&amp;gt; void; }&amp;#39; is not assignable to type &amp;#39;IntrinsicAttributes &amp;amp; RefAttributes&amp;lt;any&amp;gt; &amp;amp; Pick&amp;lt;RefAttributes&amp;lt;any&amp;gt;, never&amp;gt; &amp;amp; { theme?: object | undefined; } &amp;amp; { ...; }&amp;#39;.&#xA;  Property &amp;#39;onClick&amp;#39; does not exist on type &amp;#39;IntrinsicAttributes &amp;amp; RefAttributes&amp;lt;any&amp;gt; &amp;amp; Pick&amp;lt;RefAttributes&amp;lt;any&amp;gt;, never&amp;gt; &amp;amp; { theme?: object | undefined; } &amp;amp; { ...; }&amp;#39;.&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This is suggesting that your props are not validating in TypeScript.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Map/Reduce Tuples to Tuples in Typescript</title>
      <link>https://davelage.com/posts/map-reduce-tuples-to-tuples-typescript/</link>
      <pubDate>Sat, 08 Feb 2020 20:40:47 -0500</pubDate>
      <guid>https://davelage.com/posts/map-reduce-tuples-to-tuples-typescript/</guid>
      <description>&lt;h1 id=&#34;mapreduce-tuples-to-tuples-in-typescript&#34;&gt;Map/Reduce Tuples to Tuples in Typescript&lt;/h1&gt;&#xA;&lt;p&gt;If you use map/reduce to process your Tuples, you will find it errors out in Typescript.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-typescript&#34; data-lang=&#34;typescript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;type&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;Point&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;number&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;number&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;point&lt;/span&gt;: &lt;span class=&#34;kt&#34;&gt;Point&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;];&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;shifted&lt;/span&gt;: &lt;span class=&#34;kt&#34;&gt;Point&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;point&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;map&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You will need to cast your result as a type.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-typescript&#34; data-lang=&#34;typescript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;shifted&lt;/span&gt;: &lt;span class=&#34;kt&#34;&gt;Point&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;point&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;map&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;Point&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This method allows you to check the result as a Point. The type checks properly.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-typescript&#34; data-lang=&#34;typescript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;shifted&lt;/span&gt;: &lt;span class=&#34;kt&#34;&gt;Point&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;point&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;map&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;kr&#34;&gt;as&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;Point&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Casting the result as a Tuple also works.&lt;/p&gt;</description>
    </item>
    <item>
      <title>UI Animation Speed</title>
      <link>https://davelage.com/posts/ui-animation-speed/</link>
      <pubDate>Mon, 13 Jan 2020 15:50:19 -0500</pubDate>
      <guid>https://davelage.com/posts/ui-animation-speed/</guid>
      <description>&lt;h1 id=&#34;ui-animation-speed&#34;&gt;UI Animation Speed&lt;/h1&gt;&#xA;&lt;p&gt;In fighting games, the fastest move is usually 3 frames. Fighting games run at 60fps. Each frame is 16.667ms. So the fastest move is 50ms. Estimated response time is around 140-250ms.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;50ms 100ms 150ms 200ms 250ms&#xA;&#xA;  1    2     3     4     5&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Tight animations should be between 50-150ms. 150-250ms will be still tight but be pretty slow to the user. With UI, each action has a anticipated event. Animations should be &amp;lt;150ms for events that should be instant. 250ms if they should be immediate. Higher may be with fade outs but will start to impede on your UX.&lt;/p&gt;</description>
    </item>
    <item>
      <title>MIT&#39;s Browser Climate Change Simulation</title>
      <link>https://davelage.com/posts/mits-browser-climate-change-simulation/</link>
      <pubDate>Tue, 17 Dec 2019 11:06:26 -0500</pubDate>
      <guid>https://davelage.com/posts/mits-browser-climate-change-simulation/</guid>
      <description>&lt;h1 id=&#34;mits-browser-climate-change-simulation&#34;&gt;MIT&amp;rsquo;s Browser Climate Change Simulation&lt;/h1&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;  &#xA;  &#xA;  &#xA;&#xA;&#xA;&#xA;&#xA;&#xA;      &#xA;      &#xA;      &#xA;    &#xA;     &#xA;      &#xA;    &#xA;    &#xA;&#xA;    &#xA;    &#xA;         &#xA;         &#xA;         &#xA;&#xA;         &#xA;        &#xA;        &#xA;        &#xA;        &#xA;      &#xA;      &#xA;    &#xA;  &#xA;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;En-ROADS is a transparent, freely-available policy simulation model that provides policymakers, educators, businesses, the media, and the public with the ability to explore, for themselves, the likely consequences of energy, economic growth, land use, and other policies and uncertainties, with the goal of improving their understanding.&lt;/p&gt;&#xA;  &lt;footer&gt;&#xA;    &lt;strong&gt;&lt;/strong&gt;&#xA;    &#xA;      &#xA;        &lt;cite&gt;&#xA;          &lt;a href=&#34;https://www.climateinteractive.org/tools/en-roads/&#34; title=&#34;https://www.climateinteractive.org/tools/en-roads/&#34;&gt;climateinteractive.org/tools/...&lt;/a&gt; &#xA;        &lt;/cite&gt;&#xA;      &#xA;    &#xA;  &lt;/footer&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&#34;https://en-roads.climateinteractive.org/scenario.html?p1=120&amp;amp;p7=12&amp;amp;p10=1.4&amp;amp;p16=-0.04&amp;amp;p30=-0.05&amp;amp;p35=1&amp;amp;p39=250&amp;amp;p47=3.5&amp;amp;p50=3.4&amp;amp;p53=3.7&amp;amp;p55=3.7&amp;amp;p57=-4.9&amp;amp;p59=-71&amp;amp;p63=2.5&amp;amp;p64=2.8&amp;amp;p65=28&amp;amp;p67=18&amp;amp;g0=1&amp;amp;g1=86&amp;amp;v=2.7.6&#34;&gt;&lt;figure&gt;&#xA;  &lt;picture&gt;&#xA;    &#xA;&#xA;    &#xA;    &lt;img&#xA;      src=&#34;1.9.png&#34;&#xA;      alt=&#34;1.9*C&#34;&#xA;      loading=&#34;lazy&#34;&#xA;      decoding=&#34;async&#34;&#xA;    /&gt;&#xA;  &lt;/picture&gt;&#xA;  &lt;figcaption&gt;1.9*C&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;This was my attempt. I think it balances my assumptions of the future with the target goals.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Currying Order?</title>
      <link>https://davelage.com/posts/currying-order/</link>
      <pubDate>Mon, 16 Dec 2019 19:39:42 -0500</pubDate>
      <guid>https://davelage.com/posts/currying-order/</guid>
      <description>&lt;h1 id=&#34;currying-order&#34;&gt;Currying Order?&lt;/h1&gt;&#xA;&lt;p&gt;2 rules of functional programming is 1 parameter and each function must return something. Using this, currying helps to bridge the gap allowing multiple parameters.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-js&#34; data-lang=&#34;js&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;add&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;y&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;x&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;y&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;add&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So what order should be used?&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-js&#34; data-lang=&#34;js&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;find&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;people&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;person&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;people&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;filter&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;p&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;p&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;===&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;person&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;or&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-js&#34; data-lang=&#34;js&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;find&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;person&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;people&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;people&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;filter&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;p&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;p&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;===&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;person&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-js&#34; data-lang=&#34;js&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;find&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;people&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;person&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;find&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;person&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;people&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now if we start to use them we get some curry properties.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-js&#34; data-lang=&#34;js&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;findPerson&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;find&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;people&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;findPerson&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;person&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-js&#34; data-lang=&#34;js&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;findPerson&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;find&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;person&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;findPerson&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;people&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That&amp;rsquo;s where I am at now. What is a better option?&lt;/p&gt;</description>
    </item>
    <item>
      <title>Storybook: Component Story Format</title>
      <link>https://davelage.com/posts/storybook-component-story-format/</link>
      <pubDate>Mon, 09 Dec 2019 11:23:12 -0500</pubDate>
      <guid>https://davelage.com/posts/storybook-component-story-format/</guid>
      <description>&lt;h1 id=&#34;storybook-component-story-format&#34;&gt;Storybook: Component Story Format&lt;/h1&gt;&#xA;&lt;p&gt;This new format for your stories makes it a lot less horrible. No more hassling with &lt;code&gt;storiesOf&lt;/code&gt; API. Now you can format your stories as ES Modules.&lt;/p&gt;&#xA;&lt;h2 id=&#34;component-story-format-csf&#34;&gt;Component Story Format (CSF)&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-js&#34; data-lang=&#34;js&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;MyComponent&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;./MyComponent.js&amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;export&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;default&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&lt;span class=&#34;nx&#34;&gt;title&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;MyComponent&amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;export&lt;/span&gt; &lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;normal&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;MyComponent&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;/&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;testing&#34;&gt;Testing&lt;/h2&gt;&#xA;&lt;p&gt;Because they are ES Modules, implementing the components, we can use them also for testing.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-js&#34; data-lang=&#34;js&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;render&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;@testing-library/react&amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;import&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;normal&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;from&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;./MyComponent.stories.js&amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;test&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;MyComponent renders&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&lt;span class=&#34;nx&#34;&gt;expect&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;render&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;normal&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;())).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;toMatchSnapshot&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;})&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;links&#34;&gt;Links&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://medium.com/storybookjs/component-story-format-66f4c32366df&#34;&gt;https://medium.com/storybookjs/component-story-format-66f4c32366df&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://storybook.js.org/docs/formats/component-story-format/&#34;&gt;https://storybook.js.org/docs/formats/component-story-format/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
    </item>
    <item>
      <title>Jest ES Modules</title>
      <link>https://davelage.com/posts/jest-es-modules/</link>
      <pubDate>Fri, 06 Dec 2019 13:25:22 -0500</pubDate>
      <guid>https://davelage.com/posts/jest-es-modules/</guid>
      <description>&lt;h1 id=&#34;jest-es-modules&#34;&gt;Jest ES Modules&lt;/h1&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://jestjs.io/&#34;&gt;Jest&lt;/a&gt; uses a custom require to import their modules. This means they will need to properly add support for &lt;a href=&#34;https://nodejs.org/api/esm.html&#34;&gt;ES Modules&lt;/a&gt;. At this time we will still need to use &lt;a href=&#34;https://github.com/facebook/jest/tree/master/packages/babel-jest&#34;&gt;&lt;code&gt;babel-jest&lt;/code&gt;&lt;/a&gt; to convert ES Modules to work with Jest.&lt;/p&gt;&#xA;&lt;h2 id=&#34;add-mjs-to-modulefileextensions&#34;&gt;Add &lt;code&gt;mjs&lt;/code&gt; to &lt;code&gt;moduleFileExtensions&lt;/code&gt;&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-js&#34; data-lang=&#34;js&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;moduleFileExtensions&amp;#34;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&lt;span class=&#34;p&#34;&gt;...,&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&lt;span class=&#34;s2&#34;&gt;&amp;#34;mjs&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;add-babel-jest-transform-for-mjs-files&#34;&gt;Add &lt;code&gt;babel-jest&lt;/code&gt; transform for &lt;code&gt;.mjs&lt;/code&gt; files&lt;/h2&gt;&#xA;&lt;p&gt;This overrides the default &lt;code&gt;babel-jest&lt;/code&gt; transform for relevant files. If you need &lt;code&gt;.js&lt;/code&gt; or other files transformed, make sure to update this regex.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Powershell Stopwatch</title>
      <link>https://davelage.com/posts/powershell-stopwatch/</link>
      <pubDate>Wed, 04 Dec 2019 14:46:25 -0500</pubDate>
      <guid>https://davelage.com/posts/powershell-stopwatch/</guid>
      <description>&lt;h1 id=&#34;powershell-stopwatch&#34;&gt;PowerShell Stopwatch&lt;/h1&gt;&#xA;&lt;p&gt;One component of metrics you can take is measuring how long your scripts take to run. I have a few scripts for powershell and wanted to have a line tell me how long it took.&lt;/p&gt;&#xA;&lt;h2 id=&#34;start&#34;&gt;Start&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-powershell&#34; data-lang=&#34;powershell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;$sw&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;no&#34;&gt;Diagnostics.Stopwatch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]::&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;StartNew&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Toss this at the start. Setting the &lt;code&gt;$sw&lt;/code&gt; variable to refer to at the end of the script.&lt;/p&gt;&#xA;&lt;h2 id=&#34;stop&#34;&gt;Stop&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-powershell&#34; data-lang=&#34;powershell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;$sw&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;py&#34;&gt;Stop&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;output&#34;&gt;Output&lt;/h2&gt;&#xA;&lt;p&gt;Then output the elapsed time.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-powershell&#34; data-lang=&#34;powershell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;$elapsed&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$sw&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;py&#34;&gt;Elapsed&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;py&#34;&gt;TotalSeconds&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;Write-Host&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Ran &lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$elapsed&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; seconds&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;full&#34;&gt;Full&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-powershell&#34; data-lang=&#34;powershell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;$sw&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;no&#34;&gt;Diagnostics.Stopwatch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]::&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;StartNew&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;...&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;$sw&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;py&#34;&gt;Stop&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;$elapsed&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$sw&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;py&#34;&gt;Elapsed&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;py&#34;&gt;TotalSeconds&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;Write-Host&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Ran &lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$elapsed&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt; seconds&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <title>CSS: Text Decoration Thickness</title>
      <link>https://davelage.com/posts/text-decoration-thickness/</link>
      <pubDate>Sun, 01 Dec 2019 01:13:58 -0500</pubDate>
      <guid>https://davelage.com/posts/text-decoration-thickness/</guid>
      <description>&lt;link href=&#34;decoration.css&#34; rel=&#34;stylesheet&#34; /&gt;&#xA;&lt;h1 class=&#34;thick transparent-text-decoration&#34;&gt;Text Decoration Thickness&lt;/h1&gt;&#xA;&lt;p&gt;Adjust how &lt;strong&gt;big&lt;/strong&gt; the &amp;ldquo;decoration&amp;rdquo; is.&lt;/p&gt;&#xA;&lt;p&gt;I think the best one should be the default, but for legacy reasons it&amp;rsquo;s not. It&amp;rsquo;s &amp;hellip;&lt;/p&gt;&#xA;&lt;h2 class=&#34;from-font&#34;&gt;font-weight: 900&lt;/h2&gt;&#xA;&lt;h2 class=&#34;from-font&#34;&gt;text-decoration-thickness: from-font&lt;/h2&gt;&#xA;&lt;h2 class=&#34; from-font&#34; style=&#34;font-weight: 100&#34;&gt;font-weight: 100&lt;/h2&gt;&#xA;&lt;h2 class=&#34; from-font&#34; style=&#34;font-weight: 100&#34;&gt;text-decoration-thickness: from-font&lt;/h2&gt;&#xA;&lt;h2 class=&#34;from-font&#34; style=&#34;font-weight: 400&#34;&gt;font-weight: 400&lt;/h2&gt;&#xA;&lt;h2 class=&#34;from-font&#34; style=&#34;font-weight: 400&#34;&gt;text-decoration-thickness: from-font&lt;/h2&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;  &#xA;  &#xA;  &#xA;&#xA;&#xA;&#xA;&#xA;&#xA;      &#xA;      &#xA;      &#xA;    &#xA;     &#xA;      &#xA;    &#xA;    &#xA;&#xA;    &#xA;    &#xA;         &#xA;         &#xA;         &#xA;&#xA;         &#xA;        &#xA;        &#xA;        &#xA;        &#xA;      &#xA;      &#xA;    &#xA;  &#xA;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If the font file includes information about a preferred thickness, use that value. If the font file doesn&amp;rsquo;t include this information, behave as if auto was set, with the browser choosing an appropriate thickness.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Making custom highlighting styles in Hugo with Chroma</title>
      <link>https://davelage.com/posts/chroma-highlight/</link>
      <pubDate>Sat, 30 Nov 2019 20:19:52 -0500</pubDate>
      <guid>https://davelage.com/posts/chroma-highlight/</guid>
      <description>&lt;h1 id=&#34;making-custom-highlighting-styles-in-hugo-with-chroma&#34;&gt;Making custom highlighting styles in Hugo with Chroma&lt;/h1&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://gohugo.io/&#34;&gt;Hugo&lt;/a&gt; uses &lt;a href=&#34;https://github.com/alecthomas/chroma&#34;&gt;Chroma&lt;/a&gt; for syntax highlighting. Hugo has a {{ &lt;code&gt;&amp;lt; highlight &amp;gt;&lt;/code&gt; }} shortcode.&lt;/p&gt;&#xA;&lt;h2 id=&#34;custom-styles&#34;&gt;Custom Styles&lt;/h2&gt;&#xA;&lt;p&gt;For this site I made some custom styles. To do this, we need to change the highlighter to &lt;a href=&#34;https://gohugo.io/getting-started/configuration-markup#highlight&#34;&gt;use classes&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nt&#34;&gt;markup&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;highlight&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;    &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;noClasses&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;false&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;h2 id=&#34;generate-css&#34;&gt;Generate CSS&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;hugo gen chromastyles --style swapoff &amp;gt; syntax.css&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;This gives you a baseline style to work with. The classes are fairly straight forward. Using the browser inspect tool, you&amp;rsquo;ll find it easy to see the class to target.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Permaculture Books</title>
      <link>https://davelage.com/posts/permaculture-books/</link>
      <pubDate>Sat, 30 Nov 2019 19:44:22 -0500</pubDate>
      <guid>https://davelage.com/posts/permaculture-books/</guid>
      <description>&lt;h1 id=&#34;permaculture-books&#34;&gt;Permaculture Books&lt;/h1&gt;&#xA;&lt;p&gt;Some books I liked in the permaculture mindset.&lt;/p&gt;&#xA;&lt;h2 id=&#34;one-straw-revolution&#34;&gt;One Straw Revolution&lt;/h2&gt;&#xA;&lt;figure&gt;&#xA;  &lt;picture&gt;&#xA;    &#xA;&#xA;      &#xA;&#xA;    &#xA;    &lt;img&#xA;      src=&#34;one-straw.jpg&#34;&#xA;      alt=&#34;&#34;&#xA;      loading=&#34;lazy&#34;&#xA;      decoding=&#34;async&#34;&#xA;    /&gt;&#xA;  &lt;/picture&gt;&#xA;  &lt;figcaption&gt;&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;After running from society, decides to do things differently than things have been done.&lt;/p&gt;&#xA;&lt;h2 id=&#34;restoration-agriculture&#34;&gt;Restoration Agriculture&lt;/h2&gt;&#xA;&lt;figure&gt;&#xA;  &lt;picture&gt;&#xA;    &#xA;&#xA;      &#xA;&#xA;    &#xA;    &lt;img&#xA;      src=&#34;restoration-agriculture.jpg&#34;&#xA;      alt=&#34;&#34;&#xA;      loading=&#34;lazy&#34;&#xA;      decoding=&#34;async&#34;&#xA;    /&gt;&#xA;  &lt;/picture&gt;&#xA;  &lt;figcaption&gt;&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;Unapologetic to the problems of current agriculture, taking a data-centric approach to productivity.&lt;/p&gt;&#xA;&lt;h2 id=&#34;sepp-holzers-permaculture&#34;&gt;Sepp Holzer&amp;rsquo;s Permaculture&lt;/h2&gt;&#xA;&lt;figure&gt;&#xA;  &lt;picture&gt;&#xA;    &#xA;&#xA;      &#xA;&#xA;    &#xA;    &lt;img&#xA;      src=&#34;sepp-holzer-permaculture.jpg&#34;&#xA;      alt=&#34;&#34;&#xA;      loading=&#34;lazy&#34;&#xA;      decoding=&#34;async&#34;&#xA;    /&gt;&#xA;  &lt;/picture&gt;&#xA;  &lt;figcaption&gt;&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;Shows a lot of slope permaculture, working with connected systems, working with nature.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-resilient-farm-and-homestead&#34;&gt;The Resilient Farm and Homestead&lt;/h2&gt;&#xA;&lt;figure&gt;&#xA;  &lt;picture&gt;&#xA;    &#xA;&#xA;      &#xA;&#xA;    &#xA;    &lt;img&#xA;      src=&#34;resilient-farm.jpg&#34;&#xA;      alt=&#34;&#34;&#xA;      loading=&#34;lazy&#34;&#xA;      decoding=&#34;async&#34;&#xA;    /&gt;&#xA;  &lt;/picture&gt;&#xA;  &lt;figcaption&gt;&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;Whole farm with detail and images. Simular to Sepp but a little more modern.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Favicons in Hugo</title>
      <link>https://davelage.com/posts/hugo-favicons/</link>
      <pubDate>Sat, 30 Nov 2019 13:02:58 -0500</pubDate>
      <guid>https://davelage.com/posts/hugo-favicons/</guid>
      <description>&lt;h1 id=&#34;favicons-in-hugo&#34;&gt;Favicons in Hugo&lt;/h1&gt;&#xA;&lt;p&gt;Favicons are necessary to giving your site perspective in the tab bar as well as in other interfaces. But they can be annoying to work with as you need to make and update multiple sizes. I am pretty lazy and would like to automate this.&lt;/p&gt;&#xA;&lt;p&gt;First we&amp;rsquo;ll define the sizes we want for the main favicons. 16, 32, 48 are the most common. Set in your site config file.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Error: Not Supported</title>
      <link>https://davelage.com/posts/error-not-supported/</link>
      <pubDate>Sat, 30 Nov 2019 10:46:27 -0500</pubDate>
      <guid>https://davelage.com/posts/error-not-supported/</guid>
      <description>&lt;h1 id=&#34;error-not-supported&#34;&gt;Error: Not Supported&lt;/h1&gt;&#xA;&lt;h2 id=&#34;node-12x&#34;&gt;Node 12.x&lt;/h2&gt;&#xA;&lt;p&gt;If you are working with &lt;a href=&#34;https://2ality.com/2019/04/nodejs-esm-impl.html&#34;&gt;Node.js 12.x&lt;/a&gt; which adds full &lt;a href=&#34;https://flaviocopes.com/es-modules/&#34;&gt;ESModule support&lt;/a&gt;, you may find you run into this error. This occurs using async dynamic ESModule loading (which is recommended to load ESModules &lt;code&gt;.mjs&lt;/code&gt; into CommonJS &lt;code&gt;.cjs&lt;/code&gt; code).&lt;/p&gt;&#xA;&lt;h3 id=&#34;xcjs&#34;&gt;&lt;code&gt;x.cjs&lt;/code&gt;&lt;/h3&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-js&#34; data-lang=&#34;js&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;import&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;./myESModule.mjs&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;).&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;then&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(({&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;addRow&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;})&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&lt;span class=&#34;nx&#34;&gt;addRow&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;rockerBOO&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;})&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;h2 id=&#34;node-132&#34;&gt;Node 13.2&lt;/h2&gt;&#xA;&lt;p&gt;What I would suggest is upgrading to Node.js 13.2, which has much better error messages. (sort-of)&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;TypeError: Invalid host defined options&#xA;    at module.exports (./webpack.config.cjs:3:33)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;TypeError [ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING]: A dynamic import callback was not specified.&#xA;    at exports.importModuleDynamicallyCallback (internal/process/esm_loader.js:35:9)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;how-to-fix&#34;&gt;How to fix?&lt;/h2&gt;&#xA;&lt;p&gt;Not sure yet. I think some of the tooling surrounding node.js is a little outdated and making it very complicated to integrate ESModules into their configuration process. For instance, right now, Webpack only supports CommonJS modules as it loads all config files (or all js files) through &lt;code&gt;require&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Web Components: Spotify Embed</title>
      <link>https://davelage.com/posts/web-components-spotify-embed/</link>
      <pubDate>Wed, 27 Nov 2019 10:15:30 -0500</pubDate>
      <guid>https://davelage.com/posts/web-components-spotify-embed/</guid>
      <description>&lt;h1 id=&#34;web-components-spotify-embed&#34;&gt;Web Components: Spotify Embed&lt;/h1&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://davelage.com/playlists&#34;&gt;On this site&lt;/a&gt;, I wanted to embed &lt;a href=&#34;https://www.spotify.com&#34;&gt;Spotify&lt;/a&gt; &lt;a href=&#34;https://developer.spotify.com/console/playlists/&#34;&gt;playlists&lt;/a&gt;. Spotify has code to allow you to embed those playlists.&lt;/p&gt;&#xA;&lt;script type=&#34;module&#34; src=&#34;SpotifyEmbed.js&#34;&gt;&lt;/script&gt;&#xA;&lt;p&gt;&amp;lt;spotify-embed&#xA;embedwidth=&amp;ldquo;640&amp;rdquo;&#xA;embedheight=&amp;ldquo;480&amp;rdquo;&#xA;playlistid=&amp;ldquo;1GLEmw6QgsqrZPYUBl8QHi&amp;rdquo;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;/spotify-embed&gt;&lt;/blockquote&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-html&#34; data-lang=&#34;html&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;iframe&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&lt;span class=&#34;na&#34;&gt;src&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;https://open.spotify.com/embed/playlist/1GLEmw6QgsqrZPYUBl8QHi&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&lt;span class=&#34;na&#34;&gt;width&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;300&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&lt;span class=&#34;na&#34;&gt;height&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;380&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&lt;span class=&#34;na&#34;&gt;frameborder&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;0&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&lt;span class=&#34;na&#34;&gt;allowtransparency&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;true&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&lt;span class=&#34;na&#34;&gt;allow&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;encrypted-media&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;iframe&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;h2 id=&#34;web-components&#34;&gt;Web Components&lt;/h2&gt;&#xA;&lt;p&gt;If we want to programatically update or generate the embed we can use JavaScript. Web Components allows us to use templates to render a embed.&lt;/p&gt;&#xA;&lt;h3 id=&#34;spotify-embed-component&#34;&gt;&lt;code&gt;&amp;lt;spotify-embed&amp;gt;&lt;/code&gt; Component&lt;/h3&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-html&#34; data-lang=&#34;html&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;spotify-embed&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&lt;span class=&#34;na&#34;&gt;playlistid&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;1GLEmw6QgsqrZPYUBl8QHi&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&lt;span class=&#34;na&#34;&gt;embedwidth&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;300&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&lt;span class=&#34;na&#34;&gt;embedheight&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;380&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;spotify-embed&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;h3 id=&#34;template&#34;&gt;Template&lt;/h3&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-html&#34; data-lang=&#34;html&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;template&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;id&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;spotify-embed-template&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;iframe&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;iframe&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;template&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;h3 id=&#34;html-element&#34;&gt;HTML Element&lt;/h3&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-js&#34; data-lang=&#34;js&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;SpotifyEmbed&lt;/span&gt; &lt;span class=&#34;kr&#34;&gt;extends&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;HTMLElement&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{...}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;window&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;customElements&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;define&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;spotify-embed&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;SpotifyEmbed&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;Then you load the template in the new HTML element and inject the new attributes.&lt;/p&gt;</description>
    </item>
    <item>
      <title>JavaScript Pipeline Operators (Proposal)</title>
      <link>https://davelage.com/posts/js-pipeline-operators/</link>
      <pubDate>Sat, 23 Nov 2019 11:40:28 -0500</pubDate>
      <guid>https://davelage.com/posts/js-pipeline-operators/</guid>
      <description>&lt;h1 id=&#34;javascript-pipeline-operators&#34;&gt;JavaScript Pipeline Operators&lt;/h1&gt;&#xA;&lt;figure&gt;&#xA;  &lt;picture&gt;&#xA;    &#xA;&#xA;    &#xA;    &lt;img&#xA;      src=&#34;pipeline-operator-cover.png&#34;&#xA;      alt=&#34;Pipeline Operators&#34;&#xA;      loading=&#34;lazy&#34;&#xA;      decoding=&#34;async&#34;&#xA;    /&gt;&#xA;  &lt;/picture&gt;&#xA;  &lt;figcaption&gt;Pipeline Operators&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;  &#xA;  &#xA;  &#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This proposal introduces a new operator &lt;code&gt;|&amp;gt;&lt;/code&gt; similar to F#, OCaml, Elixir, Elm, Julia, Hack, and LiveScript, as well as UNIX pipes. It&amp;rsquo;s a backwards-compatible way of streamlining chained function calls in a readable, functional manner, and provides a practical alternative to extending built-in prototypes.&lt;/p&gt;&#xA;  &lt;footer&gt;&#xA;    &lt;strong&gt;&lt;/strong&gt;&#xA;    &#xA;      &#xA;        &lt;cite&gt;&#xA;          &lt;a href=&#34;https://github.com/tc39/proposal-pipeline-operator&#34; title=&#34;https://github.com/tc39/proposal-pipeline-operator&#34;&gt;tc39/proposal-pipeline-operator&lt;/a&gt; &#xA;        &lt;/cite&gt;&#xA;      &#xA;    &#xA;  &lt;/footer&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-js&#34; data-lang=&#34;js&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;multiply&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;b&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;*&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;b&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;divide&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;b&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;/&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;b&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;add&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;b&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;b&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;// add(5)(divide(multiply(1)(2))(2))&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;result&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;multiply&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;|&amp;gt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;divide&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;|&amp;gt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;add&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;5&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;The format is similar to chaining with objects but allows similar functionality with immutable, functional programming.&lt;/p&gt;</description>
    </item>
    <item>
      <title>HTTP Headers for the Responsible Developer Stefan Judis</title>
      <link>https://davelage.com/posts/http-headers-for-the-responsible-developer/</link>
      <pubDate>Tue, 19 Nov 2019 20:42:13 -0500</pubDate>
      <guid>https://davelage.com/posts/http-headers-for-the-responsible-developer/</guid>
      <description>&lt;h1 id=&#34;http-headers-for-the-responsible-developer&#34;&gt;HTTP Headers for the Responsible Developer&lt;/h1&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;  &#xA;  &#xA;  &#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;To build inclusive websites, developers have to consider accessibility, performance and user flows. Crafted source code forms the foundation for thought-through UIs, but it’s not only about the code. Let’s have a look at HTTP, and to be specific, its headers that can have a direct impact on user experience.&lt;/p&gt;&#xA;  &lt;footer&gt;&#xA;    &lt;strong&gt;Stefan Judis&lt;/strong&gt;&#xA;    &#xA;      &#xA;        &lt;cite&gt;&#xA;          &lt;a href=&#34;https://gotober.com/2019/sessions/1117/http-headers-for-the-responsible-developer&#34; title=&#34;https://gotober.com/2019/sessions/1117/http-headers-for-the-responsible-developer&#34;&gt;HTTP Headers for the Responsible Developer&lt;/a&gt; &#xA;        &lt;/cite&gt;&#xA;      &#xA;    &#xA;  &lt;/footer&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;aside class=&#34;youtube-embed&#34; aria-labelledby=&#34;youtube-embed-JfjiFsJsO4E&#34;&gt;&#xA;&#x9;&lt;iframe width=&#34;560&#34; height=&#34;315&#34; src=&#34;https://www.youtube-nocookie.com/embed/JfjiFsJsO4E&#34; frameborder=&#34;0&#34; allow=&#34;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&#34; style=&#34;max-width: 100%&#34; allowfullscreen&gt;&lt;/iframe&gt;&#xA;&#x9;&lt;h4 id=&#34;youtube-embed-JfjiFsJsO4E&#34;&gt;HTTP Headers for the Responsible Developer -- Stefan Judis&lt;/h4&gt;&#xA;&lt;/aside&gt;&#xA;&#xA;&lt;p&gt;Most of these are HTTP Header updates to help with better security and performance.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Hugo OpenGraph Twitter Cards</title>
      <link>https://davelage.com/posts/hugo-opengraph-twitter-cards/</link>
      <pubDate>Sat, 16 Nov 2019 13:47:11 -0500</pubDate>
      <guid>https://davelage.com/posts/hugo-opengraph-twitter-cards/</guid>
      <description>&lt;h1 id=&#34;opengraph-and-twitter-cards-on-hugo&#34;&gt;OpenGraph and Twitter Cards on Hugo&lt;/h1&gt;&#xA;&lt;figure&gt;&#xA;  &lt;picture&gt;&#xA;    &#xA;&#xA;    &#xA;    &lt;img&#xA;      src=&#34;hugo-opengraph-twitter.png&#34;&#xA;      alt=&#34;Hugo OpenGraph Twitter&#34;&#xA;      loading=&#34;lazy&#34;&#xA;      decoding=&#34;async&#34;&#xA;    /&gt;&#xA;  &lt;/picture&gt;&#xA;  &lt;figcaption&gt;Hugo OpenGraph Twitter&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;When your site is shared on social media, they use meta details from the page that is shared. Facebook uses &lt;a href=&#34;https://ogp.me/&#34;&gt;OpenGraph&lt;/a&gt; and Twitter has their &lt;a href=&#34;https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/abouts-cards&#34;&gt;cards&lt;/a&gt;. This meta data is used to show embedded content inline.&lt;/p&gt;&#xA;&lt;p&gt;To include this in a &lt;a href=&#34;https://gohugo.io/&#34;&gt;Hugo&lt;/a&gt; site you&amp;rsquo;ll want to add it to the &lt;a href=&#34;https://gohugo.io/content-management/front-matter/&#34;&gt;front-matter&lt;/a&gt;. Both use the same variables, and this pattern allows good accessibility to necessary data.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Man Who Planted Trees</title>
      <link>https://davelage.com/posts/the-man-who-planted-trees/</link>
      <pubDate>Sat, 16 Nov 2019 12:28:48 -0500</pubDate>
      <guid>https://davelage.com/posts/the-man-who-planted-trees/</guid>
      <description>&lt;h1 id=&#34;the-man-who-planted-trees&#34;&gt;The Man Who Planted Trees&lt;/h1&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://en.wikipedia.org/wiki/The_Man_Who_Planted_Trees&#34;&gt;The Man Who Planted Trees&lt;/a&gt; (French title &amp;ldquo;L&amp;rsquo;homme qui plantait des arbres&amp;rdquo;) is an allegorical tale by French author &lt;a href=&#34;https://en.wikipedia.org/wiki/Jean_Giono&#34;&gt;Jean Giono&lt;/a&gt;, 1953. Adapted to this animated short by &lt;a href=&#34;https://en.wikipedia.org/wiki/Fr%C3%A9d%C3%A9ric_Back&#34;&gt;Frédéric Back&lt;/a&gt;, 1987.&lt;/p&gt;&#xA;&lt;aside class=&#34;youtube-embed&#34; aria-labelledby=&#34;youtube-embed--29GDEyHM6s&#34;&gt;&#xA;&#x9;&lt;iframe width=&#34;560&#34; height=&#34;315&#34; src=&#34;https://www.youtube-nocookie.com/embed/-29GDEyHM6s&#34; frameborder=&#34;0&#34; allow=&#34;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&#34; style=&#34;max-width: 100%&#34; allowfullscreen&gt;&lt;/iframe&gt;&#xA;&#x9;&lt;h4 id=&#34;youtube-embed--29GDEyHM6s&#34;&gt;The Man Who Planted Trees&lt;/h4&gt;&#xA;&lt;/aside&gt;</description>
    </item>
    <item>
      <title>Github Star Showcase</title>
      <link>https://davelage.com/posts/github-star-showcase/</link>
      <pubDate>Sat, 16 Nov 2019 08:50:41 -0500</pubDate>
      <guid>https://davelage.com/posts/github-star-showcase/</guid>
      <description>&lt;h1 id=&#34;github-star-showcase&#34;&gt;Github Star Showcase&lt;/h1&gt;&#xA;&lt;p&gt;Some recently seen projects on Github that I liked.&lt;/p&gt;&#xA;&lt;h2 id=&#34;react-adaptive-hooks&#34;&gt;react-adaptive-hooks&lt;/h2&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;  &#xA;  &#xA;  &#xA;&#xA;&#xA;&#xA;&#xA;&#xA;      &#xA;      &#xA;      &#xA;    &#xA;     &#xA;      &#xA;    &#xA;    &#xA;&#xA;    &#xA;    &#xA;         &#xA;         &#xA;         &#xA;&#xA;         &#xA;        &#xA;        &#xA;        &#xA;        &#xA;      &#xA;      &#xA;    &#xA;  &#xA;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Deliver experiences best suited to a user&amp;rsquo;s device and network constraints&lt;/p&gt;&#xA;  &lt;footer&gt;&#xA;    &lt;strong&gt;GoogleChromeLabs/react-adaptive-hooks&lt;/strong&gt;&#xA;    &#xA;      &#xA;        &lt;cite&gt;&#xA;          &lt;a href=&#34;https://github.com/GoogleChromeLabs/react-adaptive-hooks&#34; title=&#34;https://github.com/GoogleChromeLabs/react-adaptive-hooks&#34;&gt;github.com/GoogleChromeLabs/...&lt;/a&gt; &#xA;        &lt;/cite&gt;&#xA;      &#xA;    &#xA;  &lt;/footer&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Allows you to access effective states of the device you&amp;rsquo;re running on. Network, &amp;lsquo;Lite Mode&amp;rsquo;, CPU Cores, Memory.&lt;/p&gt;&#xA;&lt;h2 id=&#34;react-screenshot-test&#34;&gt;react-screenshot-test&lt;/h2&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;  &#xA;  &#xA;  &#xA;&#xA;&#xA;&#xA;&#xA;&#xA;      &#xA;      &#xA;      &#xA;    &#xA;     &#xA;      &#xA;    &#xA;    &#xA;&#xA;    &#xA;    &#xA;         &#xA;         &#xA;         &#xA;&#xA;         &#xA;        &#xA;        &#xA;        &#xA;        &#xA;      &#xA;      &#xA;    &#xA;  &#xA;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A dead simple library to screenshot test React components&lt;/p&gt;&#xA;  &lt;footer&gt;&#xA;    &lt;strong&gt;fwouts/react-screenshot-test&lt;/strong&gt;&#xA;    &#xA;      &#xA;        &lt;cite&gt;&#xA;          &lt;a href=&#34;https://github.com/fwouts/react-screenshot-test&#34; title=&#34;https://github.com/fwouts/react-screenshot-test&#34;&gt;github.com/fwouts/...&lt;/a&gt; &#xA;        &lt;/cite&gt;&#xA;      &#xA;    &#xA;  &lt;/footer&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;figure&gt;&#xA;  &lt;picture&gt;&#xA;    &#xA;&#xA;    &#xA;    &lt;img&#xA;      src=&#34;https://davelage.com/img/post/react-screenshot-test.png&#34;&#xA;      alt=&#34;react-screenshot-test.png&#34;&#xA;      loading=&#34;lazy&#34;&#xA;      decoding=&#34;async&#34;&#xA;    /&gt;&#xA;  &lt;/picture&gt;&#xA;  &lt;figcaption&gt;react-screenshot-test.png&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;h2 id=&#34;datgui&#34;&gt;dat.gui&lt;/h2&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;  &#xA;  &#xA;  &#xA;&#xA;&#xA;&#xA;&#xA;&#xA;      &#xA;      &#xA;      &#xA;    &#xA;     &#xA;      &#xA;    &#xA;    &#xA;&#xA;    &#xA;    &#xA;  &#xA;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;dat.gui is a lightweight controller library for JavaScript.&lt;/p&gt;&#xA;  &lt;footer&gt;&#xA;    &lt;strong&gt;dataarts/dat.gui&lt;/strong&gt;&#xA;    &#xA;      &#xA;        &lt;cite&gt;&#xA;          &lt;a href=&#34;https://github.com/dataarts/dat.gui&#34; title=&#34;https://github.com/dataarts/dat.gui&#34;&gt;github.com/dataarts/dat.gui&lt;/a&gt; &#xA;        &lt;/cite&gt;&#xA;      &#xA;    &#xA;  &lt;/footer&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;dat.gui gives a simple GUI for changing JavaScript variables. This is great for small projects where you want to allow customization but don&amp;rsquo;t want to build out a whole GUI for it.&lt;/p&gt;</description>
    </item>
    <item>
      <title>New Design</title>
      <link>https://davelage.com/posts/new-design/</link>
      <pubDate>Fri, 15 Nov 2019 09:43:16 -0500</pubDate>
      <guid>https://davelage.com/posts/new-design/</guid>
      <description>&lt;h1 id=&#34;new-design&#34;&gt;New Design&lt;/h1&gt;&#xA;&lt;p&gt;Been wanting to redesign my site for a while now. The old design was specifically one page, JavaScript free. The new page is also mostly JavaScript free.&lt;/p&gt;&#xA;&lt;p&gt;This new design is more of breaking free of the constraints. Semantically described, it does a much better job of housing the information across.&lt;/p&gt;&#xA;&lt;p&gt;I have also added all my current content released. Will be adding more as we go.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://davelage.com/photos&#34;&gt;1275 Photos&lt;/a&gt; CC 2.0 Licensed&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://davelage.com/videos/nature&#34;&gt;55 Nature Videos&lt;/a&gt; CC 2.0 Licensed&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://davelage.com/code&#34;&gt;Over 60 code repositories&lt;/a&gt; MIT Licensed&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Also have detailed descriptions of my projects, with room for more projects.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
