<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Amin Benselim</title>
    <description>The latest articles on DEV Community by Amin Benselim (@aminbenselim).</description>
    <link>https://dev.to/aminbenselim</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F60436%2Fef50d1f7-9bdb-4492-b5ec-73a8ec4ade9f.jpg</url>
      <title>DEV Community: Amin Benselim</title>
      <link>https://dev.to/aminbenselim</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aminbenselim"/>
    <language>en</language>
    <item>
      <title>How I publish Nuggets directly from RoamResearch to Dev.to  </title>
      <dc:creator>Amin Benselim</dc:creator>
      <pubDate>Fri, 22 Jan 2021 18:34:07 +0000</pubDate>
      <link>https://dev.to/aminbenselim/how-i-publish-nuggets-directly-from-roamresearch-to-dev-to-2nlk</link>
      <guid>https://dev.to/aminbenselim/how-i-publish-nuggets-directly-from-roamresearch-to-dev-to-2nlk</guid>
      <description>&lt;p&gt;&lt;strong&gt;Fun Fact&lt;/strong&gt; This article has been written entirely in RoamResearch in order to test the efficacy of my setup ✌🏻 SO META 🤓   &lt;/p&gt;

&lt;p&gt;&lt;a href="https://roamresearch.com/"&gt;RoamResearch&lt;/a&gt; is the best tool I have discovered in the last year. Over time, it has been the main driver for improving my productivity (or at least perceived productivity 😅). I use it for note-taking, project management, planning, journaling, habit tracking (still need to figure out a good system for this, suggestions welcome 🙏🏻), and thanks to an awesome chrome extension, I am already tweeting from it 🤩 &lt;/p&gt;
&lt;blockquote class="ltag__twitter-tweet"&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--DvwqWWCG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/profile_images/1042827437099413504/PGx7EYkn_normal.jpg" alt="Amin Benselim profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        Amin Benselim
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        &lt;a class="comment-mentioned-user" href="https://dev.to/aminbenselim"&gt;@aminbenselim&lt;/a&gt;

      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--P4t6ys1m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/twitter-f95605061196010f91e64806688390eb1a4dbc9e913682e043eb8b1e06ca484f.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      testing out Mercury extension to tweet from my &lt;a href="https://twitter.com/hashtag/roam"&gt;#roam&lt;/a&gt; database 😍&lt;a href="https://t.co/PEVbopBM28"&gt;chrome.google.com/webstore/detai…&lt;/a&gt;&lt;br&gt;Now if only I can slack and use VsCode from Roam I would gladly spend my day Roaming 😅
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      10:43 AM - 05 Jan 2021
    &lt;/div&gt;


    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1346407074922692608" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WwRENZp4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/twitter-reply-action-238fe0a37991706a6880ed13941c3efd6b371e4aefe288fe8e0db85250708bc4.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1346407074922692608" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PFD0MJBa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/twitter-retweet-action-632c83532a4e7de573c5c08dbb090ee18b348b13e2793175fea914827bc42046.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/like?tweet_id=1346407074922692608" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6wx1BHu3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/twitter-like-action-1ea89f4b87c7d37465b0eb78d51fcb7fe6c03a089805d7ea014ba71365be5171.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;


&lt;p&gt;One of my goals in 2021 is to share my knowledge and engage with online communities. Since I am already accumulating knowledge in RoamResearch, and to reduce context switching, whenever I have an idea for a Nugget, I want to write it down immediately. My roam DB is open at all times, so it feels like the most natural and fastest way for me to write my idea down before I get distracted or lose focus. 🤓  &lt;/p&gt;

