<?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: Richard Dobroň</title>
    <description>The latest articles on DEV Community by Richard Dobroň (@dobron).</description>
    <link>https://dev.to/dobron</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%2F353560%2F75615fa7-0269-4373-913b-eeb5e1e7d4a9.jpg</url>
      <title>DEV Community: Richard Dobroň</title>
      <link>https://dev.to/dobron</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dobron"/>
    <language>en</language>
    <item>
      <title>You've Never Heard Of These 10 Bizarre Programming Languages</title>
      <dc:creator>Richard Dobroň</dc:creator>
      <pubDate>Sun, 14 Aug 2022 12:07:00 +0000</pubDate>
      <link>https://dev.to/dobron/youve-never-heard-of-these-10-bizarre-programming-languages-59b2</link>
      <guid>https://dev.to/dobron/youve-never-heard-of-these-10-bizarre-programming-languages-59b2</guid>
      <description>&lt;h2&gt;
  
  
  1. Whitespace
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;This program uses whitespace characters as syntax. This implies that only linefeeds, spaces as well as tabs have meanings. Unlike other programming languages, it ignores the non whitespace characters.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/Whitespace_(programming_language)"&gt;Wikipedia&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Here’s an example of a “Hello, world!” in Whitespace:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hello,[Space]world![Space][Space][Tab][Space][Space][Tab][Space][Space][Space][LF]
[Tab][LF][Space][Space]
[Space][Space][Space][Tab][Tab][Space][Space][Tab][Space][Tab][LF]
[Tab][LF][Space][Space]
[Space][Space][Space][Tab][Tab][Space][Tab][Tab][Space][Space][LF]
[Tab][LF][Space][Space]
[Space][Space][Space][Tab][Tab][Space][Tab][Tab][Space][Space][LF]
[Tab][LF][Space][Space]
[Space][Space][Space][Tab][Tab][Space][Tab][Tab][Tab][Tab][LF]
[Tab][LF][Space][Space]
[Space][Space][Space][Tab][Space][Tab][Tab][Space][Space][LF]
[Tab][LF][Space][Space]
[Space][Space][Space][Tab][Space][Space][Space][Space][Space][LF]
[Tab][LF][Space][Space]
[Space][Space][Space][Tab][Tab][Tab][Space][Tab][Tab][Tab][LF]
[Tab][LF][Space][Space]
[Space][Space][Space][Tab][Tab][Space][Tab][Tab][Tab][Tab][LF]
[Tab][LF][Space][Space]
[Space][Space][Space][Tab][Tab][Tab][Space][Space][Tab][Space][LF]
[Tab][LF][Space][Space]
[Space][Space][Space][Tab][Tab][Space][Tab][Tab][Space][Space][LF]
[Tab][LF][Space][Space]
[Space][Space][Space][Tab][Tab][Space][Space][Tab][Space][Space][LF]
[Tab][LF][Space][Space]
[LF][LF][LF]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. Ook!
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Ook! is a programming language designed for orang-utans. Ook! is essentially isomorphic to the well-known esoteric language BrainF***, but has even fewer syntax elements.&lt;br&gt;
For a few examples of commands, check out this &lt;a href="https://www.dangermouse.net/esoteric/ook.html"&gt;article&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Here’s the “Hello World” program written in Ook!:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook.
Ook! Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook?
Ook! Ook! Ook? Ook! Ook? Ook. Ook. Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook! Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook.
Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook.
Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook! Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook.
Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook!
Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook! Ook.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. ArnoldC
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Programming language based on the one-liners of Arnold Schwarzenegger.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/lhartikk/ArnoldC"&gt;Source code&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;The following program displays “Hello World”:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;IT'S SHOWTIME
TALK TO THE HAND "Hello World"
YOU HAVE BEEN TERMINATED
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Shakespeare
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Programming language and Shakespearean language should never meet, but that did not stop Jon Åslund and Karl Hasselström from creating the SPL (Shakespeare Programming Language). It makes the source code look like a script from one of the author’s plays, and the result looks something like &lt;a href="http://shakespearelang.sourceforge.net/report/shakespeare/"&gt;this&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/Shakespeare_Programming_Language"&gt;Wikipedia&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;The standard "Hello, World!" program:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Do Not Adieu, a play in two acts.

Romeo, a young man with a remarkable patience.
Juliet, a likewise young woman of remarkable grace.
Ophelia, a remarkable woman much in dispute with Hamlet.
Hamlet, the flatterer of Andersen Insulting A/S.


                    Act I: Hamlet's insults and flattery.

                    Scene I: The insulting of Romeo.

[Enter Hamlet and Romeo]

Hamlet:
 You lying stupid fatherless big smelly half-witted coward!
 You are as stupid as the difference between a handsome rich brave
 hero and thyself! Speak your mind!

 You are as brave as the sum of your fat little stuffed misused dusty
 old rotten codpiece and a beautiful fair warm peaceful sunny summer's
 day. You are as healthy as the difference between the sum of the
 sweetest reddest rose and my father and yourself! Speak your mind!

 You are as cowardly as the sum of yourself and the difference
 between a big mighty proud kingdom and a horse. Speak your mind.

 Speak your mind!

[Exit Romeo]

                    Scene II: The praising of Juliet.

[Enter Juliet]

Hamlet:
 Thou art as sweet as the sum of the sum of Romeo and his horse and his
 black cat! Speak thy mind!

[Exit Juliet]

                    Scene III: The praising of Ophelia.

[Enter Ophelia]

