<?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: Razvan Zamfir</title>
    <description>The latest articles on DEV Community by Razvan Zamfir (@zamfir80).</description>
    <link>https://dev.to/zamfir80</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%2F215713%2Fcbd9e622-c2db-481a-8875-2e387df361c8.png</url>
      <title>DEV Community: Razvan Zamfir</title>
      <link>https://dev.to/zamfir80</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zamfir80"/>
    <language>en</language>
    <item>
      <title>Longest Word JavaScript challenge</title>
      <dc:creator>Razvan Zamfir</dc:creator>
      <pubDate>Sat, 11 Feb 2023 13:41:25 +0000</pubDate>
      <link>https://dev.to/zamfir80/longest-word-javascript-challenge-2l8m</link>
      <guid>https://dev.to/zamfir80/longest-word-javascript-challenge-2l8m</guid>
      <description>&lt;p&gt;&lt;strong&gt;&lt;a href="https://coderbyte.com/" rel="noopener noreferrer"&gt;Coderbyte &lt;/a&gt;&lt;/strong&gt; has this challenge among the free ones:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Have the function LongestWord(sen) take the sen parameter being passed and return the longest word in the string. If there are two or more words that are the same length, return the first word from the string with that length. Ignore punctuation and assume sen will not be empty. Words may also contain numbers, for example "Hello world123 567".&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Here is my solution, with explanations in the form of  comments:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function LongestWord(sen) { 
  // An aray of words made up of letters only
  let cleanWords = [];

  let words = sen.split(' ');
  words.forEach(word =&amp;gt; {
    // Clean up the words and push them into "cleanWords"
    cleanWords.push(word.replace(/[^a-zA-Z0-9]/g, ''));
  });

  // Order by size
  let cleanWordsBySize = cleanWords.sort((a, b) =&amp;gt; b.length - a.length);

  // Get the first
  return cleanWordsBySize[0];
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It passed all the tests. :)&lt;/p&gt;

</description>
      <category>discuss</category>
    </item>
    <item>
      <title>Meet Brave CMS 2.0</title>
      <dc:creator>Razvan Zamfir</dc:creator>
      <pubDate>Sat, 11 Feb 2023 13:15:06 +0000</pubDate>
      <link>https://dev.to/zamfir80/meet-brave-cms-20-51c7</link>
      <guid>https://dev.to/zamfir80/meet-brave-cms-20-51c7</guid>
      <description>&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/Ajax30/BraveCMS-2.0" rel="noopener noreferrer"&gt;Brave CMS 2.0&lt;/a&gt;&lt;/strong&gt; is fresh out of the oven.&lt;/p&gt;

&lt;h3&gt;
  
  
  What it offers
&lt;/h3&gt;

&lt;p&gt;It offers UI/UX developers and designers the possibility easily turn their static templates into websites powered by &lt;em&gt;MySQL and Laravel&lt;/em&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  What makes it so great
&lt;/h3&gt;

&lt;p&gt;It is great for several reasons:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It's written in Laravel 8.&lt;/li&gt;
&lt;li&gt;It's scalable.&lt;/li&gt;
&lt;li&gt;The code is DRY and easy-to-follow, so contributors will have no headaches.&lt;/li&gt;
&lt;li&gt;The newsletter form is integrated with Mailchimp.&lt;/li&gt;
&lt;li&gt;It's Admin is designed with Bootstrap 5 SASS and very easy to customize.&lt;/li&gt;
&lt;li&gt;It is free (but patrons will be appreciated).&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Video demo
&lt;/h3&gt;

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

&lt;p&gt;It has an &lt;em&gt;easy-to-follow installation guide&lt;/em&gt; so try it out. It is free on GitHub. If you like it, give it a star. &lt;/p&gt;

</description>
      <category>gratitude</category>
      <category>motivation</category>
    </item>
    <item>
      <title>Meet Brave CMS</title>
      <dc:creator>Razvan Zamfir</dc:creator>
      <pubDate>Wed, 31 Mar 2021 09:18:49 +0000</pubDate>
      <link>https://dev.to/zamfir80/meet-brave-cms-4802</link>
      <guid>https://dev.to/zamfir80/meet-brave-cms-4802</guid>
      <description>&lt;p&gt;I have been working on this CMS and I am hoping that a lot of people will find it useful.&lt;/p&gt;