&lt;p&gt;Furthermore, The notes I write in Roam have backlinks, which helps me with discoverability and serendipity. I then have a  SmartBlock that takes advantage of roam42 converter [1] to convert the text to markdown and strip the links from it. For example, for this article, here is how it looks from inside RoamResearch (Again, &lt;strong&gt;SO META&lt;/strong&gt; 🤓)  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_oaoylO_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://firebasestorage.googleapis.com/v0/b/firescript-577a2.appspot.com/o/imgs%252Fapp%252Famin%252FK-T2T7wUEU.png%3Falt%3Dmedia%26token%3De2eaac29-3c1c-4fc3-8818-12018c81faeb" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_oaoylO_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://firebasestorage.googleapis.com/v0/b/firescript-577a2.appspot.com/o/imgs%252Fapp%252Famin%252FK-T2T7wUEU.png%3Falt%3Dmedia%26token%3De2eaac29-3c1c-4fc3-8818-12018c81faeb" alt=""&gt;&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;Finally, I like carving out my own solutions to already solved problems. &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--j-2MiLdD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://media2.giphy.com/media/SVH9y2LQUVVCRcqD7o/giphy.gif%3Fcid%3Dd3ed119esn8pbva38zw9144aah0vs1fxne8uh05r79kj00je%26rid%3Dgiphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--j-2MiLdD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://media2.giphy.com/media/SVH9y2LQUVVCRcqD7o/giphy.gif%3Fcid%3Dd3ed119esn8pbva38zw9144aah0vs1fxne8uh05r79kj00je%26rid%3Dgiphy.gif" alt="This Is Cool GIF by MOODMAN"&gt;&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;Inspired by &lt;a href="https://twitter.com/Bieber"&gt;David Bieber&lt;/a&gt; Snippets [0], I wanted to create a system that allows me to share any bit of knowledge from RoamResearch to dev.to. Why call them Nuggets? Well, I didn't want to also call them Snippets 😈  But most importantly, take a look at the definition of a golden nugget in Wikipedia  &lt;/p&gt;


&lt;div class="ltag__wikipedia--container"&gt;
  &lt;div class="ltag__wikipedia--header"&gt;
    &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BZyEeiGj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/wikipedia-logo-0a3e76624c7b1c3ccdeb9493ea4add6ef5bd82d7e88d102d5ddfd7c981efa2e7.svg" class="ltag__wikipedia--logo" alt="Wikipedia Logo"&gt;
    &lt;a href="https://en.wikipedia.org/wiki/Gold_nugget" rel="noopener noreferrer"&gt;Gold nugget&lt;/a&gt;
  &lt;/div&gt;
  &lt;div class="ltag__wikipedia--extract"&gt;&lt;p&gt;A &lt;b&gt;gold nugget&lt;/b&gt; is a naturally occurring piece of native gold. Watercourses often concentrate nuggets and finer gold in placers. Nuggets are recovered by placer mining, but they are also found in residual deposits where the gold-bearing veins or lodes are weathered. Nuggets are also found in the tailings piles of previous mining operations, especially those left by gold mining dredges.&lt;/p&gt;&lt;/div&gt;
  &lt;div class="ltag__wikipedia--btn--container"&gt;
    
      &lt;a href="https://en.wikipedia.org/wiki/Gold_nugget" rel="noopener noreferrer"&gt;View on Wikipedia&lt;/a&gt;
    
  &lt;/div&gt;
&lt;/div&gt;
  