Hamlet:

 Thou art as beautiful as the difference between Romeo and the square
 of a huge green peaceful tree. Speak thy mind!

 Thou art as lovely as the product of a large rural town and my amazing
 bottomless embroidered purse. Speak thy mind!

 Thou art as loving as the product of the bluest clearest sweetest sky
 and the sum of a squirrel and a white horse. Thou art as beautiful as
 the difference between Juliet and thyself. Speak thy mind!

[Exeunt Ophelia and Hamlet]


                    Act II: Behind Hamlet's back.

                    Scene I: Romeo and Juliet's conversation.

[Enter Romeo and Juliet]

Romeo:
 Speak your mind. You are as worried as the sum of yourself and the
 difference between my small smooth hamster and my nose. Speak your
 mind!

Juliet:
 Speak YOUR mind! You are as bad as Hamlet! You are as small as the
 difference between the square of the difference between my little pony
 and your big hairy hound and the cube of your sorry little
 codpiece. Speak your mind!

[Exit Romeo]

                    Scene II: Juliet and Ophelia's conversation.

[Enter Ophelia]

Juliet:
 Thou art as good as the quotient between Romeo and the sum of a small
 furry animal and a leech. Speak your mind!

Ophelia:
 Thou art as disgusting as the quotient between Romeo and twice the
 difference between a mistletoe and an oozing infected blister! Speak
 your mind!

[Exeunt]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. Velato
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Velato is a programming language, created by Daniel Temkin in 2009, which uses MIDI files as source code: the pattern of notes determines commands. Velato offers an unusual challenge to programmer-musicians: to compose a musical piece that, in addition to expressing their aims musically, fills the constraints necessary to compile to a working Velato program. Each song has a secret message: the program it determines when compiled as Velato.&lt;/li&gt;
&lt;li&gt;The following program displays “Hello World!”:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;\version "2.19.64"

\header{
  title = "Hello, World!"
}

\language "english"

\paper {
  top-margin = 1.5\in
  left-margin = 2.0\in
  right-margin = 2.0\in
}