&lt;h3&gt;
  
  
  What it is
&lt;/h3&gt;

&lt;p&gt;It is an easy-to-use &lt;strong&gt;Content Management System&lt;/strong&gt; built with the good old LAMP stack. I have called it &lt;strong&gt;&lt;a href="https://github.com/Ajax30/Bravecms"&gt;Brave CMS&lt;/a&gt;&lt;/strong&gt; (link to Github repo).&lt;/p&gt;




&lt;h3&gt;
  
  
  Video demo
&lt;/h3&gt;

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

&lt;h3&gt;
  
  
  What it offers
&lt;/h3&gt;

&lt;p&gt;It offers UI/UX developers and designers the possibility to very easily turn their HTML templates into database-powered websites.&lt;/p&gt;

&lt;p&gt;I worked as a WordPress theme developer for quite a while and I have found turning an HTML template into a WordPress theme is time-consuming and tedious. &lt;/p&gt;

&lt;p&gt;It is why I came up with Brave CMS. You can turn an HTML template into a Brave CMS template in &lt;strong&gt;half the time&lt;/strong&gt; you would turn it into a WordPress theme.&lt;/p&gt;




&lt;h3&gt;
  
  
  Why is Brave CMS so easy to use?
&lt;/h3&gt;

&lt;p&gt;For these 3 reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Brave's themes are completely separated from the content manager.&lt;/li&gt;
&lt;li&gt;Every theme is comprised of its views (Twig files) and its assets. As you very likely already know, Twig has a very clean and clear syntax.&lt;/li&gt;
&lt;li&gt;The directory name of the active theme is stored in a variable named theme_directory. This variable is passed to the theme's master template file, &lt;code&gt;layout.twig&lt;/code&gt; (the value held by the &lt;code&gt;theme_directory&lt;/code&gt; variable is easy to change, from the &lt;code&gt;Static_model model&lt;/code&gt;).
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Why could the project use your help?
&lt;/h3&gt;

&lt;p&gt;I believe Brave CMS has the potential to replace WordPress one day, but it needs contributions from more developers (smarter than I am).&lt;/p&gt;

&lt;p&gt;So, if you know you are an outstanding PHP developer, feel free to contribute.&lt;/p&gt;

</description>
      <category>php</category>
      <category>cms</category>
      <category>codeigniter</category>
    </item>
    <item>
      <title>Awesome Online Newspaper CMS</title>
      <dc:creator>Razvan Zamfir</dc:creator>
      <pubDate>Mon, 12 Oct 2020 15:18:15 +0000</pubDate>
      <link>https://dev.to/zamfir80/yet-another-cms-j23</link>
      <guid>https://dev.to/zamfir80/yet-another-cms-j23</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MkmuMQl8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/ovh736dnl5zsudxvk18w.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MkmuMQl8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/ovh736dnl5zsudxvk18w.jpg" alt="Alt Text" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I've made an open-source &lt;strong&gt;&lt;a href="https://github.com/Ajax30/lightblog"&gt;online newspaper&lt;/a&gt;&lt;/strong&gt; application and I believe it is worth dedicating a bit of time to analyzing it.&lt;/p&gt;

&lt;p&gt;I am proud of it  but at the same time I realize it is not perfect. It is why I decided to write this short article with the main purpose of asking for constructive feedback.&lt;/p&gt;

&lt;h4&gt;
  
  
  A quick video demo of it in action
&lt;/h4&gt;

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

&lt;h2&gt;
  
  
  Technologies, frameworks
&lt;/h2&gt;

&lt;p&gt;The technologies used are PHP, MySQL, JavaScript, Codeigniter 3 and Bootstrap 4.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to use it
&lt;/h2&gt;

&lt;p&gt;The deployment/installation process is very simple (it is the main reason I chose to make it with Codeigniter 3): you write the database credentials in &lt;code&gt;application/config/database.php&lt;/code&gt;, then run the &lt;code&gt;Install&lt;/code&gt; controller which will create all the necessary tables.&lt;/p&gt;