&lt;blockquote&gt;
&lt;p&gt;For me, a Nugget is a &lt;strong&gt;raw piece of knowledge&lt;/strong&gt;, rough and unedited. Either newly discovered or formed and synthesised as a residue from my previously collected knowledge   &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I chose dev.to for two reasons:   &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;dev.to is a great online community geared towards developers, it is very fitting for the content I want to produce which is going to be mainly technical.
&lt;/li&gt;
&lt;li&gt;It has an awesome &lt;a href="https://docs.dev.to/api/operation/createArticle"&gt;API&lt;/a&gt; that allows me to post articles to the platform. I also have a &lt;a href="https://amin.pw"&gt;personal website&lt;/a&gt; that syncs with my published articles in dev.to using a &lt;a href="https://docs.dev.to/api/tag/webhooks"&gt;webhook&lt;/a&gt; (still work in progress. I will publish an article about the process once I am done with it ✌🏻)
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is now an explanation of how my process works  &lt;/p&gt;
&lt;h3&gt;
  
  
  Create a Smart Block to generate a Nugget
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ecqgszzB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://firebasestorage.googleapis.com/v0/b/firescript-577a2.appspot.com/o/imgs%252Fapp%252Famin%252Fo_QlINAd6U.png%3Falt%3Dmedia%26token%3Dc5748274-ae71-44f8-a78a-d2839647ce87" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ecqgszzB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://firebasestorage.googleapis.com/v0/b/firescript-577a2.appspot.com/o/imgs%252Fapp%252Famin%252Fo_QlINAd6U.png%3Falt%3Dmedia%26token%3Dc5748274-ae71-44f8-a78a-d2839647ce87" alt=""&gt;&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;This is a simple smart block that does the following  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add tag reference to &lt;code&gt;Nugget&lt;/code&gt; pages. this is important for me in order to keep track of all the published Nuggets inside my graph
&lt;/li&gt;
&lt;li&gt;Use the &lt;code&gt;---&lt;/code&gt; separator to create a section for the Front-matter attributes
&lt;/li&gt;
&lt;li&gt;For the title and the tags, I use the &lt;code&gt;&amp;lt;%INPUT%&amp;gt;&lt;/code&gt; SmartBlock
&lt;/li&gt;
&lt;li&gt;I then place the cursor after the separator to signify the start of the Nuggets body
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Note&lt;/strong&gt;: because of some limitations and gotchas in the syntax (which I will talk about later), I am not yet confident to directly publish the article so I create it as a draft (&lt;code&gt;published: false&lt;/code&gt;)
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Create a SmartBlock to publish my article to dev.to
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jtCcktYh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://firebasestorage.googleapis.com/v0/b/firescript-577a2.appspot.com/o/imgs%252Fapp%252Famin%252FvEeJQwJ889.png%3Falt%3Dmedia%26token%3D8917cf6a-5531-4355-ace4-138f53744126" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jtCcktYh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://firebasestorage.googleapis.com/v0/b/firescript-577a2.appspot.com/o/imgs%252Fapp%252Famin%252FvEeJQwJ889.png%3Falt%3Dmedia%26token%3D8917cf6a-5531-4355-ace4-138f53744126" alt=""&gt;&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;This SmartBlock is mainly in javascript, it gets the children blocks and takes advantage of roam42 helper functions to convert it to Github markdown  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Github flavoured markdown has differences with the syntax dev.to uses, so I had to do the following changes

&lt;ul&gt;
&lt;li&gt;Change Twitter, Youtube, StackOverflow and StackExchange links from markdown to LiquidTags syntax [2]
&lt;/li&gt;
&lt;li&gt;I learned that highlights denoted by &lt;code&gt;^^&lt;/code&gt; is not part of markdown syntax [3]  So I had to change them to HTML  &lt;code&gt;&amp;lt;mark&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;One other "limitation" I noticed is that If you don't have an empty line at the end of a code block, it will not render properly.
&lt;/li&gt;
&lt;li&gt;One last thing, dev.to does not allow to publish from the frontend due to CORS issues, you need to create a proxy server to the api. I created a simple node.js server you can see here &lt;div class="glitch-embed-wrap"&gt;
  &lt;iframe src="https://glitch.com/embed/#!/embed/roam-to-dev?path=server.js" alt="roam-to-dev on glitch"&gt;&lt;/iframe&gt;
&lt;/div&gt;