\score {
  \transpose c c' {
    % H
    &amp;lt;c a&amp;gt;4
    g8
    e8 f8
    gs8 d8
    g8 |

    % e
    a8
    &amp;lt;g e&amp;gt;4.
    &amp;lt;f cs&amp;gt;4
    c16 cs16
    g8 |

    % l
    a8
    &amp;lt;g e&amp;gt;8
    &amp;lt;f cs&amp;gt;4
    &amp;lt;c a&amp;gt;4
    g4 |

    % l
    a16 g16
    e16 f8
    cs8. &amp;lt;c a g&amp;gt;2 |

    % o
    a8 g8 e8
    f8.
    cs16 cs8 cs8 g8 |

    % ,
    a8 g4
    e8 f8
    e e
    g8 |

    % space
    a8
    &amp;lt;g e&amp;gt;4.
    f8
    ds d
    g8 |

    % W
    a8 g4
    e8 f8
    a8 gs8
    g8 |

    % o
    a8 g8
    e8 f8
    cs8 cs8 &amp;lt;cs g&amp;gt;4 |

    % r
    a8 g8
    e8 f8
    cs8 cs8 e8. g16 |

    % l
    c16 a16
    &amp;lt;g e&amp;gt;8
    &amp;lt;f cs&amp;gt;4
    &amp;lt;c a&amp;gt;4
    g4 |

    % d
    a8 g4
    e16 f16
    cs8 c8 c8
    g8 |

    % !
    a16
    &amp;lt;g e&amp;gt;4
    f16 ds16 ds16
    &amp;lt;g c&amp;gt;2 |
  }
  \layout {
    indent = 0\cm
  }
  \midi {
    \tempo 4 = 120
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  6. Brainfuck
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;This language has inspired many other bizarre computer languages. It was created in 1993 by Urban Miller. He designed this language with smallest possible complier, which is even less than 200 bytes. It uses just eight commands to run a program, however the sequence of commands requires to run the program is simply too much and is not practical for normal use.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/Brainfuck"&gt;Wikipedia&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The following program prints “Hello World!” and a newline to the screen:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;++++++++[&amp;gt;++++[&amp;gt;++&amp;gt;+++&amp;gt;+++&amp;gt;+&amp;lt;&amp;lt;&amp;lt;&amp;lt;-]&amp;gt;+&amp;gt;+&amp;gt;-&amp;gt;&amp;gt;+[&amp;lt;]&amp;lt;-]&amp;gt;&amp;gt;.&amp;gt;---.+++++++..+++.&amp;gt;&amp;gt;.&amp;lt;-.&amp;lt;.+++.------.--------.&amp;gt;&amp;gt;+.&amp;gt;++.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  7. Malbolge
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Malbolge is a public domain esoteric programming language invented by Ben Olmstead in 1998, named after the eighth circle of hell in Dante's Inferno, the Malebolge.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/Malbolge"&gt;Wikipedia&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;The following program prints “Hello World”:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(=&amp;lt;`#9]~6ZY32Vx/4Rs+0No-&amp;amp;Jk)"Fh}|Bcy?`=*z]Kw%oG4UUS0/@-ejc(:'8d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  8. Chicken
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Chicken is an esoteric programming language by Torbjörn Söderstedt, in which "chicken" is the only valid symbol.&lt;/li&gt;
&lt;li&gt;Here’s the “Hello World” program written in Chicken.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken
chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken

chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken

chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken
chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken

chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken

chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  9. LOLcode
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;LOLcode is an esoteric programming language inspired by lolspeak, the language expressed in examples of the lolcat Internet meme. The language was created in 2007 by Adam Lindsay, researcher at the Computing Department of Lancaster University.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/LOLCODE"&gt;Wikipedia&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Here’s the “Hello World” program written in LOLcode:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HAI 1.2
CAN HAS STDIO?
VISIBLE "Hello World"
KTHXBYE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  10. JSFuck
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Developed by Martin Kleppe, JSFuck is an esoteric programming style of JavaScript. where code is written using a very limited set of characters: (,), [, ], + and !.The challenge in JSFuck lies in recreating the full set of JavaScript functions using only these six characters, which is made possible by two properties of JavaScript:&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;It is a weakly typed programming language&lt;/li&gt;
&lt;li&gt;It allows the evaluation of any expression as any type.&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/aemkei/jsfuck"&gt;Source code&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;JSFuck code is extremely "verbose": In JavaScript, the code alert("Hello World!"), which causes a pop-up window to open with the text "Hello world", is 21 characters long. In JSFuck, the same code has a length of 3344 characters:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[][(![]+[])[+!![]]+(!![]+[])[+[]]][([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+(+[![]]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+!![]]]+(![]+[])[+!![]]+(![]+[])[!![]+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]])()([][(![]+[])[+!![]]+(!![]+[])[+[]]][([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+(+[![]]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+!![]]]+([]+[][(!![]+[])[!![]+!![]+!![]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([![]]+[][[]])[+!![]+[+[]]]+(!![]+[])[!![]+!![]+!![]]+(![]+[])[!![]+!![]+!![]]]())[!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+(![]+[])[+!![]])()(!![])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+(+[![]]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+!![]]]+(+[![]]+[][(![]+[])[+!![]]+(!![]+[])[+[]]][([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+(+[![]]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+!![]]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[!![]+!![]+!![]]+(![]+[])[!![]+!![]]+(![]+[])[+[]])())[+!![]+[+!![]]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+(!![]+[])[+!![]]+(![]+[])[!![]+!![]]+([][[]]+[])[!![]+!![]]+[][(![]+[])[+!![]]+(!![]+[])[+[]]][([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+(+[![]]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+!![]]]+(![]+[])[+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+([]+[][(!![]+[])[!![]+!![]+!![]]+([][[]]+[])[+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([![]]+[][[]])[+!![]+[+[]]]+(!![]+[])[!![]+!![]+!![]]+(![]+[])[!![]+!![]+!![]]]())[!![]+!![]])()((+(+!![]+(!![]+[])[!![]+!![]+!![]]+(+!![])+(+[])+(+[])+(+[]))+[])[+[]]+![])[+[]])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>How to create your first composer package? 🐘</title>
      <dc:creator>Richard Dobroň</dc:creator>
      <pubDate>Mon, 08 Aug 2022 20:43:00 +0000</pubDate>
      <link>https://dev.to/dobron/how-to-create-your-first-composer-package-1bka</link>
      <guid>https://dev.to/dobron/how-to-create-your-first-composer-package-1bka</guid>
      <description>&lt;h2&gt;
  
  
  What is Composer?
&lt;/h2&gt;

&lt;p&gt;Composer is a package manager for PHP. As with npm for Node.js and bundler for Ruby, it fills a similar role. It uses a JSON file to capture metadata about the project and the project’s dependencies.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Packagist?
&lt;/h2&gt;

&lt;p&gt;Packagist is a centralized Composer repository where anyone can register packages. It aggregates public PHP packages installable with Composer. Packagist currently contains almost 350,000 packages.&lt;/p&gt;

&lt;h2&gt;
  
  
  Don't have an account?
&lt;/h2&gt;

&lt;p&gt;Navigate to &lt;a href="https://packagist.org"&gt;packagist.org&lt;/a&gt; and click Create account.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Create a project
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Create a folder named &lt;code&gt;nullthrows&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir nullthrows
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. Initialize project as composer package
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;In this process, you will be asked a number of questions such as the package name, name of the author, the description, minimum stability, the license, etc.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cY6ESKsN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hb9fkai6wgsoyibmlciu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cY6ESKsN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hb9fkai6wgsoyibmlciu.png" alt="CLI process" width="864" height="276"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This process will generate a composer.json file.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Create a file named &lt;code&gt;nullthrows.php&lt;/code&gt; with this content in &lt;code&gt;src&lt;/code&gt; folder:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php

/**
 * @param mixed $value
 * @param string $message
 *
 * @return mixed
 * @throws Exception
 */
function nullthrows($value, string $message = null) {
    if ($value !== null) {
        return $value;
    }

    throw new Exception($message ?: 'Got unexpected null value.');
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Add files under autoload in composer.json
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "name": "dobron/nullthrows",
    "autoload": {
        "files": [
            "src/nullthrows.php"
        ],
        "psr-4": {
            "dobron\\": "src/"
        }
    },
    "authors": [
        {
            "name": "Richard Dobroň"
        }
    ],
    "require": {}
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. Create a README.md (optional)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;You should provide a brief description of the repository and its functions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  6. Commit the code to GitHub repository
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin git@github.com:yourUsername/nullthrows.git
git push -u origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  7. Submit package
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://packagist.org/packages/submit"&gt;https://packagist.org/packages/submit&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uFYymjl---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5t31i3f883s6z21ezrxv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uFYymjl---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5t31i3f883s6z21ezrxv.png" alt="Packagist package submit" width="722" height="643"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  You Did It!
&lt;/h2&gt;

&lt;p&gt;Congratulations, you have published your first Composer package!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to create your first npm package? 🧰</title>
      <dc:creator>Richard Dobroň</dc:creator>
      <pubDate>Sun, 07 Aug 2022 17:37:00 +0000</pubDate>
      <link>https://dev.to/dobron/how-to-create-your-first-npm-package-3ohm</link>
      <guid>https://dev.to/dobron/how-to-create-your-first-npm-package-3ohm</guid>
      <description>&lt;h2&gt;
  
  
  What is NPM
&lt;/h2&gt;

&lt;p&gt;NPM stands for &lt;strong&gt;N&lt;/strong&gt;ode &lt;strong&gt;P&lt;/strong&gt;ackage &lt;strong&gt;M&lt;/strong&gt;anager and is the default JavaScript package manager powered by &lt;em&gt;Node.js&lt;/em&gt;. The npm manager has two parts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CLI&lt;/strong&gt; (&lt;em&gt;Command Line Interface&lt;/em&gt;) — a tool for publishing and downloading packages,&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.npmjs.com"&gt;online repositories&lt;/a&gt; containing over 2 million JavaScript packages.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Don't have an account?
&lt;/h2&gt;

&lt;p&gt;Navigate to &lt;a href="https://www.npmjs.com"&gt;npmjs.com&lt;/a&gt; and click sign up.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Create an npm project
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Create a folder named &lt;code&gt;arraySort&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir arraySort
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. Initialize project as npm package
&lt;/h2&gt;

&lt;h3&gt;
  
  
  a) Using npm init -y or -yes
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;This process will automatically generate a &lt;code&gt;package.json&lt;/code&gt; file with default options.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm init -y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sfyYR8tN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4o2bx5btm5ju7ezsfylg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sfyYR8tN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4o2bx5btm5ju7ezsfylg.png" alt="CLI process" width="700" height="378"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  b) Using npm init
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;In this process, you will be asked a number of questions such as the name of the author, the description, and the license, etc.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Fpg8Z6R_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rmv6ikhlo3mhkzzujxiz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Fpg8Z6R_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rmv6ikhlo3mhkzzujxiz.png" alt="CLI process" width="880" height="287"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Create a file named &lt;code&gt;index.js&lt;/code&gt; with this content:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function arraySort(array, compareFunction) {
    const cloned = array.slice();
    if (compareFunction) {
        return cloned.sort(compareFunction);
    }

    return cloned.sort();
}

