<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Richard Dobroň on Medium]]></title>
        <description><![CDATA[Stories by Richard Dobroň on Medium]]></description>
        <link>https://medium.com/@dobron?source=rss-676e11d18725------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*JneAh8tJ1CMkZzJYEMVEqw.jpeg</url>
            <title>Stories by Richard Dobroň on Medium</title>
            <link>https://medium.com/@dobron?source=rss-676e11d18725------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 12:48:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dobron/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[You’ve Never Heard Of These 10 Bizarre Programming Languages]]></title>
            <link>https://medium.com/@dobron/youve-never-heard-of-these-10-bizarre-programming-languages-74ddfc97ce80?source=rss-676e11d18725------2</link>
            <guid isPermaLink="false">https://medium.com/p/74ddfc97ce80</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[programming-languages]]></category>
            <category><![CDATA[programmer]]></category>
            <dc:creator><![CDATA[Richard Dobroň]]></dc:creator>
            <pubDate>Sun, 14 Aug 2022 12:16:44 GMT</pubDate>
            <atom:updated>2022-08-14T12:20:28.370Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dE30IiCl1zPwWVBphiB55g.png" /></figure><h3>1. Whitespace</h3><ul><li>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.</li><li><a href="https://en.wikipedia.org/wiki/Whitespace_(programming_language)">Wikipedia</a></li><li>Here’s an example of a “Hello, world!” in Whitespace:</li></ul><pre>Hello,[Space]world![Space][Space][Tab][Space][Space][Tab][Space][Space][Space][LF]<br>[Tab][LF][Space][Space]<br>[Space][Space][Space][Tab][Tab][Space][Space][Tab][Space][Tab][LF]<br>[Tab][LF][Space][Space]<br>[Space][Space][Space][Tab][Tab][Space][Tab][Tab][Space][Space][LF]<br>[Tab][LF][Space][Space]<br>[Space][Space][Space][Tab][Tab][Space][Tab][Tab][Space][Space][LF]<br>[Tab][LF][Space][Space]<br>[Space][Space][Space][Tab][Tab][Space][Tab][Tab][Tab][Tab][LF]<br>[Tab][LF][Space][Space]<br>[Space][Space][Space][Tab][Space][Tab][Tab][Space][Space][LF]<br>[Tab][LF][Space][Space]<br>[Space][Space][Space][Tab][Space][Space][Space][Space][Space][LF]<br>[Tab][LF][Space][Space]<br>[Space][Space][Space][Tab][Tab][Tab][Space][Tab][Tab][Tab][LF]<br>[Tab][LF][Space][Space]<br>[Space][Space][Space][Tab][Tab][Space][Tab][Tab][Tab][Tab][LF]<br>[Tab][LF][Space][Space]<br>[Space][Space][Space][Tab][Tab][Tab][Space][Space][Tab][Space][LF]<br>[Tab][LF][Space][Space]<br>[Space][Space][Space][Tab][Tab][Space][Tab][Tab][Space][Space][LF]<br>[Tab][LF][Space][Space]<br>[Space][Space][Space][Tab][Tab][Space][Space][Tab][Space][Space][LF]<br>[Tab][LF][Space][Space]<br>[LF][LF][LF]</pre><h3>2. Ook!</h3><ul><li>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.<br>For a few examples of commands, check out this <a href="https://www.dangermouse.net/esoteric/ook.html">article</a>.</li><li>Here’s the “Hello World” program written in Ook!:</li></ul><pre>Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.<br>Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.<br>Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook.<br>Ook! Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.<br>Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook?<br>Ook! Ook! Ook? Ook! Ook? Ook. Ook. Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook.<br>Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook! Ook. Ook. Ook. Ook. Ook.<br>Ook. Ook. Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook.<br>Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook.<br>Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook.<br>Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.<br>Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook.<br>Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.<br>Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook.<br>Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook.<br>Ook! Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook.<br>Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook!<br>Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook! Ook.</pre><h3>3. ArnoldC</h3><ul><li>Programming language based on the one-liners of Arnold Schwarzenegger.</li><li><a href="https://github.com/lhartikk/ArnoldC">Source code</a></li><li>The following program displays “Hello World”:</li></ul><pre>IT&#39;S SHOWTIME<br>TALK TO THE HAND &quot;Hello World&quot;<br>YOU HAVE BEEN TERMINATED</pre><h3>4. Shakespeare</h3><ul><li>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 <a href="http://shakespearelang.sourceforge.net/report/shakespeare/">this</a>.</li><li><a href="https://en.wikipedia.org/wiki/Shakespeare_Programming_Language">Wikipedia</a></li><li>The standard “Hello, World!” program:</li></ul><pre>Do Not Adieu, a play in two acts.</pre><pre>Romeo, a young man with a remarkable patience.<br>Juliet, a likewise young woman of remarkable grace.<br>Ophelia, a remarkable woman much in dispute with Hamlet.<br>Hamlet, the flatterer of Andersen Insulting A/S.<br></pre><pre>                    Act I: Hamlet&#39;s insults and flattery.</pre><pre>                    Scene I: The insulting of Romeo.</pre><pre>[Enter Hamlet and Romeo]</pre><pre>Hamlet:<br> You lying stupid fatherless big smelly half-witted coward!<br> You are as stupid as the difference between a handsome rich brave<br> hero and thyself! Speak your mind!</pre><pre> You are as brave as the sum of your fat little stuffed misused dusty<br> old rotten codpiece and a beautiful fair warm peaceful sunny summer&#39;s<br> day. You are as healthy as the difference between the sum of the<br> sweetest reddest rose and my father and yourself! Speak your mind!</pre><pre> You are as cowardly as the sum of yourself and the difference<br> between a big mighty proud kingdom and a horse. Speak your mind.</pre><pre> Speak your mind!</pre><pre>[Exit Romeo]</pre><pre>                    Scene II: The praising of Juliet.</pre><pre>[Enter Juliet]</pre><pre>Hamlet:<br> Thou art as sweet as the sum of the sum of Romeo and his horse and his<br> black cat! Speak thy mind!</pre><pre>[Exit Juliet]</pre><pre>                    Scene III: The praising of Ophelia.</pre><pre>[Enter Ophelia]</pre><pre>Hamlet:</pre><pre> Thou art as beautiful as the difference between Romeo and the square<br> of a huge green peaceful tree. Speak thy mind!</pre><pre> Thou art as lovely as the product of a large rural town and my amazing<br> bottomless embroidered purse. Speak thy mind!</pre><pre> Thou art as loving as the product of the bluest clearest sweetest sky<br> and the sum of a squirrel and a white horse. Thou art as beautiful as<br> the difference between Juliet and thyself. Speak thy mind!</pre><pre>[Exeunt Ophelia and Hamlet]<br></pre><pre>                    Act II: Behind Hamlet&#39;s back.</pre><pre>                    Scene I: Romeo and Juliet&#39;s conversation.</pre><pre>[Enter Romeo and Juliet]</pre><pre>Romeo:<br> Speak your mind. You are as worried as the sum of yourself and the<br> difference between my small smooth hamster and my nose. Speak your<br> mind!</pre><pre>Juliet:<br> Speak YOUR mind! You are as bad as Hamlet! You are as small as the<br> difference between the square of the difference between my little pony<br> and your big hairy hound and the cube of your sorry little<br> codpiece. Speak your mind!</pre><pre>[Exit Romeo]</pre><pre>                    Scene II: Juliet and Ophelia&#39;s conversation.</pre><pre>[Enter Ophelia]</pre><pre>Juliet:<br> Thou art as good as the quotient between Romeo and the sum of a small<br> furry animal and a leech. Speak your mind!</pre><pre>Ophelia:<br> Thou art as disgusting as the quotient between Romeo and twice the<br> difference between a mistletoe and an oozing infected blister! Speak<br> your mind!</pre><pre>[Exeunt]</pre><h3>5. Velato</h3><ul><li>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.</li><li>The following program displays “Hello World!”:</li></ul><pre>\version &quot;2.19.64&quot;</pre><pre>\header{<br>  title = &quot;Hello, World!&quot;<br>}</pre><pre>\language &quot;english&quot;</pre><pre>\paper {<br>  top-margin = 1.5\in<br>  left-margin = 2.0\in<br>  right-margin = 2.0\in<br>}</pre><pre>\score {<br>  \transpose c c&#39; {<br>    % H<br>    &lt;c a&gt;4<br>    g8<br>    e8 f8<br>    gs8 d8<br>    g8 |</pre><pre>    % e<br>    a8<br>    &lt;g e&gt;4.<br>    &lt;f cs&gt;4<br>    c16 cs16<br>    g8 |</pre><pre>    % l<br>    a8<br>    &lt;g e&gt;8<br>    &lt;f cs&gt;4<br>    &lt;c a&gt;4<br>    g4 |</pre><pre>    % l<br>    a16 g16<br>    e16 f8<br>    cs8. &lt;c a g&gt;2 |</pre><pre>    % o<br>    a8 g8 e8<br>    f8.<br>    cs16 cs8 cs8 g8 |</pre><pre>    % ,<br>    a8 g4<br>    e8 f8<br>    e e<br>    g8 |</pre><pre>    % space<br>    a8<br>    &lt;g e&gt;4.<br>    f8<br>    ds d<br>    g8 |</pre><pre>    % W<br>    a8 g4<br>    e8 f8<br>    a8 gs8<br>    g8 |</pre><pre>    % o<br>    a8 g8<br>    e8 f8<br>    cs8 cs8 &lt;cs g&gt;4 |</pre><pre>    % r<br>    a8 g8<br>    e8 f8<br>    cs8 cs8 e8. g16 |</pre><pre>    % l<br>    c16 a16<br>    &lt;g e&gt;8<br>    &lt;f cs&gt;4<br>    &lt;c a&gt;4<br>    g4 |</pre><pre>    % d<br>    a8 g4<br>    e16 f16<br>    cs8 c8 c8<br>    g8 |</pre><pre>    % !<br>    a16<br>    &lt;g e&gt;4<br>    f16 ds16 ds16<br>    &lt;g c&gt;2 |<br>  }<br>  \layout {<br>    indent = 0\cm<br>  }<br>  \midi {<br>    \tempo 4 = 120<br>  }<br>}</pre><h3>6. Brainfuck</h3><ul><li>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.</li><li><a href="https://en.wikipedia.org/wiki/Brainfuck">Wikipedia</a></li></ul><p>The following program prints “Hello World!” and a newline to the screen:</p><pre>++++++++[&gt;++++[&gt;++&gt;+++&gt;+++&gt;+&lt;&lt;&lt;&lt;-]&gt;+&gt;+&gt;-&gt;&gt;+[&lt;]&lt;-]&gt;&gt;.&gt;---.+++++++..+++.&gt;&gt;.&lt;-.&lt;.+++.------.--------.&gt;&gt;+.&gt;++.</pre><h3>7. Malbolge</h3><ul><li>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.</li><li><a href="https://en.wikipedia.org/wiki/Malbolge">Wikipedia</a></li><li>The following program prints “Hello World”:</li></ul><pre>(=&lt;`#9]~6ZY32Vx/4Rs+0No-&amp;Jk)&quot;Fh}|Bcy?`=*z]Kw%oG4UUS0/@-ejc(:&#39;8d</pre><h3>8. Chicken</h3><ul><li>Chicken is an esoteric programming language by Torbjörn Söderstedt, in which “chicken” is the only valid symbol.</li><li>Here’s the “Hello World” program written in Chicken.</li></ul><pre>chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken chicken<br>chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken</pre><pre>chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken</pre><pre>chicken chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken<br>chicken chicken<br>chicken chicken chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken</pre><pre>chicken chicken<br>chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken</pre><pre>chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken</pre><pre>chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken<br>chicken chicken chicken chicken chicken chicken</pre><h3>9. LOLcode</h3><ul><li>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.</li><li><a href="https://en.wikipedia.org/wiki/LOLCODE">Wikipedia</a></li><li>Here’s the “Hello World” program written in LOLcode:</li></ul><pre>HAI 1.2<br>CAN HAS STDIO?<br>VISIBLE &quot;Hello World&quot;<br>KTHXBYE</pre><h3>10. JSFuck</h3><ul><li>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:</li></ul><ol><li>It is a weakly typed programming language</li><li>It allows the evaluation of any expression as any type.</li></ol><ul><li><a href="https://github.com/aemkei/jsfuck">Source code</a></li><li>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:</li></ul><pre>[][(![]+[])[+!![]]+(!![]+[])[+[]]][([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![ ]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+ (!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+! ![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+(!![]+[])[+!![] ]]((!![]+[])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+ ([][[]]+[])[+!![]]+(+[![]]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+!![]]]+(![]+[])[+!![]]+( ![]+[])[!![]+!![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+!![]]+(!![]+[])[+[]])()([][(![]+[])[+!! []]+(!![]+[])[+[]]][([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+ !![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+ (!![]+[])[+!![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![] +[])[+[]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]((!![]+[])[+! ![]]+(!![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!! []]+(+[![]]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+!![]]]+([]+[][(!![]+[])[!![]+!![]+!![]] +([][[]]+[])[+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([![]]+[][[]])[+!![]+[+[]]]+(!![]+[])[!![]+ !![]+!![]]+(![]+[])[!![]+!![]+!![]]]())[!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+!![]]+(!![ ]+[])[+[]]])[+!![]+[+[]]]+(![]+[])[+!![]])()(!![])[+!![]]+(!![]+[])[!![]+!![]+!![]]+(![]+[])[!! []+!![]]+(![]+[])[!![]+!![]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+(+[![]]+[][ (![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+!![]]]+(+[![]]+[][(![]+[])[+!![]]+(!![]+[])[+[]]][([]+ [][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+ !![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]] +[])[+[]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+ [])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+(!![]+[])[!![]+!![] +!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+(+[![]]+[][(![]+[])[ +!![]]+(!![]+[])[+[]]])[+!![]+[+!![]]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[!![]+!![]+!![]]+(![]+ [])[!![]+!![]]+(![]+[])[+[]])())[+!![]+[+!![]]]+(!![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![] +[+[]]]+(!![]+[])[+!![]]+(![]+[])[!![]+!![]]+([][[]]+[])[!![]+!![]]+[][(![]+[])[+!![]]+(!![]+[] )[+[]]][([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![]+[][(![]+[])[+!![]]+(!![]+ [])[+[]]])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+! ![]]+([][[]]+[])[+[]]+([]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[!![]+!![]+!![]]+(!![]+[])[+[]]+(! ![]+[][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+(!![]+[])[+!![]]]((!![]+[])[+!![]]+(!![]+[ ])[!![]+!![]+!![]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+[])[+!![]]+(+[![]]+ [][(![]+[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+!![]]]+(![]+[])[+!![]]+(!![]+[])[+[]]+(!![]+[][(![] +[])[+!![]]+(!![]+[])[+[]]])[+!![]+[+[]]]+([]+[][(!![]+[])[!![]+!![]+!![]]+([][[]]+[])[+!![]]+( !![]+[])[+[]]+(!![]+[])[+!![]]+([![]]+[][[]])[+!![]+[+[]]]+(!![]+[])[!![]+!![]+!![]]+(![]+[])[! ![]+!![]+!![]]]())[!![]+!![]])()((+(+!![]+(!![]+[])[!![]+!![]+!![]]+(+!![])+(+[])+(+[])+(+[]))+ [])[+[]]+![])[+[]])</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=74ddfc97ce80" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to create your first composer package? ]]></title>
            <link>https://medium.com/@dobron/how-to-create-your-first-composer-package-db9f17c50f98?source=rss-676e11d18725------2</link>
            <guid isPermaLink="false">https://medium.com/p/db9f17c50f98</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[php-developers]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Richard Dobroň]]></dc:creator>
            <pubDate>Mon, 08 Aug 2022 20:57:19 GMT</pubDate>
            <atom:updated>2022-08-08T21:10:59.412Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jVz144YpXwZlmtnHT-UROg.jpeg" /></figure><h3>What is Composer?</h3><p>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.</p><h3>What is Packagist?</h3><p>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.</p><h3>Don’t have an account?</h3><p>Navigate to <a href="https://packagist.org/">packagist.org</a> and click Create account.</p><h3>1. Create a project</h3><ul><li>Create a folder named nullthrows</li></ul><pre>mkdir nullthrows</pre><h3>2. Initialize project as composer package</h3><ul><li>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.</li></ul><pre>composer init</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/0*_kAeDeZ5Deun4RDf.png" /></figure><ul><li>This process will generate a composer.json file.</li></ul><h3>3. Create a file named nullthrows.php with this content in src folder:</h3><pre>&lt;?php</pre><pre>/**<br> * @param mixed $value<br> * @param string $message<br> *<br> * @return mixed<br> * @throws Exception<br> */<br>function nullthrows($value, string $message = null) {<br>    if ($value !== null) {<br>        return $value;<br>    }</pre><pre>    throw new Exception($message ?: &#39;Got unexpected null value.&#39;);<br>}</pre><h3>4. Add files under autoload in composer.json</h3><pre>{<br>    &quot;name&quot;: &quot;dobron/nullthrows&quot;,<br>    &quot;autoload&quot;: {<br>        &quot;files&quot;: [<br>            &quot;src/nullthrows.php&quot;<br>        ],<br>        &quot;psr-4&quot;: {<br>            &quot;dobron\\&quot;: &quot;src/&quot;<br>        }<br>    },<br>    &quot;authors&quot;: [<br>        {<br>            &quot;name&quot;: &quot;Richard Dobroň&quot;<br>        }<br>    ],<br>    &quot;require&quot;: {}<br>}</pre><h3>5. Create a README.md (optional)</h3><ul><li>You should provide a brief description of the repository and its functions.</li></ul><h3>6. Commit the code to GitHub repository</h3><pre>git init<br>git add .<br>git commit -m &quot;Initial commit&quot;<br>git branch -M main<br>git remote add origin git@github.com:yourUsername/nullthrows.git<br>git push -u origin main</pre><h3>7. Submit package</h3><p><a href="https://packagist.org/packages/submit">https://packagist.org/packages/submit</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/0*L4QzdNX3l9qEd2qs.png" /></figure><h3>You Did It!</h3><p>Congratulations, you have published your first Composer package!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db9f17c50f98" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to create your first npm package? ]]></title>
            <link>https://medium.com/@dobron/how-to-create-your-first-npm-package-9b17e7501037?source=rss-676e11d18725------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b17e7501037</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <dc:creator><![CDATA[Richard Dobroň]]></dc:creator>
            <pubDate>Sun, 07 Aug 2022 17:49:52 GMT</pubDate>
            <atom:updated>2022-08-08T20:58:07.525Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VNX0aGDSbqX0IfQl2iaUaw.jpeg" /></figure><h3>What is NPM</h3><p>NPM stands for Node Package Manager and is the default JavaScript package manager powered by <em>Node.js</em>. The npm manager has two parts:</p><ul><li>CLI (<em>Command Line Interface</em>) — a tool for publishing and downloading packages,</li><li><a href="https://www.npmjs.com/">online repositories</a> containing over 2 million JavaScript packages.</li></ul><h3>Don’t have an account?</h3><p>Navigate to <a href="https://www.npmjs.com/">npmjs.com</a> and click sign up.</p><h3>1. Create an npm project</h3><ul><li>Create a folder named arraySort</li></ul><pre>mkdir arraySort</pre><h3>2. Initialize project as npm package</h3><h4>a) Using npm init -y or -yes</h4><ul><li>This process will automatically generate a package.json file with default options.</li></ul><pre>npm init -y</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*5NuMG6PrqZrpJLbt.png" /></figure><h4>b) Using npm init</h4><ul><li>In this process, you will be asked a number of questions such as the name of the author, the description, and the license, etc.</li></ul><pre>npm init</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/0*6Lv8pc0euH_Cvb6F.png" /></figure><h3>3. Create a file named index.js with this content:</h3><pre>function arraySort(array, compareFunction) {<br>    const cloned = array.slice();<br>    if (compareFunction) {<br>        return cloned.sort(compareFunction);<br>    }</pre><pre>    return cloned.sort();<br>}</pre><pre>module.exports = arraySort;</pre><h3>4. Create a README.md (optional)</h3><ul><li>You should provide a brief description of the repository and its functions.</li></ul><h3>5. Login into NPM</h3><pre>npm login</pre><h3>6. Publish the package</h3><pre>npm publish</pre><h3>You Did It!</h3><p>Congratulations, you have published your first NPM package!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b17e7501037" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to fix Gmail login in your application?]]></title>
            <link>https://medium.com/@dobron/how-to-fix-gmail-login-in-your-application-2fec99c79f3f?source=rss-676e11d18725------2</link>
            <guid isPermaLink="false">https://medium.com/p/2fec99c79f3f</guid>
            <category><![CDATA[google]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Richard Dobroň]]></dc:creator>
            <pubDate>Sun, 31 Jul 2022 11:03:41 GMT</pubDate>
            <atom:updated>2022-07-31T11:03:41.031Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O7g9rsfHMBOQmJCURGeOzg.png" /></figure><p>Google has announced that some accounts will no longer be able to use Less Secure Apps feature, starting May 30th, 2022.</p><p>Your application will contain an error similar to this:</p><blockquote><em>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</em></blockquote><h3>What are Less Secure Apps in Gmail?</h3><p>With <em>Less Secure Apps</em> feature, you can use your main Google username and password to sign in to your Gmail account on software and devices.</p><h3>Fix using an App Password</h3><p>To use an app password, you must first <a href="https://support.google.com/accounts/answer/185839">turn on two-factor authentication for your Google account</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/0*hl-rR3DcXAk5OfFw.png" /></figure><p>After that, in your Google account’s security settings, you can set an <a href="https://myaccount.google.com/u/0/apppasswords">app-specific password</a> for SMTP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/0*jR5P8Ms7Bn9IQyC7.png" /></figure><p>Then type the name of the application that will help you identify this password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/0*KWsoJlPNwB1Mu8aW.png" /></figure><p>Your password will be generated after clicking the Generate button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/0*UCRk32zfvVTFgXqd.png" /></figure><p>And that’s it, now just use this new password to log in.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2fec99c79f3f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to add Prettier code formatter to your project?]]></title>
            <link>https://medium.com/@dobron/how-to-add-prettier-code-formatter-to-your-project-d3ba77cb4874?source=rss-676e11d18725------2</link>
            <guid isPermaLink="false">https://medium.com/p/d3ba77cb4874</guid>
            <category><![CDATA[npm]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Richard Dobroň]]></dc:creator>
            <pubDate>Thu, 28 Jul 2022 15:23:38 GMT</pubDate>
            <atom:updated>2022-07-28T15:23:38.542Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a8wLLjYPKHQJG9oSwTQJUg.jpeg" /></figure><h3>How to add Prettier code formatter to your project?</h3><p>You can use Prettier to make your code more readable and consistent with your style guide. There are several ways to start Prettier automatically, these are the most popular:</p><ol><li>pretty-quick</li></ol><ul><li>Use library <em>pretty-quick</em> to format your changed or staged files.</li></ul><pre>npx husky-init<br>npm install --save-dev pretty-quick<br>npx husky set .husky/pre-commit &quot;npx pretty-quick --staged&quot;</pre><p>2. Shell script</p><ul><li>Save this script as .git/hooks/pre-commit and give it execute permission:</li></ul><pre>#!/bin/sh<br>FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed &#39;s| |\\ |g&#39;)<br>[ -z &quot;$FILES&quot; ] &amp;&amp; exit 0</pre><pre># Prettify all selected files<br>echo &quot;$FILES&quot; | xargs ./node_modules/.bin/prettier --ignore-unknown --write</pre><pre># Add back the modified/prettified files to staging<br>echo &quot;$FILES&quot; | xargs git add</pre><pre>exit 0</pre><p>If git is reporting that your prettified files are still modified after committing, you may need to add a <a href="https://github.com/prettier/prettier/issues/2978#issuecomment-334408427">post-commit script to update git’s index</a>.</p><p>Add something like the following to .git/hooks/post-commit:</p><pre>#!/bin/sh<br>git update-index -g</pre><h3>Configure rules</h3><p>Create a *.prettierrc file at the root of your project to configure your prettier rules.</p><p>Here’s an example file containing some popular rules:</p><pre>{<br>  &quot;semi&quot;: true&quot;,<br>  &quot;trailingComma&quot;: &quot;all&quot;,<br>  &quot;singleQuote&quot;: true,<br>  &quot;printWidth&quot;: 70,<br>  &quot;arrowParens&quot;: &quot;always&quot;,<br>  &quot;tabWidth&quot;: 2<br>}</pre><p>For everything you don’t want to format, create a <em>.prettierignore</em> file:</p><pre>node_modules/<br>package.json</pre><h3>Manual Run &amp; Fix</h3><p>To manual run via CLI, add a command to <em>package.json</em> and run npm run format.</p><pre>{<br> &quot;scripts&quot;: {<br>  &quot;format&quot;: &quot;prettier --write .&quot;<br> }<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3ba77cb4874" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[300 beautiful pure CSS loaders]]></title>
            <link>https://medium.com/@dobron/300-beautiful-pure-css-loaders-9b9644a4876e?source=rss-676e11d18725------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b9644a4876e</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[design]]></category>
            <dc:creator><![CDATA[Richard Dobroň]]></dc:creator>
            <pubDate>Fri, 22 Jul 2022 15:20:01 GMT</pubDate>
            <atom:updated>2022-07-22T15:20:01.642Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8SlrR7NEX7rmufvBguYw8A.jpeg" /></figure><p>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.</p><p><a href="https://cssloaders.github.io/">Open cssloaders.github.io</a></p><p>Just click on the specific loader that you want to use in your application and a dialog box with the source code will appear.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/0*eywfeN4_EqVaSKm1.gif" /></figure><p>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.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*Zq054q6bN0FDUlRQ.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*8oH3kdvON3Aj_92Z.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b9644a4876e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Localizing PHP application with FBT instead of standard i18n]]></title>
            <link>https://medium.com/@dobron/localizing-php-application-with-fbt-instead-of-standard-i18n-93ffb21d4faf?source=rss-676e11d18725------2</link>
            <guid isPermaLink="false">https://medium.com/p/93ffb21d4faf</guid>
            <category><![CDATA[translation]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[laravel]]></category>
            <dc:creator><![CDATA[Richard Dobroň]]></dc:creator>
            <pubDate>Tue, 19 Jul 2022 15:44:26 GMT</pubDate>
            <atom:updated>2022-11-05T11:46:31.430Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OMjfKKIj8vStMPEjZhryoA.png" /><figcaption>FBT</figcaption></figure><p>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 😊).</p><ul><li><a href="https://www.facebook.com/watch/?ref=external&amp;v=2270332766518020"><strong>FBT Preview at F8</strong></a></li><li><a href="https://github.com/richardDobron/fbt"><strong>FBT repository for PHP 7.0+</strong></a></li><li><a href="https://github.com/richardDobron/laravel-fbt"><strong>FBT repository for Laravel 5.5</strong></a><strong>+</strong></li></ul><p>There are many reasons why the common i18n libraries are very inadequate. The main ones are:</p><ul><li>misunderstanding of the native text by the translator (does not know the context),</li><li>insufficient/nonsensical code combinations for translation,</li><li>do not support features like <a href="https://github.com/richardDobron/fbt/blob/main/docs/enums.md">enums</a> or <a href="https://github.com/richardDobron/fbt/blob/main/docs/pronouns.md">pronouns</a>,</li><li>and many more…</li></ul><p>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.</p><h4>1. Install the FBT package</h4><pre>composer require richarddobron/fbt</pre><h4>2. Set your FBT configuration</h4><pre>&lt;?php<br>require (&quot;vendor/autoload.php&quot;);</pre><pre>\fbt\FbtConfig::set(&#39;author&#39;, &#39;your name/team&#39;);<br>\fbt\FbtConfig::set(&#39;project&#39;, &#39;project name&#39;);<br>\fbt\FbtConfig::set(&#39;path&#39;, &#39;/path/to/storage/fbt&#39;);</pre><h4>3. Language and gender settings</h4><ul><li>If you just want to change the interface language, just use:</li></ul><pre>\fbt\FbtHooks::locale(&#39;sk_SK&#39;); // app locale</pre><ul><li>If you have an application in which users log in, you can use the interface <strong>IntlViewerContextInterface</strong>:</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/922269b893c7b25f2476f44ba2013c4e/href">https://medium.com/media/922269b893c7b25f2476f44ba2013c4e/href</a></iframe><p>After implementation, set <strong>viewerContext</strong>:</p><pre>$loggedUserDto = ...;</pre><pre>\fbt\FbtConfig::set(&#39;viewerContext&#39;, $loggedUserDto)</pre><p><strong>4. Prepare translations files</strong></p><ul><li>Facebook has devised their own system of labeling languages, you can find a list of them at this <a href="https://github.com/richardDobron/fbt/blob/main/docs/locales.md">link</a>.</li><li>From this list, choose the languages into which you want to translate your website or application.</li><li>I usually add them to the directory <strong>/storage/fbt/</strong></li><li>The file name will look like this: <strong>sk_SK.json</strong></li></ul><p><strong>5. Add FBT scripts to composer.json</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0b11d9ee0a9a5899b46aaf6ad1aa70f5/href">https://medium.com/media/0b11d9ee0a9a5899b46aaf6ad1aa70f5/href</a></iframe><ul><li><em>Native phrases can also be easily translated via the app editor</em><strong> </strong><a href="https://translations.swiftyper.sk/"><strong>Swiftyper Translations</strong></a><strong>.</strong></li></ul><p><strong>6. Add your texts</strong></p><ul><li>Native phrases are always expected in <strong>English</strong>, it might look something like this:</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7b90bdeaf80cf394a95c1d9ea57c1f9e/href">https://medium.com/media/7b90bdeaf80cf394a95c1d9ea57c1f9e/href</a></iframe><p><strong>7. Translate collected texts</strong></p><p>This is what the collected source strings look like in the <em>.source_strings.json</em> file after script execution:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c7209488b69a55d2b63ce2db60a66265/href">https://medium.com/media/c7209488b69a55d2b63ce2db60a66265/href</a></iframe><p>Now we are ready to generate a file in which we will write the translations for the collected source strings:</p><pre>composer run generate-translations</pre><p>The <em>/storage/fbt/sk_SK.json</em> file now contains the hash keys of the source phrases that we can now translate. I make translations into <em>Slovak</em>, so I can use the gender of the <strong>{name}</strong> 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.</p><p>You can also find several types of translations at this <a href="https://github.com/richardDobron/fbt/blob/main/tests/translations/data/sk_SK.json">link</a>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bcb8e5970c9df0d4b363aa228055d73e/href">https://medium.com/media/bcb8e5970c9df0d4b363aa228055d73e/href</a></iframe><p>After completing the translations, we run the command that creates the translations for the application:</p><pre>composer run translate-fbts</pre><p>Finally, this command will generate a production file with translations using Jenkins hash.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bc1001a40b586a116147c7c6d8f2082a/href">https://medium.com/media/bc1001a40b586a116147c7c6d8f2082a/href</a></iframe><p>Your app is now translated! Hurray!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FEXFAJtutz5Ig8%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fhbo-glitter-sesame-street-wand-EXFAJtutz5Ig8&amp;image=https%3A%2F%2Fmedia4.giphy.com%2Fmedia%2FEXFAJtutz5Ig8%2Fgiphy.gif%3Fcid%3D790b7611b8bca98367132f868a1dc0ed1c125f91d891389b%26rid%3Dgiphy.gif%26ct%3Dg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/6fe1430420e244f5739d0264f9db7215/href">https://medium.com/media/6fe1430420e244f5739d0264f9db7215/href</a></iframe><p>Thanks for reading 🙏.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93ffb21d4faf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to generate PHP enums from database in Laravel?]]></title>
            <link>https://medium.com/@dobron/how-to-generate-php-enums-from-database-in-laravel-63e638932d2c?source=rss-676e11d18725------2</link>
            <guid isPermaLink="false">https://medium.com/p/63e638932d2c</guid>
            <category><![CDATA[php]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[console]]></category>
            <category><![CDATA[laravel]]></category>
            <dc:creator><![CDATA[Richard Dobroň]]></dc:creator>
            <pubDate>Thu, 14 Jul 2022 17:25:20 GMT</pubDate>
            <atom:updated>2022-07-16T11:07:58.327Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5egXytQ8Zn_7GF1FZ-qR3A.png" /></figure><p>A magic number is a configuration parameter typed as a number in the middle of some code.</p><p>And that magic number is a <strong>bad thing</strong>.</p><p>Using this library, you will fix the following code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bedd458856b0f683af2d4827f48d32d2/href">https://medium.com/media/bedd458856b0f683af2d4827f48d32d2/href</a></iframe><p>To such:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/60e584df16719f88662fc7614d1c9e66/href">https://medium.com/media/60e584df16719f88662fc7614d1c9e66/href</a></iframe><h4>How to use this generator?</h4><p>First of all, install composer <a href="https://github.com/richardDobron/laravel-db-enum-generator">laravel-db-enum-generator</a> package:</p><p>composer require dobron/laravel-db-enum-generator</p><p>Let’s say the <em>user_roles</em> database table has the following structure:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/492/1*Wgep7gTXAQHWcadBY2Xu3g.png" /><figcaption>user_roles table data</figcaption></figure><p>Now call artisan command make:enum.</p><pre># with laravel model<br>php artisan make:enum UserRoleTypes — model=UserRole — id=Id — slug=Slug — title=Role</pre><pre># with laravel model that does not have slug column (will be auto-generated from — title)<br>php artisan make:enum UserRoleTypes — model=UserRole — id=Id — title=Role</pre><pre># with database table<br>php artisan make:enum UserRoleTypes — table=user_roles — id=Id — slug=Slug — title=Role</pre><pre># etc.</pre><p>The UserRoleTypes.php file was generated in the ./app/enums/ directory.<br>If you update the database table, just use the same command with the <em>--force</em> flag to overwrite the file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/71f550c5da0c26f38ad14f5324f78838/href">https://medium.com/media/71f550c5da0c26f38ad14f5324f78838/href</a></iframe><h4>How to find magic numbers in the project?</h4><p>I recommend using a library called <em>PHPMND</em>.</p><p>This stands for PHP Magic Number Detector.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/1*R5hIL-IitaW1s9a3FTJd6Q.gif" /></figure><p>A detailed installation guide can be found at <a href="https://github.com/povils/phpmnd">https://github.com/povils/phpmnd</a></p><p>But if you’re using Composer, here’s how you can install it quickly:</p><pre>composer require --dev povils/phpmnd</pre><p>Once that’s done, you run it like this:</p><pre>phpmnd .</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=63e638932d2c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to easily call JavaScript modules from PHP?]]></title>
            <link>https://medium.com/@dobron/how-to-easily-call-javascript-modules-from-php-48b87d441367?source=rss-676e11d18725------2</link>
            <guid isPermaLink="false">https://medium.com/p/48b87d441367</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[webpack]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Richard Dobroň]]></dc:creator>
            <pubDate>Wed, 13 Jul 2022 16:56:39 GMT</pubDate>
            <atom:updated>2022-07-13T16:57:47.738Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KABVioBzGjrGDBfsHQoZAQ.png" /></figure><p>You have surely solved it many times, but the solution was not very attractive. This tutorial is about generating <em>JavaScript</em> code in <em>PHP</em> using the <strong>BigPipe</strong> library, which is inspired by the Facebook architecture.</p><blockquote>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.</blockquote><h4>Requirements</h4><p>- PHP 7.1 or higher<br>- Node 8, 10+.<br>- Webpack</p><h4>Installation</h4><ol><li>Install composer package:<br>$ composer require richarddobron/bigpipe</li><li>Install npm package:<br>$ npm install bigpipe-util</li><li>Add this lines to /path/to/resources/js/app.js:</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6eb8edafd0216a47a1692f029d8acb7a/href">https://medium.com/media/6eb8edafd0216a47a1692f029d8acb7a/href</a></iframe><p>4. Create file /path/to/resources/js/ServerJS.js<br>- this step is optional, but if you skip it, use this in next step: require(&quot;bigpipe-util/ServerJS&quot;)</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/47ede0eb9dd29a6cf28cb3461994fada/href">https://medium.com/media/47ede0eb9dd29a6cf28cb3461994fada/href</a></iframe><p>5. Add this lines to page footer:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e00cf3f0e1372324bccb437908b504b3/href">https://medium.com/media/e00cf3f0e1372324bccb437908b504b3/href</a></iframe><h3>What all can be Ajaxifed?</h3><p>Links<br>&lt;a href=&quot;#&quot;<br> ajaxify=&quot;/ajax/remove.php&quot;<br> rel=&quot;async&quot;&gt;Remove Item&lt;/a&gt;</p><p>Forms<br>&lt;form action=&quot;/submit.php&quot;<br> method=&quot;POST&quot;<br> rel=&quot;async&quot;&gt;<br> &lt;input name=&quot;user&quot;&gt;<br> &lt;input type=&quot;submit&quot; name=&quot;Done&quot;&gt;<br>&lt;/form&gt;</p><p>Dialogs<br>&lt;a href=&quot;#&quot;<br> ajaxify=&quot;/ajax/modal.php&quot;<br> rel=&quot;dialog&quot;&gt;Open Modal&lt;/a&gt;</p><h4>DOMOPS API</h4><p>- <strong>setContent</strong>: Sets the content of an element.<br>- <strong>appendContent</strong>: Insert content as the last child of specified element.<br>- <strong>prependContent</strong>: Insert content as the first child of specified element.<br>- <strong>insertAfter</strong>: Insert content after specified element.<br>- <strong>insertBefore</strong>: Insert content before specified element.<br>- <strong>remove</strong>: Remove specified element and its children.<br>- <strong>replace</strong>: Replace specified element with content.<br>- <strong>eval</strong>: Evaluates JavaScript code represented as a string.</p><h4>DIALOGS API</h4><p>- <strong>setController</strong>: Sets the JavaScript class controller — if you need to register an extra event listeners (show, shown, hide, hidden) or logic.<br>- <strong>setTitle</strong>: Sets the title of a dialog.<br>- <strong>setBody</strong>: Sets the body of a dialog.<br>- <strong>setFooter</strong>: Sets the footer of a dialog.<br>- <strong>setDialog</strong>: Sets the whole content of a dialog.<br>- <strong>closeDialogs</strong>: Close all opened dialogs.<br>- <strong>closeDialog</strong>: Close only current dialog.<br>- <strong>dialog</strong>: Render defined dialog.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0da4acdb089d5d8182d338951568a8cf/href">https://medium.com/media/0da4acdb089d5d8182d338951568a8cf/href</a></iframe><h4>Refresh &amp; Redirecting</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a3f306e2376ad6e7a7669fd640eaa9c6/href">https://medium.com/media/a3f306e2376ad6e7a7669fd640eaa9c6/href</a></iframe><h4>Payload</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ac1715913c97b69725ec56d9889c0840/href">https://medium.com/media/ac1715913c97b69725ec56d9889c0840/href</a></iframe><h4>BigPipe API</h4><p>- <strong>require</strong>: Call JavaScript module method. You can call a specific class method or a regular function with the custom arguments.</p><p>Example PHP code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/627dbad683efd316ddf5d6712e40f67c/href">https://medium.com/media/627dbad683efd316ddf5d6712e40f67c/href</a></iframe><p>Example JavaScript code:</p><p>export default class SecretModule {<br> run(first, second) {<br> // …<br> }<br>}</p><p>- <strong>dialog</strong>: Opens a dialog but can work with multiple dialogs at once.</p><p>Example PHP code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/954ad70443a0adac933acb3bf326283f/href">https://medium.com/media/954ad70443a0adac933acb3bf326283f/href</a></iframe><p>- <strong>transport</strong>: Through transport markers you can send HTML content but also transform the content into JavaScript objects (such as Map, Set or Element).</p><p>Example PHP code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/34043740f11e1c4da5bcf80e46584bb3/href">https://medium.com/media/34043740f11e1c4da5bcf80e46584bb3/href</a></iframe><h4>Demo app with examples</h4><p>- The demo application is written in Laravel, but this library is framework-agnostic.<br> -⚠️ The demo server does not support <strong>HTTPS</strong>, so you may need to confirm a security exception.</p><p>- <a href="http://bigpipe.xf.cz/">http://bigpipe.xf.cz</a><br>- <a href="https://github.com/richardDobron/bigpipe-php">https://github.com/richardDobron/bigpipe-php</a><br>- <a href="https://github.com/richardDobron/bigpipe-util">https://github.com/richardDobron/bigpipe-util</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*wAx736SqQTUGjbulmXcNRg.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/377/1*g9sJx4KAKDBfYgKYYHyUhg.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/1*umLXVgK5FYPm_AV9EDVEyQ.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/1*Wc53AQZr97I9W5jOO5In4Q.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/1*e0qfyk8QdDOz7R_MqpMTMg.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=48b87d441367" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to add PHP CS Fixer to your project?]]></title>
            <link>https://medium.com/@dobron/how-to-add-php-cs-fixer-to-your-project-a797cd0c6cb2?source=rss-676e11d18725------2</link>
            <guid isPermaLink="false">https://medium.com/p/a797cd0c6cb2</guid>
            <category><![CDATA[code]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[code-style]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Richard Dobroň]]></dc:creator>
            <pubDate>Tue, 12 Jul 2022 18:02:48 GMT</pubDate>
            <atom:updated>2022-07-12T18:02:48.969Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IdlROt_1JyGGO1QLtZ8MzA.png" /></figure><p>First of all, add PHP CS Fixer to your project:</p><pre>composer require --dev friendsofphp/php-cs-fixer</pre><p>A configuration file called .php-cs-fixer.dist.php needs to be in the root directory of your project if you want to avoid command-line options.</p><p>There are many rules that can be set, I usually use these. It follows the PSR12 code standards and checks both the <em>src</em> and <em>tests</em> directories.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/82000d4cb7cde71928c4353c9ba03af5/href">https://medium.com/media/82000d4cb7cde71928c4353c9ba03af5/href</a></iframe><p>You can find more rules in the <a href="https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/doc/rules/index.rst">PHP CS Fixer docs</a>.</p><p>Let’s add a some scripts to <em>composer.json</em> file:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b6d668ab65a68245987190ff119d0cef/href">https://medium.com/media/b6d668ab65a68245987190ff119d0cef/href</a></iframe><p>Now, just run composer run fix-style and all your code style errors will be fixed.</p><p>The <em>— dry-run</em> flag will run the fixer without making changes to your files.</p><p>If you are using <strong>Git</strong>, add .php-cs-fixer.cache (this is the cache file created by php-cs-fixer) to .gitignore:</p><pre>.php-cs-fixer.cache</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a797cd0c6cb2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>