&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I have created an issue with the SmartBlock if you want to use it 🙏🏻&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_github-liquid-tag"&gt;
  &lt;h1&gt;
    &lt;a href="https://github.com/roamhacker/SmartBlocks/issues/191"&gt;
      &lt;img class="github-logo" alt="GitHub logo" src="https://res.cloudinary.com/practicaldev/image/fetch/s--vJ70wriM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/github-logo-ba8488d21cd8ee1fee097b8410db9deaa41d0ca30b004c0c63de0a479114156f.svg"&gt;
      &lt;span class="issue-title"&gt;
        Publish Roam page to dev.to 
      &lt;/span&gt;
      &lt;span class="issue-number"&gt;#191&lt;/span&gt;
    &lt;/a&gt;
  &lt;/h1&gt;
  &lt;div class="github-thread"&gt;
    &lt;div class="timeline-comment-header"&gt;
      &lt;a href="https://github.com/amine-benselim"&gt;
        &lt;img class="github-liquid-tag-img" src="https://res.cloudinary.com/practicaldev/image/fetch/s--Z2HqOdVK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://avatars.githubusercontent.com/u/10330904%3Fv%3D4" alt="amine-benselim avatar"&gt;
      &lt;/a&gt;
      &lt;div class="timeline-comment-header-text"&gt;
        &lt;strong&gt;
          &lt;a href="https://github.com/amine-benselim"&gt;amine-benselim&lt;/a&gt;
        &lt;/strong&gt; posted on &lt;a href="https://github.com/roamhacker/SmartBlocks/issues/191"&gt;&lt;time&gt;Jan 22, 2021&lt;/time&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag-github-body"&gt;
      &lt;p&gt;\&lt;/p&gt;
&lt;h2&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;✂️ Copy of your #42SmartBlock from Roam&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;pre&gt;&lt;code&gt;#42SmartBlock Publish Nugget
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;%JAVASCRIPTASYNC:```javascript
// Get the page block uid 
const pageUid = window.location.href.split('/').reverse()[0];
// Walk the blocks tree and generate markdown using roam42 helper functions
let md = await roam42.formatConverter.iterateThroughTree(pageUid, roam42.formatConverter.formatter.markdownGithub);
// Modify generated markdown to be conform with dev.to 
md = md
  // convert links to liquid tags https://forem.dev/p/editor_guide
  .replaceAll(/https:\/\/twitter\.com\/.+\/status\/(\d+)[?]?.*/gmi, "{% twitter $1 %}" )
  .replaceAll(/https:\/\/stackoverflow\.com\/questions\/(\d+)\/.*[?]?.*/gmi, "{% stackoverflow $1 %}")
  .replaceAll(/https:\/\/stackoverflow\.com\/a\/(\d+)\/.*[?]?.*/gmi, "{% stackoverflow $1 %}")
  .replaceAll(/https:\/\/(.*).stackexchange\.com\/questions\/(\d+)\/.*[?]?.*/gmi, "{% stackexchange $2 $1 %}")
  .replaceAll(/(https:\/\/[\w\.]+wikipedia.org\/wiki\/[\w]+)/gmi, "{% wikipedia $1 %}")
  .replaceAll(/https:\/\/github.com\/([\w-]+\/[\w-]+)\/?/gmi, "{% github $1 %}")
  .replaceAll(/(https:\/\/github.com\/[\w-]+\/[\w-]+\/issues\/\d+)/gmi, "{% github $1 %}")
  .replaceAll(/https:\/\/glitch.com\/edit\/#!\/([\w-]+)[?]?(?:path=)?([\w.]+)?/gmi, "{% glitch $1 file=$2 %}")
  .replaceAll(/https:\/\/glitch.com\/edit\/#!\/([\w-]+)/gmi, "{% glitch $1 %}")
  .replaceAll(/{{video: (.+)}}/gmi, (v, url) =&amp;gt; {
    // Neat trick to get the id of youtube video
    const id = new URL(url).searchParams.get('v');
    return "{% youtube " + id + " %}";
  })
  .replaceAll(/\^\^(.*)\^\^\s/gmi, "&amp;lt;mark&amp;gt;$1&amp;lt;/mark&amp;gt; ");
// Delete the text from markdown that is above the frontmatter marker
md = md.split('---');
md.splice(0, 1, ' ');
md = md.join('---').trim();

// Make a post request with the markdown to glitch reverse proxy server 
await fetch('https://roam-to-dev.glitch.me/', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify(
      {"markdown": md})
});

return "#published";```%&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;📋 Describe the SmartBlock&lt;/h2&gt;
&lt;p&gt;SmartBlock to convert page content to markdown and format it to conform with dev.to article syntax and then publish it.&lt;/p&gt;
&lt;h2&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;✅ Describe any prerequisites or dependencies that are required for this SmartBlock&lt;/h2&gt;
&lt;p&gt;You need two things:
1. a certain page structure, I have a simple SmartBlock that helps me create this structure&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;pre&gt;&lt;code&gt;#42SmartBlock Nugget
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;pre&gt;&lt;code&gt;#Nugget {{Publish:42smartblock:Publish Nugget}}
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;pre&gt;&lt;code&gt;---
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;pre&gt;&lt;code&gt;title: &amp;lt;%INPUT:title of the nugget%&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;pre&gt;&lt;code&gt;tags: nugget, &amp;lt;%INPUT:add max 3 tags%&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;pre&gt;&lt;code&gt;published: false
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;pre&gt;&lt;code&gt;canonical_url: &amp;lt;%CONCAT:https,://,amin.pw/nugget/,&amp;lt;%INPUT:enter slug%&amp;gt;%&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;pre&gt;&lt;code&gt;cover_image:
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;pre&gt;&lt;code&gt;---
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;%CURSOR%&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;ol start="2"&gt;
&lt;li&gt;dev.to does not allow to publish from the frontend due to CORS issues, you need to create a proxy server to the api. I personally use a simple node.js server in glitch.com you can copy from here
&lt;a href="https://glitch.com/edit/#!/roam-to-dev?path=server.js" rel="nofollow"&gt;https://glitch.com/edit/#!/roam-to-dev?path=server.js&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;📷 Screenshot of your #42SmartBlock workflow/template from Roam&lt;/h2&gt;
&lt;h2&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;💡 Additional Info&lt;/h2&gt;

    &lt;/div&gt;
    &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/roamhacker/SmartBlocks/issues/191"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
  