module.exports = arraySort;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Create a README.md (optional)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;You should provide a brief description of the repository and its functions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  5. Login into NPM
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  6. Publish the package
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm publish
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  You Did It!
&lt;/h2&gt;

&lt;p&gt;Congratulations, you have published your first NPM package!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to fix Gmail login in your application?</title>
      <dc:creator>Richard Dobroň</dc:creator>
      <pubDate>Sun, 31 Jul 2022 10:56:00 +0000</pubDate>
      <link>https://dev.to/dobron/how-to-fix-gmail-login-in-your-application-2nhj</link>
      <guid>https://dev.to/dobron/how-to-fix-gmail-login-in-your-application-2nhj</guid>
      <description>&lt;p&gt;Google has announced that some accounts will no longer be able to use Less Secure Apps feature, starting May 30th, 2022.&lt;/p&gt;

&lt;p&gt;Your application will contain an error similar to this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Uncaught Exception: Cannot connect to Gmail: Can not authenticate to IMAP server: [AUTHENTICATIONFAILED] Invalid credentials (Failure) in /home/secret/public_html/mailer/smtp.php:208&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  What are Less Secure Apps in Gmail?
&lt;/h1&gt;

&lt;p&gt;With &lt;em&gt;Less Secure Apps&lt;/em&gt; feature, you can use your main Google username and password to sign in to your Gmail account on software and devices.&lt;/p&gt;

&lt;h1&gt;
  
  
  Fix using an App Password
&lt;/h1&gt;

&lt;p&gt;To use an app password, you must first &lt;a href="https://support.google.com/accounts/answer/185839"&gt;turn on two-factor authentication for your Google account&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kN6vpyon--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.devdojo.com/images/july2022/security-2fac.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kN6vpyon--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.devdojo.com/images/july2022/security-2fac.png" alt="security-2fac.png" width="851" height="321"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that, in your Google account's security settings, you can set an &lt;a href="https://myaccount.google.com/u/0/apppasswords"&gt;app-specific password&lt;/a&gt; for SMTP.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kkdgSMU3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.devdojo.com/images/july2022/app-passwords.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kkdgSMU3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.devdojo.com/images/july2022/app-passwords.png" alt="app-passwords.png" width="699" height="492"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then type the name of the application that will help you identify this password.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gw9fzeU4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.devdojo.com/images/july2022/app-passwords2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gw9fzeU4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.devdojo.com/images/july2022/app-passwords2.png" alt="app-passwords2.png" width="687" height="387"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your password will be generated after clicking the Generate button.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jVcFMj_V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.devdojo.com/images/july2022/app-passwords3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jVcFMj_V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.devdojo.com/images/july2022/app-passwords3.png" alt="app-passwords3.png" width="654" height="475"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And that's it, now just use this new password to log in.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to add Prettier code formatter to your project?</title>
      <dc:creator>Richard Dobroň</dc:creator>
      <pubDate>Thu, 28 Jul 2022 14:59:00 +0000</pubDate>
      <link>https://dev.to/dobron/how-to-add-prettier-code-formatter-to-your-project-5coh</link>
      <guid>https://dev.to/dobron/how-to-add-prettier-code-formatter-to-your-project-5coh</guid>
      <description>&lt;p&gt;You can use Prettier to make your code more readable and consistent with your style guide. There are several ways to start &lt;strong&gt;Prettier&lt;/strong&gt; automatically, these are the most popular when using Git:&lt;/p&gt;

&lt;h2&gt;
  
  
  1. pretty-quick
&lt;/h2&gt;

&lt;p&gt;Use library &lt;em&gt;pretty-quick&lt;/em&gt; to format your changed or staged files.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx husky-init
npm install --save-dev pretty-quick
npx husky set .husky/pre-commit "npx pretty-quick --staged"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. Shell script
&lt;/h2&gt;

