<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="/feed.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2025-09-28T19:20:56+00:00</updated><id>/feed.xml</id><title type="html">My  Coding  Journey</title><subtitle>Coding Journey 
</subtitle><author><name>Sim Greenbaum</name></author><entry><title type="html">Why Validating Sidekiq Cron Jobs Is Crucial</title><link href="/2025/09/28/the_benfit_of-test/" rel="alternate" type="text/html" title="Why Validating Sidekiq Cron Jobs Is Crucial" /><published>2025-09-28T00:00:00+00:00</published><updated>2025-09-28T00:00:00+00:00</updated><id>/2025/09/28/the_benfit_of%20test</id><content type="html" xml:base="/2025/09/28/the_benfit_of-test/"><![CDATA[<p>When building applications that rely on background processing, scheduled tasks are a cornerstone for automation. In our Rails project, we use <strong>Sidekiq-Cron</strong> to handle recurring jobs. These jobs are scheduled with cron strings, which define exactly when each task should run.</p>

<p>Recently, we ran into a subtle but frustrating issue: a small misformatting in one of our cron strings caused a <code class="language-plaintext highlighter-rouge">TemuInventoryWorker</code> job to fail. The error wasn’t immediately obvious and could have led to missed tasks in production:</p>

<div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span>
  <span class="s2">"TemuInventoryWorker"</span><span class="p">:</span> <span class="p">[</span>
    <span class="s2">"'cron' -&gt; </span><span class="se">\"</span><span class="s2"> */1 * * *</span><span class="se">\"</span><span class="s2"> -&gt; ArgumentError: not cron or 'natural' cron string: </span><span class="se">\"</span><span class="s2"> */1 * * *</span><span class="se">\"</span><span class="s2">"</span>
  <span class="p">]</span>
<span class="p">}</span>
</code></pre></div></div>
<p>This prompted us to add a <strong>dedicated test for cron string validation</strong>. Instead of simply checking if Sidekiq can load the schedule file, the test now parses each cron string using the same parser Sidekiq-Cron uses internally. This ensures that any invalid schedule is caught <strong>before deployment</strong>.</p>

<div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">require</span> <span class="s2">"sidekiq/cron/job"</span>

<span class="no">RSpec</span><span class="p">.</span><span class="nf">describe</span> <span class="s2">"Sidekiq Cron Schedule"</span> <span class="k">do</span>
<span class="n">let</span><span class="p">(</span><span class="ss">:schedule_file</span><span class="p">)</span> <span class="p">{</span> <span class="no">Rails</span><span class="p">.</span><span class="nf">root</span><span class="p">.</span><span class="nf">join</span><span class="p">(</span><span class="s2">"****/schedule.yml"</span><span class="p">)</span> <span class="p">}</span>
  <span class="n">let</span><span class="p">(</span><span class="ss">:jobs</span><span class="p">)</span> <span class="p">{</span> <span class="no">YAML</span><span class="p">.</span><span class="nf">load_file</span><span class="p">(</span><span class="n">schedule_file</span><span class="p">)</span> <span class="p">}</span>
  <span class="n">it</span> <span class="s2">"validates all cron jobs can be loaded"</span> <span class="k">do</span>
    <span class="n">expect</span><span class="p">(</span><span class="n">jobs</span><span class="p">).</span><span class="nf">to</span><span class="p">(</span><span class="n">be_a</span><span class="p">(</span><span class="no">Hash</span><span class="p">))</span>
    <span class="n">jobs</span><span class="p">.</span><span class="nf">each</span> <span class="k">do</span> <span class="o">|</span><span class="n">job_name</span><span class="p">,</span> <span class="n">job_config</span><span class="o">|</span>
      <span class="n">cron</span> <span class="o">=</span> <span class="n">job_config</span><span class="p">[</span><span class="s1">'cron'</span><span class="p">]</span>
      <span class="n">expect</span><span class="p">(</span><span class="no">Fugit</span><span class="o">::</span><span class="no">Cron</span><span class="p">.</span><span class="nf">parse</span><span class="p">(</span><span class="n">cron</span><span class="p">)).</span><span class="nf">not_to</span><span class="p">(</span><span class="n">be_nil</span><span class="p">,</span> <span class="s2">"Invalid cron for </span><span class="si">#{</span><span class="n">job_name</span><span class="si">}</span><span class="s2">: </span><span class="si">#{</span><span class="n">cron</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span>
    <span class="k">end</span>
  <span class="k">end</span>
<span class="k">end</span>
</code></pre></div></div>

<p>This clearly shows which job failed and why, so developers can fix the cron string immediately. 
It saves hours of debugging in production and ensures your scheduled tasks run reliably.</p>

<div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="no">Failure</span><span class="o">/</span><span class="no">Error</span><span class="p">:</span> <span class="n">expect</span><span class="p">(</span><span class="no">Fugit</span><span class="o">::</span><span class="no">Cron</span><span class="p">.</span><span class="nf">parse</span><span class="p">(</span><span class="n">cron</span><span class="p">)).</span><span class="nf">not_to</span><span class="p">(</span><span class="n">be_nil</span><span class="p">,</span> 
<span class="s2">"Invalid cron for </span><span class="si">#{</span><span class="n">job_name</span><span class="si">}</span><span class="s2">: </span><span class="si">#{</span><span class="n">cron</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span>
       <span class="no">Invalid</span> <span class="n">cron</span> <span class="k">for</span> <span class="no">InventoryWorker</span><span class="p">:</span>  <span class="o">*</span><span class="sr">/1 * * *
</span></code></pre></div></div>

<p>The benefits are clear:</p>

<ul>
  <li><strong>Early error detection:</strong> Developers are notified immediately if a cron string is misformatted.</li>
  <li><strong>Increased reliability:</strong> Scheduled jobs run exactly as intended without silent failures.</li>
  <li><strong>Clear debugging:</strong> The test outputs exactly which job has an invalid cron string, saving valuable troubleshooting time.</li>
</ul>

<p>Adding this simple validation test may seem minor, but it significantly reduces risk in our automated workflows. It’s a small change that has a big impact on the reliability of our background job system.</p>

<p>Automation is only as good as the safeguards we put around it, and validating cron jobs is one of those essential safeguards.</p>]]></content><author><name>Sim Greenbaum</name></author><summary type="html"><![CDATA[When building applications that rely on background processing, scheduled tasks are a cornerstone for automation. In our Rails project, we use Sidekiq-Cron to handle recurring jobs. These jobs are scheduled with cron strings, which define exactly when each task should run.]]></summary></entry><entry><title type="html">Maps vs. Objects in JavaScript: Pros and Cons</title><link href="/2024/07/29/map_vs_object_js/" rel="alternate" type="text/html" title="Maps vs. Objects in JavaScript: Pros and Cons" /><published>2024-07-29T00:00:00+00:00</published><updated>2024-07-29T00:00:00+00:00</updated><id>/2024/07/29/map_vs_object_js</id><content type="html" xml:base="/2024/07/29/map_vs_object_js/"><![CDATA[<p>Did you ever wonder what the difference between a JavaScript object (some call it a hash) and a map is?</p>

<h1 id="objects--">Objects { }</h1>
<p>In JavaScript, both Map and Object are commonly used for storing key-value pairs. However, they serve different purposes and come with their own sets of advantages and disadvantages. Understanding when to use each can help you write more efficient and effective code. A basic JS object would look something like this:</p>

<div class="language-js highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kd">let</span> <span class="nx">obj</span> <span class="o">=</span> <span class="p">{</span> <span class="na">key</span><span class="p">:</span> <span class="dl">'</span><span class="s1">value</span><span class="dl">'</span> <span class="p">};</span>
</code></pre></div></div>

<h2 id="pros">Pros</h2>

<ol>
  <li>Easy to use and very straightforward .</li>
  <li>Very compatible with JSON, the language of the web.</li>
  <li>Everyone is used to how they work and familiar with it.</li>
</ol>

<h2 id="cons">Cons</h2>

<ol>
  <li>In JS, keys must be strings, not any other data type.</li>
  <li>Inheritance issues can lead to unexpected behavior if not managed correctly.</li>
  <li>Somewhat less perrfomant than Map .</li>
  <li>Keys are placed randomly and there is no order index.</li>
</ol>

<h1 id="map">Map</h1>

<h2 id="pros-1">Pros</h2>

<ol>
  <li>Flexible keys; you can use other data types like integers or even objects.</li>
  <li>Order does matter, and you can iterate over items in the order they were added.</li>
  <li>Map is optimized for frequent additions and removals with large datasets.a sets.</li>
  <li>Has built-in getter and setter methods.</li>
</ol>

<div class="language-js highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nx">map</span><span class="p">.</span><span class="kd">set</span><span class="p">(</span><span class="dl">'</span><span class="s1">key</span><span class="dl">'</span><span class="p">,</span> <span class="dl">'</span><span class="s1">value</span><span class="dl">'</span><span class="p">);</span>
<span class="nx">map</span><span class="p">.</span><span class="kd">get</span><span class="p">(</span><span class="dl">'</span><span class="s1">key</span><span class="dl">'</span><span class="p">);</span> <span class="c1">// 'value'</span>
<span class="nx">map</span><span class="p">.</span><span class="nx">has</span><span class="p">(</span><span class="dl">'</span><span class="s1">key</span><span class="dl">'</span><span class="p">);</span> <span class="c1">// true</span>
<span class="nx">map</span><span class="p">.</span><span class="k">delete</span><span class="p">(</span><span class="dl">'</span><span class="s1">key</span><span class="dl">'</span><span class="p">);</span> <span class="c1">// true</span>
</code></pre></div></div>

<h2 id="cons-1">Cons</h2>

<ol>
  <li>Is more verbose than some developers would like.</li>
  <li>Cannot be directly serialized to JSON, so it is not ideal for sending over the wire.</li>
  <li>Relatively newer; some developers might not be as familiar with it.</li>
</ol>

<div class="language-js highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kd">let</span> <span class="nx">map</span> <span class="o">=</span> <span class="k">new</span> <span class="nb">Map</span><span class="p">();</span>
<span class="nx">map</span><span class="p">.</span><span class="kd">set</span><span class="p">(</span><span class="dl">'</span><span class="s1">key</span><span class="dl">'</span><span class="p">,</span> <span class="dl">'</span><span class="s1">value</span><span class="dl">'</span><span class="p">);</span>
</code></pre></div></div>

<p>Conclusion
Both Map and Object are powerful tools in JavaScript with their own strengths and weaknesses. By understanding their differences, you can make informed decisions about which to use based on your specific use case. For simple, straightforward data structures, Object remains a solid choice. For more complex requirements, especially when performance and flexibility are key, Map is often the better option.</p>

<p>All the Best</p>

<p>Simcha Greenbaum</p>]]></content><author><name>Sim Greenbaum</name></author><summary type="html"><![CDATA[Did you ever wonder what the difference between a JavaScript object (some call it a hash) and a map is?]]></summary></entry><entry><title type="html">Why is testing so important.</title><link href="/rspec_testing_your_code" rel="alternate" type="text/html" title="Why is testing so important." /><published>2021-10-31T00:00:00+00:00</published><updated>2021-10-31T00:00:00+00:00</updated><id>/rspec_testing_your_code</id><content type="html" xml:base="/rspec_testing_your_code"><![CDATA[<p>There are many articles written about why testing is important and required to be able to build/deploy production-ready applications. For example, they might save your hours of debugging or easier to refactor saving your company millions, etc.</p>

<p>All These reasons are true however in my opinion there is one fundamental reason that is even more important. When you have to write a Unit Test it makes you rethink not just “I hope this code works with your fingers crossed “. It forces you to think about.</p>
<ol>
  <li>What will this method/function do?</li>
  <li>What is the expected input and output?</li>
  <li>What data type is the input?</li>
  <li>Is my code really dry and clean?</li>
  <li>Can this code be writeen better ?</li>
</ol>

<p><a href="https://imgur.com/YaxweYp"><img src="https://i.imgur.com/YaxweYpm.png" title="source: imgur.com" /></a></p>

<p>Because even if you never ever run these tests you have just accomplished alot just by answering these questions</p>

<p>The system is loading will be back soon …………</p>]]></content><author><name>Sim Greenbaum</name></author><summary type="html"><![CDATA[There are many articles written about why testing is important and required to be able to build/deploy production-ready applications. For example, they might save your hours of debugging or easier to refactor saving your company millions, etc. All These reasons are true however in my opinion there is one fundamental reason that is even more important. When you have to write a Unit Test it makes you rethink not just “I hope this code works with your fingers crossed “. It forces you to think about. What will this method/function do? What is the expected input and output? What data type is the input? Is my code really dry and clean? Can this code be writeen better ? Because even if you never ever run these tests you have just accomplished alot just by answering these questions The system is loading will be back soon …………]]></summary></entry><entry><title type="html">Truly understanding full-stack web development</title><link href="/truly_understanding_full-stack_web_development" rel="alternate" type="text/html" title="Truly understanding full-stack web development" /><published>2020-01-20T04:45:03+00:00</published><updated>2020-01-20T04:45:03+00:00</updated><id>/truly_understanding_full-stack_web_development</id><content type="html" xml:base="/truly_understanding_full-stack_web_development"><![CDATA[<p>I was asked to help build out functionality for a back-end developer so they could have a GUI  or graphical user interface.  This would enable non-technical employees to interact and update the DB.One point I made to the Project manager was that this “GUI” could live on the back-end server or it could be a file on a totally different server. The lesson I took from this before you start to code try to find out what will the production environment be ( many times this will change)</p>

<p>In the end, they chose to keep it all in one repo kind of like you will see in a Rails app. However, they wanted the option to be able to update multiple records on the same page without refreshing. This sounds like a great option for Javascripts AJAX or Fetch where we could access the server in the background and then update the Dom(no refresh).</p>

<pre><code class="language-javaScript">$(document).ready(function checkout() {
  $(".checkin").on("click", function (event) {
    event.preventDefault()
     let id = $(this).data("id");
    $.ajax({
      url: `/checkouts/${id}`,
      type: 'DELETE',
      dataType: 'json',
      success:
        () =&gt; {
          this.remove()
         $(`.status${id}`).html('&lt;p class="success-message"&gt;Thank you for checking in your book&lt;/p&gt;')
        }

    })
  });
})
</code></pre>

<p>This code is actually written in jquery which is a JS framework. Let’s go through this line by line,
The first line  makes sure our Javascript will only execute after the HTML has fully loaded.</p>

<p><code class="language-plaintext highlighter-rouge">$(document).ready(function checkout()</code></p>

<p>We then add an event listener to our button which will  execute an Ajax request to our Rest API if clicked.Then when the server sends a success respone we add that data to the DOM.</p>

<p><code class="language-plaintext highlighter-rouge">$(".checkin").on("click", function (event)</code></p>

<p><code class="language-plaintext highlighter-rouge">
$.ajax({
      url: `/checkouts/${id}`,
      type: 'DELETE',
      dataType: 'json',
			 success:
	</code></p>

<p>So even though this code is fairly simple it is essential to understand the exact steps needed especially when you will be working with a team or another developer. When the code isn’t working you need to be able to correctly problem solve which part of the code is not working.</p>

<p>All the best,
Simcha Greenbaum
www.simchagreenbaum.dev</p>]]></content><author><name>Sim Greenbaum</name></author><summary type="html"><![CDATA[I was asked to help build out functionality for a back-end developer so they could have a GUI or graphical user interface. This would enable non-technical employees to interact and update the DB.One point I made to the Project manager was that this “GUI” could live on the back-end server or it could be a file on a totally different server. The lesson I took from this before you start to code try to find out what will the production environment be ( many times this will change)]]></summary></entry><entry><title type="html">Is JS really the best programming language</title><link href="/is_js_really_the_best_programming_language" rel="alternate" type="text/html" title="Is JS really the best programming language" /><published>2020-01-12T03:52:48+00:00</published><updated>2020-01-12T03:52:48+00:00</updated><id>/is_js_really_the_best_programming_language</id><content type="html" xml:base="/is_js_really_the_best_programming_language"><![CDATA[<p>Well, I think the jury is still out on the one , only time will tell for sure. Javascript was created in 1995 by  Brendan Eich for Netscape Communications and has a very long history and I won’t bore you with all the details. What is important to know is javascript has become a language that is both Object-oriented and functional programming. This might make it more powerful but also harder to understand the many concepts behind the language.</p>

<p>## Prototypical inheritance vs class 
In Ruby, we create a class think of it like a blueprint and methods are different actions that the object can do. The only way to create an object is by creating an instinance of the class.</p>

<p>Our map</p>

<div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">class</span> <span class="nc">House</span>
  <span class="k">def</span> <span class="nf">initialize</span><span class="p">(</span><span class="nb">name</span><span class="p">)</span>
  <span class="k">end</span>
<span class="k">end</span>
</code></pre></div></div>

<p>Create the object
<code class="language-plaintext highlighter-rouge">House.new('gracie mansion')</code></p>

<p>However in javascript even though now we have classes they are very different a class is really a misnomer as it really is just a bunch of key-value pairs bundled together; we can just us the {} syntax.</p>

<p>In javascript you are creating an object that gets its prototype inherent from a prototype to think of is as a father-son relationship. It will form a link to the main object. See below how our house  <strong>proto</strong>  Object() meaning its prototype point to the javaScript Object(). This is really confusing at first but it is essential to understand the working of the language.</p>

<pre><code class="language-javaScript">let house = {house:'gracie mansion'}
{house: "gracie mansion"}
house: "gracie mansion"
__proto__:
constructor: ƒ Object()
__defineGetter__: ƒ __defineGetter__()
__defineSetter__: ƒ __defineSetter__()
hasOwnProperty: ƒ hasOwnProperty()
__lookupGetter__: ƒ __lookupGetter__()
__lookupSetter__: ƒ __lookupSetter__()
isPrototypeOf: ƒ isPrototypeOf()
propertyIsEnumerable: ƒ propertyIsEnumerable()
toString: ƒ toString()
valueOf: ƒ valueOf()
toLocaleString: ƒ toLocaleString()
get __proto__: ƒ __proto__()
set __proto__: ƒ __proto__()
</code></pre>

<p>All the best,</p>

<p>Simcha Greenbaum</p>

<p><a href="www.simchagreenbaum.dev">www.simchagreenbaum.dev</a>      </p>]]></content><author><name>Sim Greenbaum</name></author><summary type="html"><![CDATA[Well, I think the jury is still out on the one , only time will tell for sure. Javascript was created in 1995 by Brendan Eich for Netscape Communications and has a very long history and I won’t bore you with all the details. What is important to know is javascript has become a language that is both Object-oriented and functional programming. This might make it more powerful but also harder to understand the many concepts behind the language.]]></summary></entry><entry><title type="html">Top topics every developer should understand well.</title><link href="/top_topics_every_developer_should_understand_well" rel="alternate" type="text/html" title="Top topics every developer should understand well." /><published>2020-01-06T03:43:32+00:00</published><updated>2020-01-06T03:43:32+00:00</updated><id>/top_topics_every_developer_should_understand_well</id><content type="html" xml:base="/top_topics_every_developer_should_understand_well"><![CDATA[<p>What is authorization and authentication, why is it important and some ways they can be hacked?
Authentication is confirming you are who you claim to be, this is the typical login process. Where we match your  input username and password against the DB if  is correct
Authorization is when we know who you are, but what rights or access do you have to this system are you an admin with full access pass or maybe you only have read rights.</p>

<p>To give an example, imagine you try to go to a government security building. You come with your ticket and id to get it that is Authentication. The employee checks your ticket to see what permissions you have are your VIP, vendor, all-access. Where can you go, which floors can you access?  The employee gives you a neck badge to wear with your status that is your Authorization. The same process in with user credentials.</p>

<p><a href="https://imgur.com/l71uSt9"><img src="https://i.imgur.com/l71uSt9.png" title="source: imgur.com" /></a></p>

<p>The better you understand this, it will help you understand where and what a hacker will try to exploit.</p>
<ol>
  <li>SQL Injection.</li>
  <li>Phishing.</li>
  <li>Stealing cookie.</li>
  <li>Trying default / easy to guess usernames and passwords.</li>
  <li>Are the login page is in the HTTPS? What if the attacker tries to  inject a keylogger?</li>
  <li>Is the credentials sent over HTTPS? Man in the middle ?</li>
</ol>

<p>Stay tuned for more topics to come;  Is JS really the best programming language?Tech and Linkedin what are the benefits? Can your current background make you a better or worse developer?</p>

<p>All the best,</p>

<p>Simcha Greenbaum</p>

<p><a href="http://www.simchagreenbaum.dev">www.simchagreenbaum.dev</a></p>]]></content><author><name>Sim Greenbaum</name></author><summary type="html"><![CDATA[What is authorization and authentication, why is it important and some ways they can be hacked? Authentication is confirming you are who you claim to be, this is the typical login process. Where we match your input username and password against the DB if is correct Authorization is when we know who you are, but what rights or access do you have to this system are you an admin with full access pass or maybe you only have read rights.]]></summary></entry><entry><title type="html">Why is reviewing concepts so important?</title><link href="/why_is_reviewing_concepts_so_important" rel="alternate" type="text/html" title="Why is reviewing concepts so important?" /><published>2019-12-30T05:01:15+00:00</published><updated>2019-12-30T05:01:15+00:00</updated><id>/why_is_reviewing_concepts_so_important</id><content type="html" xml:base="/why_is_reviewing_concepts_so_important"><![CDATA[<p>As I am progressing in my learning and becoming more proficient in node.js. I took a step back and thought: “How well do I understand the core concepts of javascript?”</p>

<p>As I am progressing in my learning and becoming more proficient in node.js. I took a step back and thought: “How well do I understand the core concepts of javascript”? Then I realized I should go back and review flatirons updated V8 JS section and review all those concepts. (Lexical Scoping, block scope, Is JS really a OO language, how bugs are created with Var)</p>

<p>Is it really important to understand these concepts or maybe just knowing the syntax and what it will do should be fine? Well that is so far from the truth and I would say against one of my core principals . A good programmer knows what is code is trying to do, don’t just copy and paste from Stack overflow without learning it . Take the extra five min to read and understand your skills and knowledge will not just double. This will help you building good clean code and debugging when the code doesn’t behave like “you thought”.You need to condition your mind process and think differently.</p>

<p>When you have gotten your first job (which you will) keep in mind you will be thrown into a codebase that is huge and it will feel like you are taking a drink of water from a water hose. How to fight Imposter syndrome? Keep your head above and know that you have mad skills and strengths. Don’t let your weaknesses define who you are(we all have them).
 🙄🙄🙄 Make sure to work extra hard to up your skills and fix them.</p>

<p><a href="https://imgur.com/mLz7tan"><img src="https://i.imgur.com/mLz7tanl.jpg" title="source: imgur.com" /></a></p>

<p>All the best,</p>

<p>Simcha Greenbaum</p>

<p><a href="www.simchagreenbaum.dev">www.simchagreenbaum.dev</a></p>]]></content><author><name>Sim Greenbaum</name></author><summary type="html"><![CDATA[As I am progressing in my learning and becoming more proficient in node.js. I took a step back and thought: “How well do I understand the core concepts of javascript?”]]></summary></entry><entry><title type="html">Linkedin and Metadata</title><link href="/linkedin_and_metadata" rel="alternate" type="text/html" title="Linkedin and Metadata" /><published>2019-12-20T18:54:06+00:00</published><updated>2019-12-20T18:54:06+00:00</updated><id>/linkedin_and_metadata</id><content type="html" xml:base="/linkedin_and_metadata"><![CDATA[<p>Did you ever notice on Linkedin when you post a URL a cool preview picture shows up underneath? How does that work?</p>

<p>LinkedIn <a href="https://www.linkedin.com/help/linkedin/answer/46687/making-your-website-shareable-on-linkedin?lang=en">scrapes</a> all the metadata which is located inside the Head tag of the HTML document, If you just have a plain HTML CSS JS site then all you need to do is just add these lines of code</p>

<pre><code class="language-Html">&lt;meta property='og:title' content="Title of the article"/&gt;

&lt;meta property='og:image' content="//media.example.com/ 1234567.jpg"/&gt;

&lt;meta property='og:description' content="Description that will show in the preview"/&gt;

&lt;meta property='og:url' content="//www.example.com/URL of the article" /&gt;
</code></pre>

<p>LinkedIn uses the Open Graph protocol, the code that  is important so we can get  a preview image for our posts is ,</p>

<pre><code class="language-Html">&lt;meta property='og:image' content="//media.example.com/ 1234567.jpg"/&gt;
</code></pre>

<p>Og stands for Open Graph which creates an object from the metadata tags.It can have many different attributes like title or image check out the docs <a href="https://ogp.me/">here</a> . If you are not sure what the metadata of site will display LinkedIn has a great tool to <a href="https://www.linkedin.com/post-inspector/">inspect the output</a>. So just type in the URL you want to check, it will scrape that website’s Metadata and display it for you to see.</p>

<p><a href="https://imgur.com/A1hqSQB"><img src="https://i.imgur.com/A1hqSQB.png" title="source: imgur.com" /></a>
<a href="https://imgur.com/5xYtTor"><img src="https://i.imgur.com/5xYtTor.png" title="source: imgur.com" /></a></p>

<p>If you are using a framework like React or even Gatsby it is a little tricker. You have to figure out which folder your image content is stored. Additionally , make sure to find the root HTML it will be in a folder Public with a file name of  index.html. add the metadata tags there.</p>

<p>One piece of advice I would add, sometimes you change the website but LinkedIn has the old old metadata. A  good workaround is to use the inspector tool as this scrapes and guarantees that the metadata is accurate.</p>

<p>All the best,</p>

<p>Simcha Greenbaum</p>]]></content><author><name>Sim Greenbaum</name></author><summary type="html"><![CDATA[Did you ever notice on Linkedin when you post a URL a cool preview picture shows up underneath? How does that work?]]></summary></entry><entry><title type="html">What is Gatsby.js ?</title><link href="/what_is_gatsby_js" rel="alternate" type="text/html" title="What is Gatsby.js ?" /><published>2019-12-13T18:02:55+00:00</published><updated>2019-12-13T18:02:55+00:00</updated><id>/what_is_gatsby_js</id><content type="html" xml:base="/what_is_gatsby_js"><![CDATA[<p>Gatsby is based on React.js so if you have built any front-end site you will love it. But that is not just all it puts together so many of the great front-end tools like Webpack, React-router Graphql.</p>

<p>As a developer, we have seen so many new frameworks that are supposed to make your life easier but one of two things happen, either it makes it harder or their docs are horrible. You spend way to much time figuring out-there design than building what your really wanted. Gatsby has great docs and many different plugins setup will be so much easier.</p>

<p>Now let’s get talk about the most important point it extremely fast as it builds the page from all dynamic data and static data to a static website. For example, my <a href="http://www.simchagreenbaum.dev">portfolio</a>  page is pulling data from GitHub and displaying it to the page. Gatsby is taking that data and at build time creat it into a single HTML page with my static website. You can host the webpage even on servers that only will send back static pages as that is truly what you send to the client. From the user perspective, the browser just needs to load one page from one data point.</p>

<p>When you building your Gatsby site make sure to watch the server logs and if it fails to build you will get vital information to help you debug what is exactly wrong. One example you have the correct code on your side but the API it is querying failed, the webpage might not load at all. So if you are pulling data from an API that tends to be, well “not the greatest “  this might not be the best option.</p>

<p>As you can see my dev server ran the queries and built the  static page correctly without any  errors,</p>

<p><code class="language-plaintext highlighter-rouge">success building schema - 1.681s</code></p>

<p><code class="language-plaintext highlighter-rouge">success createPages - 0.009s</code></p>

<p><code class="language-plaintext highlighter-rouge">success run queries - 2.732s - 5/5 1.83/s</code></p>

<p><code class="language-plaintext highlighter-rouge">success Building development bundle - 25.463s</code></p>

<p>All the best,</p>

<p>Simcha Greenbaum</p>

<p>Check these out</p>

<p><a href="http://www.gatsbyjs.org/">Gatsby</a></p>

<p><a href="https://www.gatsbyjs.org/plugins/">Gatsby plugins</a></p>

<p><a href="https://www.mediacurrent.com/what-is-gatsby.js">More info</a></p>]]></content><author><name>Sim Greenbaum</name></author><summary type="html"><![CDATA[Gatsby is based on React.js so if you have built any front-end site you will love it. But that is not just all it puts together so many of the great front-end tools like Webpack, React-router Graphql.]]></summary></entry><entry><title type="html">Going to a PHP meetup as a Rubyist.</title><link href="/going_to_a_php_meetup_as_a_rubyist" rel="alternate" type="text/html" title="Going to a PHP meetup as a Rubyist." /><published>2019-12-08T21:48:27+00:00</published><updated>2019-12-08T21:48:27+00:00</updated><id>/going_to_a_php_meetup_as_a_rubyist</id><content type="html" xml:base="/going_to_a_php_meetup_as_a_rubyist"><![CDATA[<p>I have written many blogs about how you need to pick one language and learn it well. Don’t jump around and try to learn the newest coolest framework like react.js, vue.js, etc. or any of the newest popular and hottest things. You may be able to land your first job as you are up to date on the popular tech. However, your skills will be severely lacking as you have not built a good understanding and foundation in programming.</p>

<p>So then why did I go to a PHP meetup ? I don’t know anything about PHP except that half the URL’s out there are written in WordPress (aka PHP for dummies).</p>

<p>Well, meetups are a great place for networking and meeting people (some good food too) but in my opinion, you get to see the world from someone else’s perspective. How do they understand and use certain technologies? Do they struggle with the same things you do? In addition, if we all have the attitude I can learn something from everyone you will for sure pick-up something to excel and grow.</p>

<p>So I went in all scared and petrified that I don’t know the first thing about PHP. In the end, the meetup was about React and Gatsby two frameworks that I have used many times. Somehow I stood up and I asked a question about XSS scripting which turned into a whole lively group discussion. Which to say the very least the whole room enjoyed the interaction and the professionalism I brought to the table.</p>

<p>To summarize don’t just try to jump from language to language but you need to get out !! Go to meet-up’s even if it is not in your stack you never know what and how you can learn. Thanks to some great dev’s who pushed me to go and leave my comfort zone  – you know who you are.</p>

<p>All the best,</p>

<p>Simcha Greenbaum</p>]]></content><author><name>Sim Greenbaum</name></author><summary type="html"><![CDATA[I have written many blogs about how you need to pick one language and learn it well. Don’t jump around and try to learn the newest coolest framework like react.js, vue.js, etc. or any of the newest popular and hottest things. You may be able to land your first job as you are up to date on the popular tech. However, your skills will be severely lacking as you have not built a good understanding and foundation in programming.]]></summary></entry></feed>