&lt;p&gt;Then you register (after creating the necessary tables you are redirected to the account creation page) and... you are an author on your own online newspaper!&lt;/p&gt;

&lt;p&gt;The next authors who register need their accounts to be  &lt;em&gt;approved by you&lt;/em&gt;. In other words, you are the &lt;em&gt;editor-in-chief&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;You choose who you collaborate with, the first created author account is also the &lt;em&gt;admin account&lt;/em&gt;. You can test all that on a local (XAMPP, WAMP) server.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I already know is not so great about it
&lt;/h2&gt;

&lt;p&gt;It does not have a very clear separation between the Admin and the Frontend. I wish I could find a way to introduce &lt;em&gt;themes&lt;/em&gt; for the Frontend.&lt;/p&gt;

&lt;h2&gt;
  
  
  If you like it
&lt;/h2&gt;

&lt;p&gt;If you are a PHP professional  and want to get involved in any way that's useful, please do.&lt;/p&gt;

</description>
      <category>cms</category>
      <category>php</category>
      <category>mysql</category>
      <category>bootstrap</category>
    </item>
    <item>
      <title>The perfect way to check for a palindrome, in JavaScript</title>
      <dc:creator>Razvan Zamfir</dc:creator>
      <pubDate>Sun, 20 Sep 2020 09:34:44 +0000</pubDate>
      <link>https://dev.to/zamfir80/the-perfect-way-to-check-for-a-palindrome-in-javascript-3bd3</link>
      <guid>https://dev.to/zamfir80/the-perfect-way-to-check-for-a-palindrome-in-javascript-3bd3</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TH6VbZm5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/fvh1zsp7uaj2z0m04e6y.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TH6VbZm5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/fvh1zsp7uaj2z0m04e6y.jpg" alt="Alt Text" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First, let's clarify what a palindrome is.&lt;/p&gt;

&lt;p&gt;According to Wikipedia "a palindrome is a word, number, phrase, or other sequence of characters which reads the same backward as forward".&lt;/p&gt;

&lt;p&gt;In the above definition, the word "reads" is key: a phrase like "Red rum, sir, is murder" is &lt;em&gt;read&lt;/em&gt;, not written the same backward as forward. That is because of the &lt;em&gt;punctuation&lt;/em&gt; and &lt;em&gt;case&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;The above is a clue for what the first two steps we need to take are: &lt;em&gt;eliminate punctuation and spaces&lt;/em&gt; and &lt;em&gt;force lower case&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;After that, we can proceed with getting &lt;em&gt;comparing the string to check with its reverse&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;The function looks like this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; const isPalindrome = (str) =&amp;gt; {
  // Force to string
  // Eliminate punctuation and spaces
  // Force lower case
  // Split
  let arr = str.toString().replace(/[^A-Za-z0-9_]/g, "").toLowerCase().split('');

  // Join into one word
  let joined = arr.join('');

  // Reverse and join into one word
  let reverseJoined = arr.reverse().join('');

  //compare
  return joined == reverseJoined;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;After making sure our expression-to-check is a string, we use &lt;code&gt;str.replace(/[^A-Za-z0-9_]/g, "")&lt;/code&gt; to eliminate punctuation and spaces and force lowercase with &lt;code&gt;toLowerCase()&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;We need to make an array from the resulted string, so that we get the reverse of the string by reversing the array and then joining it into a string. This is the "original" array:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let arr = str.toString().replace(/[^A-Za-z0-9_]/g, "").toLowerCase().split('');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The "original", lower case, no spaces, no punctuation string:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let joined = arr.join('');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The &lt;em&gt;reversed&lt;/em&gt; string:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let reverseJoined = arr.reverse().join('');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Finally, the comparaison, that returns a Boolean:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;return joined == reverseJoined;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;And with that we are done making a palindrome checker that works for words and phrases too. You can see it in action &lt;strong&gt;&lt;a&gt;here&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>palindrome</category>
    </item>
  </channel>
</rss>