&lt;p&gt;Save this script as &lt;code&gt;.git/hooks/pre-commit&lt;/code&gt; and give it execute permission:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/sh
FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g')
[ -z "$FILES" ] &amp;amp;&amp;amp; exit 0

# Prettify all selected files
echo "$FILES" | xargs ./node_modules/.bin/prettier --ignore-unknown --write

# Add back the modified/prettified files to staging
echo "$FILES" | xargs git add

exit 0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If git is reporting that your prettified files are still modified after committing, you may need to add a &lt;a href="https://github.com/prettier/prettier/issues/2978#issuecomment-334408427"&gt;post-commit script to update git’s index&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Add something like the following to &lt;code&gt;.git/hooks/post-commit&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/sh
git update-index -g
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Configure rules
&lt;/h2&gt;

&lt;p&gt;Create a &lt;code&gt;*.prettierrc&lt;/code&gt; file at the root of your project to configure your prettier rules.&lt;/p&gt;

&lt;p&gt;Here's an example file containing some popular rules:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "semi": true",
  "trailingComma": "all",
  "singleQuote": true,
  "printWidth": 70,
  "arrowParens": "always",
  "tabWidth": 2
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For everything you don't want to format, create a &lt;em&gt;.prettierignore&lt;/em&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node_modules/
package.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Manual Run &amp;amp; Fix
&lt;/h2&gt;

&lt;p&gt;To manual run via CLI, add a command to &lt;em&gt;package.json&lt;/em&gt; and run &lt;code&gt;npm run format&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
 "scripts": {
  "format": "prettier --write ."
 }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>tutorial</category>
      <category>javascript</category>
      <category>css</category>
      <category>cli</category>
    </item>
    <item>
      <title>300 beautiful pure CSS loaders</title>
      <dc:creator>Richard Dobroň</dc:creator>
      <pubDate>Sat, 16 Jul 2022 10:52:24 +0000</pubDate>
      <link>https://dev.to/dobron/300-beautiful-pure-css-loaders-4o00</link>
      <guid>https://dev.to/dobron/300-beautiful-pure-css-loaders-4o00</guid>
      <description>&lt;p&gt;As we navigate through websites and apps, we might sometimes wait for some progress or for something to load. A loader or spinner can be used in such cases to indicate to users that something is loading.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cssloaders.github.io"&gt;Open cssloaders.github.io&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Just click on the specific loader that you want to use in your application and a dialog box with the source code will appear.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--V4xZvxGU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ngu5tws410yspwucbqt1.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--V4xZvxGU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ngu5tws410yspwucbqt1.gif" alt="Loader source code" width="606" height="652"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A huge advantage is also the fact that it is possible to translate the displayed loading text very easily and not spoil the impression of the animation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1K4kHRJe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4n4okgfrgv53tu62cggp.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1K4kHRJe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4n4okgfrgv53tu62cggp.gif" alt="English version" width="880" height="336"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vyegWaFp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4b5idtefva53z3vm4evd.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vyegWaFp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4b5idtefva53z3vm4evd.gif" alt="Translated vesion" width="880" height="337"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Localizing PHP application with FBT instead of standard i18n</title>
      <dc:creator>Richard Dobroň</dc:creator>
      <pubDate>Fri, 15 Jul 2022 18:03:14 +0000</pubDate>
      <link>https://dev.to/dobron/localizing-php-application-with-fbt-instead-of-standard-i18n-3jn8</link>
      <guid>https://dev.to/dobron/localizing-php-application-with-fbt-instead-of-standard-i18n-3jn8</guid>
      <description>&lt;p&gt;Since about 2010, I have been looking for a translation framework for PHP that can generate very complex phrases and at the same time combine options such as singular/plural and work with genders (male, female, unknown) and ideally also format numbers according to the standards of the given country or region — unsuccessfully. In 2018, Facebook released FBT — an open source localization framework that provides a more efficient way of defining content for flexible and high-quality localization. I didn’t hesitate at all. I gradually started to rewrite this JavaScript version into PHP, and even if a few small things were not entirely according to the original code, I succeeded. It was my challenge that I finished in about 40 days (better said, evenings 😊).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.facebook.com/watch/?ref=external&amp;amp;v=2270332766518020"&gt;FBT Preview at F8&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.facebook.com/watch/?ref=external&amp;amp;v=2270332766518020"&gt;FBT repository for PHP 7.0+&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/richardDobron/laravel-fbt"&gt;FBT repository for Laravel 5.5+&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are many reasons why the common i18n libraries are very inadequate. The main ones are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;misunderstanding of the native text by the translator (does not know the context),&lt;/li&gt;
&lt;li&gt;insufficient/nonsensical code combinations for translation,&lt;/li&gt;
&lt;li&gt;do not support features like enums or pronouns,&lt;/li&gt;
&lt;li&gt;and many more…&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Fortunately, FBT can solve all of this. However, it is not easy to use it for the first time when you are not familiar with it. But I will be happy to advise you on how to use it.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Install the FBT package
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer require richarddobron/fbt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  2. Set your FBT configuration
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
require ("vendor/autoload.php");

\fbt\FbtConfig::set('author', 'your name/team');
\fbt\FbtConfig::set('project', 'project name');
\fbt\FbtConfig::set('path', '/path/to/storage/fbt');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  3. Language and gender settings
&lt;/h3&gt;

&lt;p&gt;If you just want to change the interface language, just use:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;\fbt\FbtHooks::locale('sk_SK'); // app locale
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;If you have an application in which users log in, you can use the interface &lt;strong&gt;IntlViewerContextInterface&lt;/strong&gt;:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;After implementation, set &lt;strong&gt;viewerContext&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$loggedUserDto = ...;
\fbt\FbtConfig::set('viewerContext', $loggedUserDto);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  4. Prepare translations files
&lt;/h3&gt;