&lt;p&gt;And that is it, I now have a system that allows me to publish content from RoamResearch to dev.to. Thanks to RoamResearch for being so extensible, and also to the awesome community and especially &lt;a href="https://twitter.com/roamhacker"&gt;RoamHacker&lt;/a&gt; for coming up with SmartBlocks (If you want to a deep dive into the internals of SmartBlocks, make sure to watch this awesome, and long 😅, video ;) )  &lt;/p&gt;

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

&lt;p&gt;[0] &lt;a href="https://davidbieber.com/snippets/2020-12-28-publishing-blog-posts-from-roam-research-quickly-and-automatically/"&gt;https://davidbieber.com/snippets/2020-12-28-publishing-blog-posts-from-roam-research-quickly-and-automatically/&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;[1] &lt;a href="https://github.com/roamhacker/roam42/blob/master/ext/formatConverter.js"&gt;https://github.com/roamhacker/roam42/blob/master/ext/formatConverter.js&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;[2] &lt;a href="https://forem.dev/p/editor_guide"&gt;https://forem.dev/p/editor_guide&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;[3] &lt;/p&gt;
&lt;div class="ltag__stackexchange--container"&gt;
  &lt;div class="ltag__stackexchange--title-container"&gt;
    
      &lt;div class="ltag__stackexchange--title"&gt;
        &lt;h1&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pTF_nE4a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackoverflow-logo-b42691ae545e4810b105ee957979a853a696085e67e43ee14c5699cf3e890fb4.svg" alt=""&gt;
            &lt;a href="https://stackoverflow.com/questions/25104738/text-highlight-in-markdown" rel="noopener noreferrer"&gt;
               text highlight in markdown
            &lt;/a&gt;
        &lt;/h1&gt;
        &lt;div class="ltag__stackexchange--post-metadata"&gt;
          &lt;span&gt;Aug  3 '14&lt;/span&gt;
            &lt;span&gt;Comments: 2&lt;/span&gt;
            &lt;span&gt;Answers: 5&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;a class="ltag__stackexchange--score-container" href="https://stackoverflow.com/questions/25104738/text-highlight-in-markdown" rel="noopener noreferrer"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5MiFESHx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackexchange-arrow-up-eff2e2849e67d156181d258e38802c0b57fa011f74164a7f97675ca3b6ab756b.svg" alt=""&gt;
        &lt;div class="ltag__stackexchange--score-number"&gt;
          62
        &lt;/div&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Rk_a5QFN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/stackexchange-arrow-down-4349fac0dd932d284fab7e4dd9846f19a3710558efde0d2dfd05897f3eeb9aba.svg" alt=""&gt;
      &lt;/a&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--body"&gt;
    