&lt;p&gt;Facebook has devised their own system of labeling languages, you can find a list of them at this &lt;a href="https://github.com/richardDobron/fbt/blob/main/docs/locales.md"&gt;link&lt;/a&gt;.&lt;br&gt;
From this list, choose the languages into which you want to translate your website or application.&lt;br&gt;
I usually add them to the directory &lt;strong&gt;/storage/fbt/&lt;/strong&gt;&lt;br&gt;
File name will look like this: &lt;strong&gt;sk_SK.json&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  5. Add FBT scripts to &lt;em&gt;composer.json&lt;/em&gt;
&lt;/h3&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Native phrases can also be easily translated via the app editor &lt;strong&gt;&lt;a href="https://translations.swiftyper.sk"&gt;Swiftyper Translations&lt;/a&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  6. Add your texts
&lt;/h3&gt;

&lt;p&gt;Native phrases are always expected in &lt;strong&gt;English&lt;/strong&gt;, it might look something like this:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h3&gt;
  
  
  7. Translate collected texts
&lt;/h3&gt;

&lt;p&gt;This is what the collected source strings look like in the &lt;em&gt;.source_strings.json&lt;/em&gt; file after script execution:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Now we are ready to generate a file in which we will write the translations for the collected source strings:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer run generate-translations
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The &lt;em&gt;/storage/fbt/sk_SK.json&lt;/em&gt; file now contains the hash keys of the source phrases that we can now translate. I make translations into Slovak, so I can use the gender of the &lt;strong&gt;{name}&lt;/strong&gt; token and adapt the variations of the given text precisely. This step is a bit difficult for some translations with variants, as you have to work with the variations key.&lt;br&gt;
You can also find several types of translations at this &lt;a href="https://github.com/richardDobron/fbt/blob/main/tests/translations/data/sk_SK.json"&gt;link&lt;/a&gt;.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;After completing the translations, we run the command that creates the translations for the application:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer run translate-fbts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Finally, this command will generate a production file with translations using Jenkins hash.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;Your app is now translated! Hurray!&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
      &lt;div class="c-embed__cover"&gt;
        &lt;a href="https://giphy.com/embed/EXFAJtutz5Ig8" class="c-link s:max-w-50 align-middle" rel="noopener noreferrer"&gt;
          &lt;img alt="" src="https://res.cloudinary.com/practicaldev/image/fetch/s--rHCS4PiV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://media0.giphy.com/media/EXFAJtutz5Ig8/200.gif%3Fcid%3Ddda24d50acf74f580ff32ada2e38eb2f873977db9cc6052e%26rid%3D200.gif%26ct%3Dg" height="200" class="m-0" width="356"&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;div class="c-embed__body"&gt;
      &lt;h2 class="fs-xl lh-tight"&gt;
        &lt;a href="https://giphy.com/embed/EXFAJtutz5Ig8" rel="noopener noreferrer" class="c-link"&gt;
          Sesame Street Love GIF by HBO - Find &amp;amp; Share on GIPHY
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;p class="truncate-at-3"&gt;
          It's HBO.
        &lt;/p&gt;
      &lt;div class="color-secondary fs-s flex items-center"&gt;
        giphy.com
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Thanks for reading 🙏.&lt;/p&gt;

</description>
      <category>php</category>
      <category>i18n</category>
      <category>tutorial</category>
      <category>opensource</category>
    </item>
    <item>
      <title>How to generate PHP enums from database in Laravel?</title>
      <dc:creator>Richard Dobroň</dc:creator>
      <pubDate>Thu, 14 Jul 2022 16:40:58 +0000</pubDate>
      <link>https://dev.to/dobron/how-to-generate-php-enums-from-database-in-laravel-486k</link>
      <guid>https://dev.to/dobron/how-to-generate-php-enums-from-database-in-laravel-486k</guid>
      <description>&lt;p&gt;A magic number is a configuration parameter typed as a number in the middle of some code.&lt;/p&gt;

&lt;p&gt;And that magic number is a &lt;strong&gt;bad thing&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Using this library, you will fix the following code:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;To such:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h2&gt;
  
  
  How to use this generator?
&lt;/h2&gt;

&lt;p&gt;First of all, install composer package:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

composer require dobron/laravel-db-enum-generator


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

&lt;/div&gt;
&lt;p&gt;Let's say the &lt;em&gt;user_roles&lt;/em&gt; database table has the following structure:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Id&lt;/th&gt;
&lt;th&gt;Slug&lt;/th&gt;
&lt;th&gt;Role&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;MANAGER&lt;/td&gt;
&lt;td&gt;Admin&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;CONTENT_CREATOR&lt;/td&gt;
&lt;td&gt;Editor&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;MODERATOR&lt;/td&gt;
&lt;td&gt;Moderator&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;ADVERTISER&lt;/td&gt;
&lt;td&gt;Advertiser&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;INSIGHTS_ANALYST&lt;/td&gt;
&lt;td&gt;Analyst&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Now call artisan command &lt;code&gt;make:enum&lt;/code&gt;.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

# with laravel model
php artisan make:enum UserRoleTypes --model=UserRole --id=Id --slug=Slug --title=Role

# with laravel model that does not have slug column (will be auto-generated from --title)
php artisan make:enum UserRoleTypes --model=UserRole --id=Id --title=Role

# with database table
php artisan make:enum UserRoleTypes --table=user_roles --id=Id --slug=Slug --title=Role

# etc.


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

&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;UserRoleTypes.php&lt;/code&gt; file was generated in the &lt;code&gt;./app/enums/&lt;/code&gt; directory.&lt;br&gt;
If you update the database table, just use the same command with the &lt;em&gt;--force&lt;/em&gt; flag to overwrite the file.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;h2&gt;
  
  
  How to find magic numbers in the project?
&lt;/h2&gt;

&lt;p&gt;I recommend using a library called &lt;em&gt;PHPMND&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;This stands for PHP Magic Number Detector.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fpovils%2Fphpmnd%2Fmaster%2Fdemo.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fpovils%2Fphpmnd%2Fmaster%2Fdemo.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A detailed installation guide can be found at &lt;a href="https://github.com/povils/phpmnd" rel="noopener noreferrer"&gt;https://github.com/povils/phpmnd&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But if you're using Composer, here's how you can install it quickly:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

composer require --dev povils/phpmnd


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

&lt;/div&gt;

&lt;p&gt;Once that's done, you run it like this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

phpmnd .


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

&lt;/div&gt;

</description>
      <category>php</category>
      <category>opensource</category>
      <category>tutorial</category>
      <category>laravel</category>
    </item>
    <item>
      <title>How to easily call JavaScript modules from PHP?</title>
      <dc:creator>Richard Dobroň</dc:creator>
      <pubDate>Wed, 13 Jul 2022 16:22:49 +0000</pubDate>
      <link>https://dev.to/dobron/how-to-easily-call-javascript-modules-from-php-5cl0</link>
      <guid>https://dev.to/dobron/how-to-easily-call-javascript-modules-from-php-5cl0</guid>
      <description>&lt;p&gt;You have surely solved it many times, but the solution was not very attractive. This tutorial is about generating &lt;em&gt;JavaScript&lt;/em&gt; code in &lt;em&gt;PHP&lt;/em&gt; using the &lt;strong&gt;BigPipe&lt;/strong&gt; library, which is inspired by the Facebook architecture.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The purpose of this library is to rapidly reduce the continuously repetitive code to work with the DOM and improve the communication barrier between PHP and JavaScript.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Requirements
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;PHP 7.1 or higher&lt;/li&gt;
&lt;li&gt;Node 8, 10+.&lt;/li&gt;
&lt;li&gt;Webpack&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Install composer package:
&lt;/h3&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

$ composer require richarddobron/bigpipe


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

&lt;/div&gt;
&lt;h3&gt;
  
  
  2. Install npm package:
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

$ npm install bigpipe-util


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

&lt;/div&gt;
&lt;h3&gt;
  
  
  3. Add this lines to /path/to/resources/js/app.js:
&lt;/h3&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;h3&gt;
  
  
  4. Create file /path/to/resources/js/ServerJS.js
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;this step is optional, but if you skip it, use this in next step: &lt;code&gt;require("bigpipe-util/ServerJS")&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h3&gt;
  
  
  5. Add this lines to page footer:
&lt;/h3&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h2&gt;
  
  
  What all can be Ajaxifed?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Links
&lt;/h3&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;

&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#"&lt;/span&gt;
   &lt;span class="na"&gt;ajaxify=&lt;/span&gt;&lt;span class="s"&gt;"/ajax/remove.php"&lt;/span&gt;
   &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"async"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Remove Item&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;


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

&lt;/div&gt;
&lt;h3&gt;
  
  
  Forms
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;

&lt;span class="nt"&gt;&amp;lt;form&lt;/span&gt; &lt;span class="na"&gt;action=&lt;/span&gt;&lt;span class="s"&gt;"/submit.php"&lt;/span&gt;
      &lt;span class="na"&gt;method=&lt;/span&gt;&lt;span class="s"&gt;"POST"&lt;/span&gt;
      &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"async"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"user"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"submit"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"Done"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;


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

&lt;/div&gt;
&lt;h3&gt;
  
  
  Dialogs
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;

&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"#"&lt;/span&gt;
   &lt;span class="na"&gt;ajaxify=&lt;/span&gt;&lt;span class="s"&gt;"/ajax/modal.php"&lt;/span&gt;
   &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"dialog"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Open Modal&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;


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

&lt;/div&gt;
&lt;h2&gt;
  
  
  DOMOPS API
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;setContent&lt;/strong&gt;: Sets the content of an element.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;appendContent&lt;/strong&gt;: Insert content as the last child of specified element.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;prependContent&lt;/strong&gt;: Insert content as the first child of specified element.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;insertAfter&lt;/strong&gt;: Insert content after specified element.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;insertBefore&lt;/strong&gt;: Insert content before specified element.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;remove&lt;/strong&gt;: Remove specified element and its children.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;replace&lt;/strong&gt;: Replace specified element with content.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;eval&lt;/strong&gt;: Evaluates JavaScript code represented as a string.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  DIALOGS API
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;setController&lt;/strong&gt;: Sets the JavaScript class controller - if you need to register an extra event listeners (show, shown, hide, hidden) or logic.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;setTitle&lt;/strong&gt;: Sets the title of a dialog.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;setBody&lt;/strong&gt;: Sets the body of a dialog.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;setFooter&lt;/strong&gt;: Sets the footer of a dialog.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;setDialog&lt;/strong&gt;: Sets the whole content of a dialog.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;closeDialogs&lt;/strong&gt;: Close all opened dialogs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;closeDialog&lt;/strong&gt;: Close only current dialog.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;dialog&lt;/strong&gt;: Render defined dialog.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;h2&gt;
  
  
  Refresh &amp;amp; Redirecting
&lt;/h2&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h2&gt;
  
  
  Payload
&lt;/h2&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h2&gt;
  
  
  BigPipe API
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;require&lt;/strong&gt;: Call JavaScript module method. You can call a specific class method or a regular function with the custom arguments.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example PHP code:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Example JavaScript code:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SecretModule&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;first&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;second&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// ...&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


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