&lt;p&gt;Within a Markdown editor I want to support text highlight, not in the sense of code highlighting, but the type of highlighting people do on books.&lt;/p&gt;
&lt;p&gt;In code oriented sites people &lt;code&gt;can use backquotes&lt;/code&gt; for a grey background, normally inline code within a paragraph. However on books there is the…&lt;/p&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--btn--container"&gt;
    
      &lt;a href="https://stackoverflow.com/questions/25104738/text-highlight-in-markdown" rel="noopener noreferrer"&gt;Open Full Question&lt;/a&gt;
    
  &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>nugget</category>
      <category>roamresearch</category>
      <category>tutorial</category>
      <category>writing</category>
    </item>
    <item>
      <title>AdventOfCode 2020 is over 🎄 Here is what I learned  🤓</title>
      <dc:creator>Amin Benselim</dc:creator>
      <pubDate>Mon, 28 Dec 2020 18:56:46 +0000</pubDate>
      <link>https://dev.to/aminbenselim/adventofcode-2020-is-over-here-is-what-i-learned-part-1-2hjd</link>
      <guid>https://dev.to/aminbenselim/adventofcode-2020-is-over-here-is-what-i-learned-part-1-2hjd</guid>
      <description>&lt;p&gt;&lt;a href="https://adventofcode.com/"&gt;Advent of Code&lt;/a&gt; is an Advent calendar of programming puzzles of varying difficulty. For 25 days, starting from December 1st, people solve these challenges in order to earn stars ⭐️ and follow the story arch which is different from year to year. &lt;/p&gt;

&lt;p&gt;In previous years, the reason I participated in AoC was the leaderboard. I used to wake up at 6.00 am, with a high sense of urgency, in order to solve the daily challenges as fast as possible and improve my rank on the leaderboard. &lt;/p&gt;

&lt;p&gt;Competitive programming however is &lt;a href="https://www.geeksforgeeks.org/competitive-programming-vs-software-development-where-should-i-invest-my-time/"&gt;different from normal programming&lt;/a&gt;. considering I am not a competitive programmer, and my problem-solving skills are not as sharp. I would get frustrated with the challenges fast and give up by the third or fourth day.&lt;/p&gt;

&lt;p&gt;Not everyone participating in AoC is interested in the leaderboard. As the &lt;a href="https://adventofcode.com/2020/about"&gt;about page&lt;/a&gt; highlights, the Advent of Code challenges can be done for multiple reasons:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;People use them as a speed contest, interview prep, company training, university coursework, practice problems, or to challenge each other.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This year I approached the challenge as a learning opportunity, to sharpen my programming skills, and to improve my work setup. And most importantly, to have fun 🥳 &lt;/p&gt;

&lt;h1&gt;
  
  
  Vim &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wZyx1SMj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/4ggosxvpk3l7cytma3vn.png" alt="Vim logo"&gt;
&lt;/h1&gt;

&lt;p&gt;I used this year's #AdventOfCode as an opportunity to finally learn and properly set up, Vim as my editor of choice.&lt;/p&gt;

&lt;p&gt;Before AoC, the things I already knew about Vim:&lt;br&gt;
✅ How to exit Vim ✌🏻 &lt;code&gt;:q!&lt;/code&gt;, &lt;code&gt;:q&lt;/code&gt;, &lt;code&gt;:wq&lt;/code&gt;.&lt;br&gt;
✅ Simple navigation using &lt;code&gt;h&lt;/code&gt;, &lt;code&gt;j&lt;/code&gt;, &lt;code&gt;k&lt;/code&gt;, &lt;code&gt;l&lt;/code&gt;&lt;br&gt;
✅ Word navigation using w, b, W, B&lt;br&gt;
✅ Changing between the three modes (NORMAL, INSERT, VISUAL)&lt;br&gt;
✅ &lt;code&gt;d&lt;/code&gt;, &lt;code&gt;r&lt;/code&gt;, &lt;code&gt;x&lt;/code&gt;, &lt;code&gt;c&lt;/code&gt; in combination with word navigation 🤝&lt;br&gt;
✅ Managing Vim plugins using &lt;code&gt;vim-plug&lt;/code&gt; &lt;a href="https://github.com/junegunn/vim-plug"&gt;https://github.com/junegunn/vim-plug&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Setting up proper IDE setup
&lt;/h3&gt;