&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;dialog&lt;/strong&gt;: Opens a dialog but can work with multiple dialogs at once.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example PHP code:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;transport&lt;/strong&gt;: Through transport markers you can send HTML content but also transform the content into JavaScript objects (such as Map, Set or Element).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example PHP code:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h2&gt;
  
  
  Demo app with examples
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The demo application is written in Laravel, but this library is framework-agnostic.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;⚠️ The demo server does not support &lt;strong&gt;HTTPS&lt;/strong&gt;, so you may need to confirm a security exception.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://bigpipe.xf.cz" rel="noopener noreferrer"&gt;http://bigpipe.xf.cz&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/richardDobron/bigpipe-php" rel="noopener noreferrer"&gt;https://github.com/richardDobron/bigpipe-php&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/richardDobron/bigpipe-util" rel="noopener noreferrer"&gt;https://github.com/richardDobron/bigpipe-util&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.ibb.co%2FMVSS9wh%2Fbigpipe.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.ibb.co%2FMVSS9wh%2Fbigpipe.gif"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.ibb.co%2Fgrj9gw9%2Fbigpipe.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.ibb.co%2Fgrj9gw9%2Fbigpipe.gif"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.ibb.co%2FVDQ6039%2Fbigpipe.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.ibb.co%2FVDQ6039%2Fbigpipe.gif"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.ibb.co%2F0ZrNDNJ%2Fbigpipe.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.ibb.co%2F0ZrNDNJ%2Fbigpipe.gif"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.ibb.co%2Fk8BQ8DY%2Fbigpipe.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.ibb.co%2Fk8BQ8DY%2Fbigpipe.gif"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>php</category>
      <category>laravel</category>
      <category>tutorial</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Disabling installation notifications for Packagist</title>
      <dc:creator>Richard Dobroň</dc:creator>
      <pubDate>Tue, 12 Jul 2022 19:15:51 +0000</pubDate>
      <link>https://dev.to/dobron/disabling-installation-notifications-for-packagist-130</link>
      <guid>https://dev.to/dobron/disabling-installation-notifications-for-packagist-130</guid>
      <description>&lt;p&gt;If you use workflow to run tests along with installing dependencies via composer, you may find it useful to disable sending install statistics to Packagist.&lt;/p&gt;

&lt;p&gt;Just add this line of code to the beginning of the script.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer config notify-on-install false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As it says in the composer documentation:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;notify-on-install: This allows composer to send notification to a URL whenever a package is installed. This by default is true.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>cli</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to add PHP CS Fixer to your project?</title>
      <dc:creator>Richard Dobroň</dc:creator>
      <pubDate>Tue, 12 Jul 2022 19:12:34 +0000</pubDate>
      <link>https://dev.to/dobron/how-to-add-php-cs-fixer-to-your-project-5486</link>
      <guid>https://dev.to/dobron/how-to-add-php-cs-fixer-to-your-project-5486</guid>
      <description>&lt;p&gt;First of all, add PHP CS Fixer to your project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer require --dev friendsofphp/php-cs-fixer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;A configuration file called &lt;strong&gt;.php-cs-fixer.dist.php&lt;/strong&gt; needs to be in the root directory of your project if you want to avoid command-line options.&lt;/p&gt;

&lt;p&gt;There are many rules that can be set, I usually use these. It follows the &lt;strong&gt;PSR12&lt;/strong&gt; code standards and checks both the &lt;em&gt;src&lt;/em&gt; and &lt;em&gt;tests&lt;/em&gt; directories.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;You can find more rules in the &lt;a href="https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/doc/rules/index.rst"&gt;PHP CS Fixer docs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Let’s add a some scripts to &lt;strong&gt;composer.json&lt;/strong&gt; file:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Now, just run composer run fix-style and all your code style errors will be fixed.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;--dry-run&lt;/em&gt; flag will run the fixer without making changes to your files.&lt;/p&gt;

&lt;p&gt;If you are using Git, add &lt;strong&gt;.php-cs-fixer.cache&lt;/strong&gt; (this is the cache file created by php-cs-fixer) to .gitignore:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.php-cs-fixer.cache
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>php</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>codequality</category>
    </item>
    <item>
      <title>Automatically generate plain text e-mails without view in Laravel 5+</title>
      <dc:creator>Richard Dobroň</dc:creator>
      <pubDate>Tue, 12 Jul 2022 18:50:01 +0000</pubDate>
      <link>https://dev.to/dobron/automatically-generate-plain-text-e-mails-without-view-in-laravel-5-38b8</link>
      <guid>https://dev.to/dobron/automatically-generate-plain-text-e-mails-without-view-in-laravel-5-38b8</guid>
      <description>&lt;p&gt;Plain text emails are still very important these days. For many of them, however, it is pointless to write a plain text version as long as it can be automatically generated from HTML format.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Install html2text package:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer require soundasleep/html2text
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  2. Create file TextMailBuilder.php:
&lt;/h3&gt;

&lt;p&gt;This trait contains a &lt;strong&gt;buildView&lt;/strong&gt; method that overwrites the original method and will generate text for the email only if you do not use your own view for the plain text version of the email.&lt;/p&gt;

&lt;p&gt;Create &lt;strong&gt;Traits&lt;/strong&gt; folder in &lt;strong&gt;app/Mails&lt;/strong&gt;, then create &lt;strong&gt;TextMailBuilder.php&lt;/strong&gt; file, then place the entire code to this file:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Import TextMailBuilder trait to your Mailables:
&lt;/h3&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


</description>
      <category>laravel</category>
      <category>productivity</category>
      <category>tutorial</category>
      <category>php</category>
    </item>
  </channel>
</rss>