&lt;p&gt;I have followed this blog post on &lt;a href="https://techinscribed.com/how-to-set-up-vim-as-an-ide-for-react-and-typescript-in-2020/"&gt;How to Set up Vim as an IDE for React and TypeScript&lt;/a&gt;. At first, I used the set of plugins that were recommended in the article, later, I will be adding/removing plugins as my system evolves.&lt;/p&gt;

&lt;p&gt;The experience of working in Vim as an IDE after spending three years working with VsCode was painful at the beginning, especially considering I used to heavily rely on my mouse for code navigation, and the file explorer for file navigation. Here is the list of plugins that I got familiar with during AoC that made the transition bearable 😅&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;NERDTree&lt;/strong&gt;&lt;/u&gt; &lt;a href="https://github.com/preservim/nerdtree"&gt;https://github.com/preservim/nerdtree&lt;/a&gt;&lt;br&gt;
A personal favorite of mine 😍 it has made folder navigation within Vim not only manageable but also pleasant 🙌🏻&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can add it to your list of plugins inside your &lt;code&gt;~/.vimrc&lt;/code&gt; (or &lt;code&gt;~/.config/nvim/init.vim&lt;/code&gt; if you're a nVim user 👍🏻) and then run &lt;code&gt;:PlugInstall&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ixPA4gjn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/sqa5yud86qg028qw04u5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ixPA4gjn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/sqa5yud86qg028qw04u5.png" alt="EoqDw6aWMAQYBfu"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To open it to the sidebar, you run the following vim command &lt;code&gt;:NERDTree&lt;/code&gt;. You'll see the following interface&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NSnbg3EF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/eegzs2gnexvr6czz6gjj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NSnbg3EF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/eegzs2gnexvr6czz6gjj.png" alt="EoqEJ_DXIAc-QJb"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;To switch between panes (currently open file and the &lt;code&gt;NERDTree&lt;/code&gt; pane in this instance), you use &lt;code&gt;ctrl+w &amp;lt;direction&amp;gt;&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The plugin has an awesome help menu which you can open by typing &lt;code&gt;?&lt;/code&gt; when the plugin's pane is active.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZperMLU5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9jdzrro5x7mfkt77q4uy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZperMLU5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9jdzrro5x7mfkt77q4uy.png" alt="EoqEYGAXUAMD-zb"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;surround.vim&lt;/strong&gt;&lt;/u&gt; &lt;a href="https://github.com/tpope/vim-surround"&gt;https://github.com/tpope/vim-surround&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Considering I plan to use Vim mostly for code purposes, This plugin is essential for my workflow. From the &lt;code&gt;README.md&lt;/code&gt; of the repo: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Surround.vim is all about "surroundings": parentheses, brackets, quotes, XML tags, and more. The plugin provides mappings to easily delete, change, and add such surroundings in pairs.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The plugin can be installed the same way as &lt;code&gt;NerdTree&lt;/code&gt; and also has a nice helpful help interface &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ohcVKvX8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ekdboncfqt2mp5typh14.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ohcVKvX8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ekdboncfqt2mp5typh14.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Some helpful commands for &lt;code&gt;surround.vim&lt;/code&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Delete surrounding brackets &lt;code&gt;ds{&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Add surrounding quotes &lt;code&gt;ysw'&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Change surrounding quotes from &lt;code&gt;'&lt;/code&gt; to &lt;code&gt;"&lt;/code&gt; &lt;code&gt;cs'"&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>adventofcode</category>
      <category>learning</category>
      <category>vim</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
