<?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: Joan Alba Maldonado</title>
    <description>The latest articles on DEV Community by Joan Alba Maldonado (@jalbam).</description>
    <link>https://dev.to/jalbam</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%2F100788%2F8d1d628a-e093-420f-a391-1156e893a566.png</url>
      <title>DEV Community: Joan Alba Maldonado</title>
      <link>https://dev.to/jalbam</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jalbam"/>
    <language>en</language>
    <item>
      <title>requestAnimationFrame (with high resolution timing, very precise) and performance.now polyfills</title>
      <dc:creator>Joan Alba Maldonado</dc:creator>
      <pubDate>Mon, 22 Jul 2019 15:18:23 +0000</pubDate>
      <link>https://dev.to/jalbam/requestanimationframe-with-high-resolution-timing-very-precise-and-performance-now-polyfills-20ka</link>
      <guid>https://dev.to/jalbam/requestanimationframe-with-high-resolution-timing-very-precise-and-performance-now-polyfills-20ka</guid>
      <description>&lt;p&gt;Two Vanilla JavaScript polyfills:&lt;/p&gt;

&lt;p&gt;I have just adapted the &lt;a href="https://gist.github.com/paulirish/1579671"&gt;window.requestAnimationFrame polyfill made by Paul Irish&lt;/a&gt; to work with high resolution timing automatically (when possible) and improved the performance a little bit. Here it is: &lt;a href="https://gist.github.com/jalbam/5fe05443270fa6d8136238ec72accbc0"&gt;https://gist.github.com/jalbam/5fe05443270fa6d8136238ec72accbc0&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have also mixed the &lt;a href="https://gist.github.com/paulirish/5438650"&gt;window.performance.now polyfill made by Paul Irish&lt;/a&gt; with &lt;a href="http://%EF%BB%BFgist.github.com/Aldlevine/3f716f447322edbb3671"&gt;Aaron Levine’s&lt;/a&gt; and modified some of the code to improve it. Here it is: &lt;a href="https://gist.github.com/jalbam/cc805ac3cfe14004ecdf323159ecf40e"&gt;https://gist.github.com/jalbam/cc805ac3cfe14004ecdf323159ecf40e&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Both polyfills can be used either separately or together and they will automatically detect whether the web client needs them or not. Just load them in your code (using your favourite way) and, if the client needs them, the polyfills will deploy and be used.&lt;/p&gt;

&lt;p&gt;If you want to use them together, remember to load first the code of the &lt;a href="https://gist.github.com/jalbam/cc805ac3cfe14004ecdf323159ecf40e"&gt;window.performance.now polyfill&lt;/a&gt; since the &lt;a href="https://gist.github.com/jalbam/5fe05443270fa6d8136238ec72accbc0"&gt;window.requestAnimationFrame polyfill&lt;/a&gt; could need it.&lt;/p&gt;

&lt;p&gt;Any comments are welcome!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>polyfill</category>
      <category>requestanimationframe</category>
      <category>performance</category>
    </item>
    <item>
      <title>Unfollow non-followers on Twitter</title>
      <dc:creator>Joan Alba Maldonado</dc:creator>
      <pubDate>Mon, 22 Jul 2019 10:06:45 +0000</pubDate>
      <link>https://dev.to/jalbam/unfollow-non-followers-on-twitter-2ndm</link>
      <guid>https://dev.to/jalbam/unfollow-non-followers-on-twitter-2ndm</guid>
      <description>&lt;p&gt;Here is a JavaScript code to stop following those ones who are not following you back on Twitter and keeping those you want: &lt;a href="https://gist.github.com/jalbam/d7678c32b6f029c602c0bfb2a72e0c26"&gt;https://gist.github.com/jalbam/d7678c32b6f029c602c0bfb2a72e0c26&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will work for new Twitter web site code structure (it was changed from July 2019, causing other unfollow-scripts to stop working).&lt;/p&gt;

&lt;p&gt;Instructions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The code may need to be modified depending on the language of your Twitter web site:

&lt;ul&gt;
&lt;li&gt;For English language web site, no modification needed.&lt;/li&gt;
&lt;li&gt;For Spanish language web site, remember to set the variable ‘LANGUAGE’ to “ES”.&lt;/li&gt;
&lt;li&gt;For another language, remember to set the variable ‘LANGUAGE’ to that language and modify the ‘WORDS’ object to add the words in that language.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Optionally, you can edit the ‘SKIP_USERS’ array to insert those users that you do not want to unfollow (even if they are not following you back).&lt;/li&gt;
&lt;li&gt;When the code is fine, on Twitter web site, go to the section where it shows all the people you are following (&lt;em&gt;&lt;a href="https://twitter.com/YOUR%5C_USERNAME%5C_HERE/following"&gt;https://twitter.com/YOUR\_USERNAME\_HERE/following&lt;/a&gt;&lt;/em&gt;).&lt;/li&gt;
&lt;li&gt;Once there, open the JavaScript console (F12 key, normally), paste all the code there and press enter.&lt;/li&gt;
&lt;li&gt;Wait until you see it has finished. If something goes wrong, reload the page and repeat from the step 3 again. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;NOTE: &lt;strong&gt;STILL NOT SURE ABOUT THE TEXT IN THE CONFIRMATION BUTTON FOR ENGLISH LANGUAGE. LET ME KNOW OR MODIFY IT BY YOURSELF TO THE CORRECT ONE IF NEEDED!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Gist by Joan Alba Maldonado: &lt;a href="https://gist.github.com/jalbam/d7678c32b6f029c602c0bfb2a72e0c26"&gt;https://gist.github.com/jalbam/d7678c32b6f029c602c0bfb2a72e0c26&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thank you very much. Any comments are welcome.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>unfollow</category>
      <category>following</category>
    </item>
    <item>
      <title>AutoHotkey mouse scripts – Play games without a mouse (on a tablet, for example)</title>
      <dc:creator>Joan Alba Maldonado</dc:creator>
      <pubDate>Sun, 03 Feb 2019 12:11:25 +0000</pubDate>
      <link>https://dev.to/jalbam/autohotkey-mouse-scripts--play-games-without-a-mouse-on-a-tablet-for-example-3hnk</link>
      <guid>https://dev.to/jalbam/autohotkey-mouse-scripts--play-games-without-a-mouse-on-a-tablet-for-example-3hnk</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/jalbam/AutoHotkey_mouse_scripts"&gt;Here&lt;/a&gt; you have simple &lt;a href="https://autohotkey.com/"&gt;AutoHotkey&lt;/a&gt; scripts that will perform some actions by using the mouse.&lt;/p&gt;

&lt;p&gt;I made these scripts for myself to be able to play some games in a tablet which lacks of a physical keyboard but has a mouse attached. This way I can exit the games, show their menus, show an on-screen keyboard (which does not work well with some games when they are running in full-screen mode, sadly), etc. by just using the mouse.&lt;/p&gt;

&lt;p&gt;Hopefully, they could also be useful for someone else so I decided to share them.&lt;/p&gt;

&lt;p&gt;They were tested on both 32 and 64-bit version of Microsoft Windows 10 (tablet and desktop) as well as on 32-bit versions of Microsoft Windows XP (with Service Pack 1) and Microsoft Windows 7. If, after trying a binariy (32-bit version and also 64-bit versions if any), it does not work on your Windows version then you can try to compile it from the source code provided. Please, have in mind that not all Windows versions have “tabtip.exe” or “osk.exe” files.&lt;/p&gt;

&lt;p&gt;They can be found on GitHub: &lt;a href="https://github.com/jalbam/AutoHotkey_mouse_scripts"&gt;https://github.com/jalbam/AutoHotkey_mouse_scripts&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Included scripts
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;pressEsc_32&lt;/strong&gt; – It will press the “ESC” (&lt;em&gt;ESCAPE&lt;/em&gt;) key when the mouse wheel button (the middle button) is pressed. Compiled for 32-bit but it should also run on 64-bit versions of Microsoft Windows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;pressF5_32&lt;/strong&gt; – It will press the “F5” key when the mouse wheel button (the middle button) is pressed. Compiled for 32-bit but it should also run on 64-bit versions of Microsoft Windows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;pressF10_32&lt;/strong&gt; – It will press the “F10” key when the mouse wheel button (the middle button) is pressed. Compiled for 32-bit but it should also run on 64-bit versions of Microsoft Windows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;showOSK_32&lt;/strong&gt; – If available in the operating system, it will show the “OSK” (&lt;em&gt;osk.exe&lt;/em&gt;) which belongs to the “On Screen Keyboard” (“floating” around the screen, as an independent window) when the mouse wheel button (the middle button) is pressed. Compiled for 32-bit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;showOSK_64&lt;/strong&gt; – The same as “showOSK_32” but for 64-bit versions of Microsoft Windows. Use it in the case that you get &lt;a href="https://autohotkey.com/board/topic/119602-the-system-cannot-find-the-file-specified/"&gt;an error&lt;/a&gt; using the “showOSK_32” version.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;showTabTip_32&lt;/strong&gt; – If available in the operating system, it will show the “TabTip” (&lt;em&gt;tabtip.exe&lt;/em&gt;) which also belongs to an on-screen keyboad (different from the “osk.exe” one) when the mouse wheel button (the middle button) is pressed. Compiled for 32-bit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;showTabTip_64&lt;/strong&gt; – The same as “showTabTip_32” but for 64-bit versions of Microsoft Windows. Use it in the case that you get &lt;a href="https://autohotkey.com/board/topic/119602-the-system-cannot-find-the-file-specified/"&gt;an error&lt;/a&gt; using the “showTabTip_32” version.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to run
&lt;/h2&gt;

&lt;p&gt;To use the already-compiled binaries, just run them as any other normal program. While they are running, an icon will be shown in the taskbar.&lt;/p&gt;

&lt;p&gt;Note that, if desired, more than one script can be run at the same time to be combined.&lt;/p&gt;

&lt;h2&gt;
  
  
  Compile from the source code
&lt;/h2&gt;

&lt;p&gt;Apart from the binaries for Microsoft Windows, the source code is included so they can be easily modified to edit the actions performed, enhance features, etc.&lt;/p&gt;

&lt;p&gt;To compile from the source code, the &lt;a href="https://autohotkey.com/"&gt;AutoHotkey&lt;/a&gt; software will be needed.&lt;/p&gt;

&lt;h2&gt;
  
  
  License
&lt;/h2&gt;

&lt;p&gt;This project can be used, reproduced, distributed and modified freely for any non-commercial purposes but always keeping the author’s name and copyright clauses. Other than that, just use this project as you wish but never sell it!&lt;/p&gt;

</description>
      <category>games</category>
      <category>gaming</category>
      <category>tool</category>
      <category>utility</category>
    </item>
    <item>
      <title>NW.js port for Raspberry Pi</title>
      <dc:creator>Joan Alba Maldonado</dc:creator>
      <pubDate>Mon, 07 Jan 2019 11:30:07 +0000</pubDate>
      <link>https://dev.to/jalbam/nwjs-port-for-raspberry-pi-7lg</link>
      <guid>https://dev.to/jalbam/nwjs-port-for-raspberry-pi-7lg</guid>
      <description>

&lt;p&gt;There is a &lt;a href="http://nwjs.io/"&gt;NW.js (formerly node-webkit)&lt;/a&gt; binary compiled for the &lt;strong&gt;ARMv6&lt;/strong&gt; used by Raspberry Pi. It also runs on Raspberry Pi 2 and Raspberry Pi 3 since they are backward compatible with ARMv6. Other compatible hardware should also be able to run this binary.&lt;/p&gt;

&lt;p&gt;It can be found on GitHub: &lt;a href="https://github.com/jalbam/nwjs_rpi"&gt;https://github.com/jalbam/nwjs_rpi&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Instructions
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;You need a &lt;em&gt;package.nw&lt;/em&gt;&lt;/strong&gt; which is just a &lt;em&gt;.zip&lt;/em&gt; file with &lt;em&gt;.nw&lt;/em&gt; extension that contains your project (at least, it needs an &lt;em&gt;index.html&lt;/em&gt; and a &lt;em&gt;package.json&lt;/em&gt; inside). The included &lt;em&gt;package.nw&lt;/em&gt; is just an example using the &lt;a href="https://github.com/jalbam/yasminoku"&gt;Yasminoku&lt;/a&gt; game. Since this is only a port, if you need it you can go to the &lt;a href="http://nwjs.io/"&gt;official web site of NW.js&lt;/a&gt; and read the documentation to know more about &lt;em&gt;package.nw&lt;/em&gt;, &lt;em&gt;package.json&lt;/em&gt;, etc.&lt;/li&gt;
&lt;li&gt;Optional: &lt;strong&gt;merge &lt;em&gt;nw&lt;/em&gt; and &lt;em&gt;package.nw&lt;/em&gt;&lt;/strong&gt; into a single file with the following command:&lt;/li&gt;
&lt;/ol&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat nw package.nw &amp;gt; Your_new_binary_file
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Edit &lt;em&gt;fix_libudev.so.0&lt;/em&gt; and &lt;em&gt;fix_libudev.so.1&lt;/em&gt;&lt;/strong&gt; and replace &lt;em&gt;Your_new_binary_file&lt;/em&gt; found in their code by the real name of your binary file (if you did not merge &lt;em&gt;nw&lt;/em&gt; and &lt;em&gt;package.nw&lt;/em&gt; together, then replace it by just &lt;em&gt;nw&lt;/em&gt;).&lt;/li&gt;
&lt;li&gt;If you need it, &lt;strong&gt;give executable permissions&lt;/strong&gt; (and other desired permissions) to &lt;em&gt;Your_new_binary_file&lt;/em&gt; (or &lt;em&gt;nw&lt;/em&gt;) using the &lt;strong&gt;&lt;em&gt;chmod&lt;/em&gt;&lt;/strong&gt; command (as root).&lt;/li&gt;
&lt;li&gt;Try to &lt;strong&gt;run the binary&lt;/strong&gt; :&lt;/li&gt;
&lt;/ol&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./Your_new_binary_file
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;If you did not merge the &lt;em&gt;nw&lt;/em&gt; and &lt;em&gt;package.nw&lt;/em&gt; files in one single file (as explained in &lt;em&gt;step 2&lt;/em&gt;), you should run this command instead:&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./nw
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;In the case the system complains about &lt;strong&gt;&lt;em&gt;libudev.so.0&lt;/em&gt;&lt;/strong&gt; when you try to run the binary, just type the following command:&lt;/li&gt;
&lt;/ol&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./fix_libudev.so.0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Likewise, if needed, do the same for &lt;strong&gt;&lt;em&gt;libudev.so.1&lt;/em&gt;&lt;/strong&gt; running this:&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./fix_libudev.so.1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Note: these two commands above will only work if you have followed the &lt;em&gt;step 3&lt;/em&gt; properly before. Each of them only needs to be executed once and never again.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;If all works well, you can &lt;strong&gt;distribute your project&lt;/strong&gt;. You will need these files at least (in the same folder): &lt;em&gt;libffmpegsumo.so&lt;/em&gt;, &lt;em&gt;nw.pak&lt;/em&gt; and &lt;em&gt;Your_new_binary_file&lt;/em&gt; (or &lt;em&gt;nw&lt;/em&gt; and &lt;em&gt;package.nw&lt;/em&gt; instead). I would recommend including &lt;em&gt;fix_libudev.so.0&lt;/em&gt; and &lt;em&gt;fix_libudev.so.1&lt;/em&gt; optionally (modified as explained in &lt;em&gt;step 3&lt;/em&gt;) if you think others might need them.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Versions
&lt;/h2&gt;

&lt;p&gt;node-webkit (now called NW.js) version: v.0.7.0-pre&lt;/p&gt;

&lt;p&gt;Node.js version: v0.10.12&lt;/p&gt;

&lt;h2&gt;
  
  
  Tested on
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;“ &lt;strong&gt;Raspberry Pi Model B&lt;/strong&gt; Revision 2.0 Mounting holes” with 512MB RAM (000e revision) using &lt;strong&gt;Raspbian GNU/Linux 7 “wheezy”&lt;/strong&gt; (Linux raspberrypi &lt;strong&gt;4.1.19+ #858 armv6l&lt;/strong&gt; GNU/Linux).&lt;/li&gt;
&lt;li&gt;“ &lt;strong&gt;Raspberry Pi 2 Model B&lt;/strong&gt; PCB Revision 1.1″ with 1024MB RAM (a01041 revision) using &lt;strong&gt;Raspbian GNU/Linux 8 “jessie”&lt;/strong&gt; (Linux raspberrypi &lt;strong&gt;4.9.35-v7+ #1014 SMP armv7l&lt;/strong&gt; GNU/Linux).&lt;/li&gt;
&lt;li&gt;“ &lt;strong&gt;Raspberry Pi 3 Model B&lt;/strong&gt; PCB Revision 1.2″ with 1024MB RAM (a02082 revision) using &lt;strong&gt;Raspbian GNU/Linux 8 “jessie”&lt;/strong&gt; (Linux raspberrypi &lt;strong&gt;4.1.19-v7+ #858 SMP armv7l&lt;/strong&gt; GNU/Linux).&lt;/li&gt;
&lt;li&gt;“ &lt;strong&gt;Raspberry Pi Zero W&lt;/strong&gt; PCB Revision 1.1″ with 512MB RAM (9000c1 revision) using &lt;strong&gt;Raspbian GNU/Linux 9 “stretch”&lt;/strong&gt; (Linux raspberrypi &lt;strong&gt;4.14.71+ #1145 SMP armv6l&lt;/strong&gt; GNU/Linux).&lt;/li&gt;
&lt;li&gt;“ &lt;strong&gt;Raspberry Pi 3 Model B+&lt;/strong&gt; PCB Revision 1.3″ with 1024MB RAM (a020d3 revision) using &lt;strong&gt;Raspbian GNU/Linux 9 “stretch”&lt;/strong&gt; (Linux raspberrypi &lt;strong&gt;4.14.71-v7+ #1145 SMP armv7l&lt;/strong&gt; GNU/Linux).&lt;/li&gt;
&lt;li&gt;“&lt;strong&gt;Orange Pi Zero (Allwinner H2+)&lt;/strong&gt;” with 512MB RAM (hardware sun8i, 0000 revision) using &lt;strong&gt;Raspbian GNU/Linux 8 “jessie”&lt;/strong&gt; (Linux OrangePizero &lt;strong&gt;3.4.39 #2 SMP PREEMPT armv7l&lt;/strong&gt; GNU/Linux).&lt;/li&gt;
&lt;li&gt;“&lt;strong&gt;Orange Pi Zero Plus2 (Allwinner H3)&lt;/strong&gt;” with 512MB RAM (hardware sun8i, 0000 revision) using &lt;strong&gt;Raspbian GNU/Linux 8 “jessie”&lt;/strong&gt; (Linux OrangePI &lt;strong&gt;3.4.112-opi #1 SMP PREEMPT armv7l&lt;/strong&gt; GNU/Linux).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Compatibility
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Raspberry Pi Zero&lt;/strong&gt; , all models&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Raspberry Pi&lt;/strong&gt; , all models&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Raspberry Pi 2&lt;/strong&gt; , all models&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Raspberry Pi 3&lt;/strong&gt; , all models&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Other devices&lt;/strong&gt; with compatible hardware (Orange Pi, Banana Pi, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Credits
&lt;/h2&gt;

&lt;p&gt;The original binary was shared by &lt;a href="https://github.com/piksel"&gt;Nils Måsén “piksel” (aka “spaculo”)&lt;/a&gt; at &lt;a href="https://www.youtube.com/watch?v=MqNUYk9Y8jY"&gt;https://www.youtube.com/watch?v=MqNUYk9Y8jY&lt;/a&gt; so thank you very much! &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DvXCaIjD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s.w.org/images/core/emoji/11/72x72/1f642.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DvXCaIjD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://s.w.org/images/core/emoji/11/72x72/1f642.png" alt="🙂"&gt;&lt;/a&gt;&lt;/p&gt;


</description>
      <category>raspberrypi</category>
      <category>nwjs</category>
      <category>nodewebkit</category>
      <category>javascript</category>
    </item>
    <item>
      <title>sockjs_test_server_nwjs – SockJS test server on NW.js</title>
      <dc:creator>Joan Alba Maldonado</dc:creator>
      <pubDate>Sun, 09 Dec 2018 14:14:41 +0000</pubDate>
      <link>https://dev.to/jalbam/sockjstestservernwjs--sockjs-test-server-on-nwjs-5d63</link>
      <guid>https://dev.to/jalbam/sockjstestservernwjs--sockjs-test-server-on-nwjs-5d63</guid>
      <description>&lt;p&gt;“&lt;a href="https://github.com/jalbam/sockjs_test_server_nwjs" rel="noopener noreferrer"&gt;sockjs_test_server_nwjs&lt;/a&gt;” is just a simple &lt;a href="https://github.com/sockjs" rel="noopener noreferrer"&gt;SockJS&lt;/a&gt; server running on &lt;a href="https://nodejs.org/" rel="noopener noreferrer"&gt;Node.js&lt;/a&gt; but using &lt;a href="https://nwjs.io/" rel="noopener noreferrer"&gt;NW.js (formerly node-webkit)&lt;/a&gt; to provide a simple visual interface for testing purposes. It was made on 29th July 2016 (approximately).&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/http%3A%2F%2Fjoanalbamaldonado.com%2Fblog%2Fwp-content%2Fuploads%2F2018%2F12%2Fsockjs_screenshot.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/http%3A%2F%2Fjoanalbamaldonado.com%2Fblog%2Fwp-content%2Fuploads%2F2018%2F12%2Fsockjs_screenshot.gif"&gt;&lt;/a&gt;Screenshot&lt;/p&gt;

&lt;p&gt;The default listening port is set to &lt;em&gt;9999&lt;/em&gt; but can be modified easily.&lt;/p&gt;

&lt;p&gt;It comes with a self-extracting single-file binary for Windows 32-bit (using &lt;a href="https://www.7-zip.org/links.html" rel="noopener noreferrer"&gt;7zip&lt;/a&gt;‘s SFX) that runs on Windows XP with SP2 (Service Pack 2) minimum and also on newer Windows versions as Windows 10 (generated with &lt;a href="https://github.com/jyapayne/Web2Executable" rel="noopener noreferrer"&gt;Web2Executable&lt;/a&gt;) but also includes the source code so it can be ported to other platforms supported by &lt;a href="https://nwjs.io/" rel="noopener noreferrer"&gt;NW.js&lt;/a&gt; easily.&lt;/p&gt;

&lt;p&gt;It can be found on GitHub: &lt;a href="https://github.com/jalbam/sockjs_test_server_nwjs" rel="noopener noreferrer"&gt;https://github.com/jalbam/sockjs_test_server_nwjs&lt;/a&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>javascript</category>
      <category>sockets</category>
      <category>server</category>
    </item>
    <item>
      <title>fake_rest_server – REST server in PHP</title>
      <dc:creator>Joan Alba Maldonado</dc:creator>
      <pubDate>Fri, 30 Nov 2018 15:53:48 +0000</pubDate>
      <link>https://dev.to/jalbam/fakerestserver--rest-server-in-php-19la</link>
      <guid>https://dev.to/jalbam/fakerestserver--rest-server-in-php-19la</guid>
      <description>&lt;p&gt;“&lt;a href="https://github.com/jalbam/fake_rest_server" rel="noopener noreferrer"&gt;fake_rest_server&lt;/a&gt;” is a simple and easy-to-configure REST server made in PHP.&lt;/p&gt;

&lt;p&gt;I made it just to create different REST servers very fast for testing purposes.&lt;/p&gt;

&lt;p&gt;It can be found on GitHub: &lt;a href="https://github.com/jalbam/fake_rest_server" rel="noopener noreferrer"&gt;https://github.com/jalbam/fake_rest_server&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Configuring the server
&lt;/h2&gt;

&lt;p&gt;To add new paths (routes) and methods, the developer just needs to create a new folder structure (folder and subfolders if needed) which represents the route and inside one file per method named &lt;em&gt;[method_desired].php&lt;/em&gt; (for example, &lt;em&gt;put.php&lt;/em&gt;).&lt;/p&gt;

&lt;p&gt;To start developing your REST server, you will only need to download the files inside the &lt;strong&gt;&lt;a href="https://github.com/jalbam/fake_rest_server/blob/master/src" rel="noopener noreferrer"&gt;src/&lt;/a&gt;&lt;/strong&gt; folder.&lt;/p&gt;

&lt;p&gt;You may want to take a look at the &lt;strong&gt;&lt;a href="https://github.com/jalbam/fake_rest_server/blob/master/src/_code/functions.php" rel="noopener noreferrer"&gt;src/_code/functions.php&lt;/a&gt;&lt;/strong&gt; file (the engine will include it automatically) as it provides some basic but useful functions. There you can also add new functions or modify the existing ones.&lt;/p&gt;

&lt;p&gt;If you want to add data, you can use the &lt;strong&gt;&lt;a href="https://github.com/jalbam/fake_rest_server/blob/master/src/_code/data/data.php" rel="noopener noreferrer"&gt;src/_code/data/data.php&lt;/a&gt;&lt;/strong&gt; file (automatically included by the engine).&lt;/p&gt;

&lt;p&gt;If you want to add configuration data, you can use the &lt;strong&gt;&lt;a href="https://github.com/jalbam/fake_rest_server/blob/master/src/_code/config.php" rel="noopener noreferrer"&gt;src/_code/config.php&lt;/a&gt;&lt;/strong&gt; file (automatically included by the engine).&lt;/p&gt;

&lt;p&gt;As the engine defines the &lt;strong&gt;USING_REST_SERVER&lt;/strong&gt; constant, you can protect any of the files with the following line at the beginning:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nb"&gt;defined&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"USING_REST_SERVER"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="no"&gt;USING_REST_SERVER&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note: this authorization code above is also defined in the &lt;strong&gt;AUTHORIZATION_CODE&lt;/strong&gt; constant (inside the the &lt;strong&gt;&lt;a href="https://github.com/jalbam/fake_rest_server/blob/master/src/_code/config.php" rel="noopener noreferrer"&gt;src/_code/config.php&lt;/a&gt;&lt;/strong&gt; file).&lt;/p&gt;

&lt;h3&gt;
  
  
  Example:
&lt;/h3&gt;

&lt;p&gt;1) In the root folder (where the &lt;strong&gt;&lt;a href="https://github.com/jalbam/fake_rest_server/blob/master/src/_code/" rel="noopener noreferrer"&gt;src/_code/&lt;/a&gt;&lt;/strong&gt; folder and the &lt;strong&gt;&lt;a href="https://github.com/jalbam/fake_rest_server/blob/master/src/index.php" rel="noopener noreferrer"&gt;src/index.php&lt;/a&gt;&lt;/strong&gt; file are placed), create a folder called &lt;strong&gt;myRESTService/&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;2) Inside the &lt;strong&gt;myRESTService/&lt;/strong&gt; folder we have just created, create another folder called &lt;strong&gt;user/&lt;/strong&gt; and inside of it create two files: &lt;strong&gt;index.php&lt;/strong&gt; and &lt;strong&gt;get.php&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;3) Inside the &lt;strong&gt;myRESTService/user/index.php&lt;/strong&gt; file, place the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;
    &lt;span class="c1"&gt;//Users info (this could be in the "src/_code/config.php" file, but it is just an example):&lt;/span&gt;
    &lt;span class="nv"&gt;$usersData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;Array&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="c1"&gt;//User IDs:&lt;/span&gt;
        &lt;span class="s2"&gt;"1"&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
            &lt;span class="k"&gt;Array&lt;/span&gt;
            &lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="s2"&gt;"name"&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"John Doe"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s2"&gt;"favouriteFood"&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"meat"&lt;/span&gt;
            &lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="s2"&gt;"2"&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
            &lt;span class="k"&gt;Array&lt;/span&gt;
            &lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="s2"&gt;"name"&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"Joan Alba Maldonado"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="s2"&gt;"favouriteFood"&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"pizza"&lt;/span&gt;
            &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;//Gets the data needed which has been sent through the REST client:&lt;/span&gt;
    &lt;span class="nv"&gt;$userId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;getVariable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;//"getVariable" and other functions available in the "src/_code/functions.php" file.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4) Inside the &lt;strong&gt;myRESTService/user/get.php&lt;/strong&gt; file put the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$userId&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"No id sent!"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;array_key_exists&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$userId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$usersData&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$usersData&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;$userId&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s2"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="s2"&gt;" likes eating "&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="nv"&gt;$usersData&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;$userId&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s2"&gt;"favouriteFood"&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"User cannot be found! (id="&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="nv"&gt;$userId&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="s2"&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;p&gt;5) With this, we will have our REST server configured with the &lt;strong&gt;myRESTService/user/&lt;/strong&gt; route, accepting the &lt;strong&gt;GET&lt;/strong&gt; method with the &lt;strong&gt;id&lt;/strong&gt; parameter. This example can be found in the &lt;strong&gt;&lt;a href="https://github.com/jalbam/fake_rest_server/blob/master/example_easy" rel="noopener noreferrer"&gt;example_easy/&lt;/a&gt;&lt;/strong&gt; folder.&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing the server
&lt;/h2&gt;

&lt;p&gt;If you do not have a REST client, the server can be tested on any web browser by adding the &lt;strong&gt;debug=1&lt;/strong&gt; parameter to the URL as well as the &lt;strong&gt;method&lt;/strong&gt; parameter with the method desired (not needed if the method is &lt;strong&gt;GET&lt;/strong&gt; ), as for example: &lt;em&gt;&lt;a href="http://localhost/fake%5C_rest%5C_server/src/index.php/route%5C_1/subroute?method=post&amp;amp;debug=1&amp;amp;username=Joan" rel="noopener noreferrer"&gt;http://localhost/fake\_rest\_server/src/index.php/route\_1/subroute?method=post&amp;amp;debug=1&amp;amp;username=Joan&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Following the example above, you can use a web browser to visit the following links:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="http://localhost/route%5C_to%5C_the%5C_REST%5C_server/index.php/myRESTService/user/?method=get&amp;amp;debug=1&amp;amp;id=1" rel="noopener noreferrer"&gt;http://localhost/route\_to\_the\_REST\_server/index.php/myRESTService/user/?method=get&amp;amp;debug=1&amp;amp;id=1&lt;/a&gt;&lt;/em&gt; (it should show “John Doe likes eating meat”)&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="http://localhost/route%5C_to%5C_the%5C_REST%5C_server/index.php/myRESTService/user/?method=get&amp;amp;debug=1&amp;amp;id=2" rel="noopener noreferrer"&gt;http://localhost/route\_to\_the\_REST\_server/index.php/myRESTService/user/?method=get&amp;amp;debug=1&amp;amp;id=2&lt;/a&gt;&lt;/em&gt; (it should show “Joan Alba Maldonado likes eating pizza”)&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="http://localhost/route%5C_to%5C_the%5C_REST%5C_server/index.php/myRESTService/user/?method=get&amp;amp;debug=1&amp;amp;id=3" rel="noopener noreferrer"&gt;http://localhost/route\_to\_the\_REST\_server/index.php/myRESTService/user/?method=get&amp;amp;debug=1&amp;amp;id=3&lt;/a&gt;&lt;/em&gt; (it should show “User cannot be found! (id=3)”)&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="http://localhost/route%5C_to%5C_the%5C_REST%5C_server/index.php/myRESTService/user/?method=get&amp;amp;debug=1" rel="noopener noreferrer"&gt;http://localhost/route\_to\_the\_REST\_server/index.php/myRESTService/user/?method=get&amp;amp;debug=1&lt;/a&gt;&lt;/em&gt; (it should show “No id sent!”)&lt;/p&gt;

&lt;p&gt;Note that the “&lt;em&gt;/&lt;/em&gt;” character at the end of the route is optional.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final comments
&lt;/h2&gt;

&lt;p&gt;It is very easy to extend using PHP language. The project already includes some examples with routes, methods, functions and data as user accounts, etc. as examples (in both the &lt;strong&gt;&lt;a href="https://github.com/jalbam/fake_rest_server/blob/master/example" rel="noopener noreferrer"&gt;example/&lt;/a&gt;&lt;/strong&gt; and the &lt;strong&gt;&lt;a href="https://github.com/jalbam/fake_rest_server/blob/master/example_easy" rel="noopener noreferrer"&gt;example_easy/&lt;/a&gt;&lt;/strong&gt; folder) but they can be deleted.&lt;/p&gt;

&lt;p&gt;The only really-needed code is located in the &lt;strong&gt;&lt;a href="https://github.com/jalbam/fake_rest_server/blob/master/src/" rel="noopener noreferrer"&gt;src/&lt;/a&gt;&lt;/strong&gt; folder. Inside of it, the &lt;strong&gt;&lt;a href="https://github.com/jalbam/fake_rest_server/blob/master/src/route_1" rel="noopener noreferrer"&gt;route_1/&lt;/a&gt;&lt;/strong&gt; folder and all of its content can also be deleted since it is just an example.&lt;/p&gt;

&lt;h2&gt;
  
  
  License
&lt;/h2&gt;

&lt;p&gt;This project can be used, reproduced, distributed and modified freely for any non-commercial purposes but always keeping the author’s name and copyright clauses. Other than that, just use this project as you wish but never sell it!&lt;/p&gt;

</description>
      <category>rest</category>
      <category>server</category>
      <category>php</category>
      <category>library</category>
    </item>
    <item>
      <title>EASPM123 – Get rid of spam emails!</title>
      <dc:creator>Joan Alba Maldonado</dc:creator>
      <pubDate>Sun, 18 Nov 2018 14:39:58 +0000</pubDate>
      <link>https://dev.to/jalbam/easpm123--get-rid-of-spam-emails-2p9p</link>
      <guid>https://dev.to/jalbam/easpm123--get-rid-of-spam-emails-2p9p</guid>
      <description>

&lt;p&gt;&lt;a href="https://github.com/jalbam/easpm123"&gt;EASPM123 (Email Anti-Spam 123)&lt;/a&gt; is an Easy-to-use JavaScript API that protects any email address you want to use in your website from spambots. First version (1.0) was released in November 2015.&lt;/p&gt;

&lt;p&gt;It works in any browser with JavaScript support, even old ones (including Internet Explorer 5.0), offers different security options (very configurable) and it is just 2.57 KiB minified. If you want, you can easily configure it to be used with many languages at the same time.&lt;/p&gt;

&lt;p&gt;Despite of this, this script should consider as a way to improve safety against spambots but not the unique method. A good anti-spam for your email (server or client) is still always recommended.&lt;/p&gt;

&lt;p&gt;It can be found on GitHub: &lt;a href="https://github.com/jalbam/easpm123"&gt;https://github.com/jalbam/easpm123&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;Basic idea&lt;/h2&gt;

&lt;p&gt;The basic idea is to disguise the email address by modifying it using a text that will be removed by the script when the desired JavaScript events are fired (or, if desired, automatically when the document is loaded).&lt;/p&gt;

&lt;p&gt;Most spambots will not fire those JavaScript events or, even if they did it, many of the times will not catch the email address after doing it but the previously-shown email address (so they will end with a non-valid email address which includes the text that should have been removed).&lt;/p&gt;

&lt;p&gt;The text to be removed should be human-understandable so that a human being could figure out the real email in the case that JavaScript was disabled or something failed. Under these circumstances, to help any human-being to figure out the real email address, this script uses the so-called “&lt;em&gt;without-no-spam&lt;/em&gt;” elements which are elements containing the instructions that the human-being should follow to get the real email address. These “&lt;em&gt;without-no-spam&lt;/em&gt;” elements will be removed automatically by the script if JavaScript is available.&lt;/p&gt;

&lt;p&gt;As nowadays many spambots can already translate “&lt;em&gt;AT&lt;/em&gt;” and “&lt;em&gt;DOT&lt;/em&gt;” to &lt;em&gt;“@”&lt;/em&gt; and &lt;em&gt;“.”&lt;/em&gt; respetively, to improve safety this script provides a way to translate any desired text to the &lt;em&gt;AT&lt;/em&gt; (&lt;em&gt;@&lt;/em&gt;) symbol. The key here is to use a non-so-famous text that no spambot will understand at all.&lt;/p&gt;

&lt;p&gt;There are different ways to use this script detailed below, some safer than others. Please, continue reading.&lt;/p&gt;

&lt;h2&gt;Usage&lt;/h2&gt;

&lt;p&gt;You can download the project from GitHub directly to include it in your project or you can also use one of the following commands while you are in your project:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bower&lt;/strong&gt; :&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bower install easpm123

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



&lt;p&gt;&lt;strong&gt;Yarn&lt;/strong&gt; :&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn add easpm123

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



&lt;p&gt;&lt;strong&gt;npm&lt;/strong&gt; (it will need a &lt;em&gt;package.json&lt;/em&gt;):&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i easpm123

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



&lt;p&gt;The behaviour can be configured easily through the main (and unique) object the script uses (for more information, you can read the instructions in &lt;a href="http://htmlpreview.github.io/?https://github.com/jalbam/easpm123/blob/master/README.htm"&gt;README.htm&lt;/a&gt;). But if you are lazy, although it would be less safe, you just need to include the .js file in your website and change the class name (or add to the current classes a new one) of the elements containing the links to the emails (the class name should be “easpm123” by default).&lt;/p&gt;

&lt;p&gt;In order to start using this API, the “.js” file you choose (for example, &lt;a href="https://github.com/jalbam/easpm123/blob/master/easpm123_min.js"&gt;easpm123_min.js&lt;/a&gt; which is already minified) must be included in your document. The most common way to do this is by using a &lt;strong&gt;&lt;/strong&gt; tag:&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- NOTE: Edit the "src" property to point to the right location of the .js file: --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"easpm123_min.js"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text/javascript"&lt;/span&gt; &lt;span class="na"&gt;language=&lt;/span&gt;&lt;span class="s"&gt;"javascript"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

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



&lt;p&gt;If we decide to use the main (and unique) object, this is how it looks like:&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;EASPM123&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nx"&gt;autoLoad&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="c1"&gt;//Next values can be set to null to force using default ones or use&lt;/span&gt;
    &lt;span class="c1"&gt;//an empty array if you do not want any value at all:&lt;/span&gt;
    &lt;span class="nx"&gt;linkClasses&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;withoutNoSpamElementClasses&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;linkIDs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;withoutNoSpamElementIDs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;textsToClear&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;atSymbolAliases&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;eventNames&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

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



&lt;p&gt;The parameters accepted are the following ones:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Parameter&lt;/th&gt;
&lt;th&gt;Type&lt;/th&gt;
&lt;th&gt;Default value&lt;/th&gt;
&lt;th&gt;Mandatory?&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;autoLoad&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;boolean&lt;/td&gt;
&lt;td&gt;true&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;If it is set to true, the script will be loaded automatically (the &lt;strong&gt;run&lt;/strong&gt; method will not be needed to be called) when the document is ready. If it is set to false, all the rest of parameters will be ignored and they will need to be used in the &lt;strong&gt;run&lt;/strong&gt; method instead.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;linkClasses&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;array of strings&lt;/td&gt;
&lt;td&gt;[“easpm123”]&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Class names used by the tags (which contain a link to an email address) that will be affected.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;withoutNoSpamElementClasses&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;array of strings&lt;/td&gt;
&lt;td&gt;[“easpm123_label”]&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Class names of the “&lt;em&gt;without-no-spam&lt;/em&gt;” elements that will be removed.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;linkIDs&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;array of strings&lt;/td&gt;
&lt;td&gt;[“easpm123”]&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;IDs used by the tags (which contain a link to an email address) that will be affected.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;withoutNoSpamElementIDs&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;array of strings&lt;/td&gt;
&lt;td&gt;[“easpm123_label”]&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;IDs used by the “&lt;em&gt;without-no-spam&lt;/em&gt;” elements that will be removed.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;textsToClear&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;array of strings&lt;/td&gt;
&lt;td&gt;[“NO_SPAM_WELCOME”]&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Texts to be removed (case sensitive) from the email address.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;atSymbolAliases&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;array of strings&lt;/td&gt;
&lt;td&gt;[“{&lt;em&gt;AT_HERE&lt;/em&gt;}”]&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Texts that will be replaced by the &lt;em&gt;AT&lt;/em&gt; (&lt;em&gt;@&lt;/em&gt;) symbol.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;eventNames&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;array of strings&lt;/td&gt;
&lt;td&gt;[“mouseover”, “click”, “touchstart”]&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Events that will fire the script. Those events will be attached to all affected tags (which contain a link to an email address) and also to all the affected “&lt;em&gt;without-no-spam&lt;/em&gt;” elements. Use an empty array to run the script automatically without events.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Note that, except for the first parameter ( &lt;strong&gt;autoLoad&lt;/strong&gt; ), all the rest of the parameters can accept the &lt;strong&gt;null&lt;/strong&gt; value if we want to use their default value or can also accept an empty array (as for example the &lt;strong&gt;[]&lt;/strong&gt; value) in the case that we do not want any value at all. In the case of the last parameter ( &lt;strong&gt;eventNames&lt;/strong&gt; ), using an empty array will force the script to run its magic automatically without having to fire any event (not recommended as the safety would be decreased).&lt;/p&gt;

&lt;p&gt;If the &lt;strong&gt;autoLoad&lt;/strong&gt; parameter is set to false (not recommended), the rest of parameters will be ignored and the &lt;strong&gt;run&lt;/strong&gt; method will have to be called manually when desired (always after the document has been loaded!). This method accepts the same parameters as the main object except the first one (it does not need the &lt;strong&gt;autoLoad&lt;/strong&gt; parameter). Read below to see an example showing how to use it.&lt;/p&gt;

&lt;p&gt;Have in mind that, as soon as the script is included, it will run itself once with the default options. We can run it again (through either the main object or the &lt;strong&gt;run&lt;/strong&gt; method), if desired, after that.&lt;/p&gt;

&lt;p&gt;The main object can only be used before the &lt;strong&gt;onload&lt;/strong&gt; event of the &lt;strong&gt;window&lt;/strong&gt; object is fired. If we want to run the script after that, we need to use the &lt;strong&gt;run&lt;/strong&gt; method instead. In fact, the &lt;strong&gt;run&lt;/strong&gt; method can only be used after the &lt;strong&gt;onload&lt;/strong&gt; event of the &lt;strong&gt;window&lt;/strong&gt; object is fired.&lt;/p&gt;

&lt;p&gt;See the examples below for more information.&lt;/p&gt;

&lt;h3&gt;Example #1 – Easiest way for the developer (not so safe), with just HTML:&lt;/h3&gt;

&lt;p&gt;Note that, after the script is included, it immediately modifies the &lt;strong&gt;onload&lt;/strong&gt; event of the &lt;strong&gt;window&lt;/strong&gt; object (keeping any previous event, so it will not override anything) to execute itself after some milliseconds (it does not do it immediately to get rid of some spambots which will not have this into account). If, during the time between the inclusion of the script and the milliseconds (100 by default) before its executed itself, the &lt;strong&gt;onload&lt;/strong&gt; event of the &lt;strong&gt;window&lt;/strong&gt; object is overrided, this example will simply not work.&lt;/p&gt;

&lt;p&gt;This way, any tag whose &lt;strong&gt;id&lt;/strong&gt; is &lt;strong&gt;easpm123&lt;/strong&gt; or &lt;strong&gt;class&lt;/strong&gt; property contains the &lt;strong&gt;easpm123&lt;/strong&gt; class, will be affected. The default text to remove from the email will be “&lt;em&gt;NO_SPAM_WELCOME&lt;/em&gt;” and the “{&lt;em&gt;AT_HERE&lt;/em&gt;}” text will be replaced by the &lt;em&gt;AT&lt;/em&gt; (&lt;em&gt;@&lt;/em&gt;) symbol.&lt;/p&gt;

&lt;p&gt;The text inside of the elements whose &lt;strong&gt;id&lt;/strong&gt; is &lt;strong&gt;easpm123_label&lt;/strong&gt; or &lt;strong&gt;class&lt;/strong&gt; property contains the &lt;strong&gt;easpm123_label&lt;/strong&gt; class will be removed automatically when the page loads. These elements are called “&lt;em&gt;without-no-spam&lt;/em&gt;” elements and are useful for the users when JavaScript is not available.&lt;/p&gt;

&lt;p&gt;The real email address will be shown when the user is over or clicks or taps the email link (the tag described above).&lt;/p&gt;

&lt;h4&gt;HTML:&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- Using ID: --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"easpm123"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"mailto:email{*AT_HERE*}NO_SPAM_WELCOMEexample.com"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;email{*AT_HERE*}&lt;span class="nt"&gt;&amp;lt;del&lt;/span&gt; &lt;span class="na"&gt;style=&lt;/span&gt;&lt;span class="s"&gt;"text-decoration:line-through;"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;s&amp;gt;&lt;/span&gt;NO_SPAM_WELCOME&lt;span class="nt"&gt;&amp;lt;/s&amp;gt;&amp;lt;/del&amp;gt;&lt;/span&gt;example.com&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"easpm123_label"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;(without NO_SPAM_WELCOME)&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;br&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!-- Using class: --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"easpm123"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"mailto:email{*AT_HERE*}NO_SPAM_WELCOMEexample.com"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;email{*AT_HERE*}&lt;span class="nt"&gt;&amp;lt;del&lt;/span&gt; &lt;span class="na"&gt;style=&lt;/span&gt;&lt;span class="s"&gt;"text-decoration:line-through;"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;s&amp;gt;&lt;/span&gt;NO_SPAM_WELCOME&lt;span class="nt"&gt;&amp;lt;/s&amp;gt;&amp;lt;/del&amp;gt;&lt;/span&gt;example.com&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"easpm123_label"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;(without NO_SPAM_WELCOME)&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;

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



&lt;h3&gt;Example #2 – Easiest way for the user (very unsafe), with a bit of JavaScript and HTML:&lt;/h3&gt;

&lt;p&gt;This methods needs a little bit of JavaScript (using an empty array as the &lt;strong&gt;eventNames&lt;/strong&gt; parameter) but will not need any event fired by the user. The script and its magic will be performed automatically. The users can be happier this way but some spambots will be too. Safety wise, this method is not recommended.&lt;/p&gt;

&lt;p&gt;As we are using the main object, this must be run before the &lt;strong&gt;onload&lt;/strong&gt; event of the &lt;strong&gt;window&lt;/strong&gt; object is fired.&lt;/p&gt;

&lt;h4&gt;JavaScript:&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;EASPM123&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="cm"&gt;/* eventNames */&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

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



&lt;h4&gt;HTML:&lt;/h4&gt;

&lt;p&gt;Use the same HTML code from the Example #1.&lt;/p&gt;

&lt;h3&gt;Example #3 – Second easiest way for the user (still unsafe), with a bit of JavaScript and HTML:&lt;/h3&gt;

&lt;p&gt;This will be little bit safer than the Example #2 as we change default values by the desired ones. Different IDs and class names have been used just to show how it works.&lt;/p&gt;

&lt;p&gt;As we are using the main object, this must be run before the &lt;strong&gt;onload&lt;/strong&gt; event of the &lt;strong&gt;window&lt;/strong&gt; object is fired.&lt;/p&gt;

&lt;h4&gt;JavaScript:&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;EASPM123&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;//autoLoad.&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"class_email_link"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"class_email_link2"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="c1"&gt;//linkClasses.&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"class_without_no_spam_label"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"class_without_no_spam_label2"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="c1"&gt;//withoutNoSpamElementClasses.&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"id_email_link"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"id_email_link2"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="c1"&gt;//linkIDs.&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"id_without_no_spam_label"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"id_without_no_spam_label2"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="c1"&gt;//withoutNoSpamElementIDs.&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"WITHOUT_THIS_TEXT"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"TAKE_THIS_OUT"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="c1"&gt;//textsToClear&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"[PUT_AT_HERE]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"{HERE_AN_AT_SYMBOL}"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="c1"&gt;//atSymbolAliases.&lt;/span&gt;
    &lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="c1"&gt;//eventNames.&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

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



&lt;h4&gt;HTML:&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- Using ID: --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"id_email_link"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"mailto:email[PUT_AT_HERE]WITHOUT_THIS_TEXTexample.com"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;email[PUT_AT_HERE]&lt;span class="nt"&gt;&amp;lt;del&lt;/span&gt; &lt;span class="na"&gt;style=&lt;/span&gt;&lt;span class="s"&gt;"text-decoration:line-through;"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;s&amp;gt;&lt;/span&gt;WITHOUT_THIS_TEXT&lt;span class="nt"&gt;&amp;lt;/s&amp;gt;&amp;lt;/del&amp;gt;&lt;/span&gt;example.com&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"id_without_no_spam_label"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;(without NO_SPAM_WELCOME)&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;br&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"id_email_link2"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"mailto:email[PUT_AT_HERE]WITHOUT_THIS_TEXTexample.com"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;email[PUT_AT_HERE]&lt;span class="nt"&gt;&amp;lt;del&lt;/span&gt; &lt;span class="na"&gt;style=&lt;/span&gt;&lt;span class="s"&gt;"text-decoration:line-through;"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;s&amp;gt;&lt;/span&gt;WITHOUT_THIS_TEXT&lt;span class="nt"&gt;&amp;lt;/s&amp;gt;&amp;lt;/del&amp;gt;&lt;/span&gt;example.com&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"id_without_no_spam_label2"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;(without NO_SPAM_WELCOME)&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;br&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!-- Using class: --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"class_email_link"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"mailto:email{HERE_AN_AT_SYMBOL}TAKE_THIS_OUTexample.com"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;email{HERE_AN_AT_SYMBOL}&lt;span class="nt"&gt;&amp;lt;del&lt;/span&gt; &lt;span class="na"&gt;style=&lt;/span&gt;&lt;span class="s"&gt;"text-decoration:line-through;"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;s&amp;gt;&lt;/span&gt;TAKE_THIS_OUT&lt;span class="nt"&gt;&amp;lt;/s&amp;gt;&amp;lt;/del&amp;gt;&lt;/span&gt;example.com&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"class_without_no_spam_label"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;(without NO_SPAM_WELCOME)&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;br&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"class_email_link2"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"mailto:email{HERE_AN_AT_SYMBOL}TAKE_THIS_OUTexample.com"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;email{HERE_AN_AT_SYMBOL}&lt;span class="nt"&gt;&amp;lt;del&lt;/span&gt; &lt;span class="na"&gt;style=&lt;/span&gt;&lt;span class="s"&gt;"text-decoration:line-through;"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;s&amp;gt;&lt;/span&gt;TAKE_THIS_OUT&lt;span class="nt"&gt;&amp;lt;/s&amp;gt;&amp;lt;/del&amp;gt;&lt;/span&gt;example.com&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"class_without_no_spam_label2"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;(without NO_SPAM_WELCOME)&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;

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



&lt;h3&gt;Example #4 – Not-so-easy way for the user (safer), with a bit more of JavaScript and HTML:&lt;/h3&gt;

&lt;p&gt;This is like the Example #3 but only firing the script under the default events (onmouseover, onclick and ontouchstart) and not automatically.&lt;/p&gt;

&lt;p&gt;As we are using the main object, this must be run before the &lt;strong&gt;onload&lt;/strong&gt; event of the &lt;strong&gt;window&lt;/strong&gt; object is fired.&lt;/p&gt;

&lt;h4&gt;JavaScript:&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;EASPM123&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;//autoLoad.&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"class_email_link"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"class_email_link2"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="c1"&gt;//linkClasses.&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"class_without_no_spam_label"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"class_without_no_spam_label2"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="c1"&gt;//withoutNoSpamElementClasses.&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"id_email_link"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"id_email_link2"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="c1"&gt;//linkIDs.&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"id_without_no_spam_label"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"id_without_no_spam_label2"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="c1"&gt;//withoutNoSpamElementIDs.&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"WITHOUT_THIS_TEXT"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"TAKE_THIS_OUT"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="c1"&gt;//textsToClear&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"[PUT_AT_HERE]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"{HERE_AN_AT_SYMBOL}"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="c1"&gt;//atSymbolAliases.&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

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



&lt;h4&gt;HTML:&lt;/h4&gt;

&lt;p&gt;Use the same HTML code from the Example #3.&lt;/p&gt;

&lt;h3&gt;Example #5 – A little-bit-more-difficult way (a bit safer), with more JavaScript and HTML:&lt;/h3&gt;

&lt;p&gt;This is like the Example #4 but using the &lt;strong&gt;run&lt;/strong&gt; method instead of the main object. So instead of running the script automatically we will do it manually.&lt;/p&gt;

&lt;p&gt;Note that the main object must be used before the &lt;strong&gt;onload&lt;/strong&gt; event of the &lt;strong&gt;window&lt;/strong&gt; object is fired but the &lt;strong&gt;run&lt;/strong&gt; method must be run after that.&lt;/p&gt;

&lt;p&gt;For safety purposes, the main object waits by default 100 milliseconds before it runs the script automatically. In this example we will wait a little bit more to add even more safety.&lt;/p&gt;

&lt;h4&gt;JavaScript:&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;setTimeout&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;EASPM123&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;run&lt;/span&gt;
        &lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"class_email_link"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"class_email_link2"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="c1"&gt;//linkClasses.&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"class_without_no_spam_label"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"class_without_no_spam_label2"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="c1"&gt;//withoutNoSpamElementClasses.&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"id_email_link"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"id_email_link2"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="c1"&gt;//linkIDs.&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"id_without_no_spam_label"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"id_without_no_spam_label2"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="c1"&gt;//withoutNoSpamElementIDs.&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"WITHOUT_THIS_TEXT"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"TAKE_THIS_OUT"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="c1"&gt;//textsToClear&lt;/span&gt;
            &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"[PUT_AT_HERE]"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"{HERE_AN_AT_SYMBOL}"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="c1"&gt;//atSymbolAliases.&lt;/span&gt;
            &lt;span class="p"&gt;[]&lt;/span&gt;
        &lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="mi"&gt;300&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

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



&lt;h4&gt;HTML:&lt;/h4&gt;

&lt;p&gt;Use the same HTML code from the Example #3.&lt;/p&gt;

&lt;h2&gt;Improving safety&lt;/h2&gt;

&lt;p&gt;To improve the safety and get rid of as many spambots as possible I recommend the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Do not fire the script automatically (without needing events). So, do not do as the Example #2 or Example #3.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Do not use the default values for the text which replaces the &lt;em&gt;AT&lt;/em&gt; (&lt;em&gt;@&lt;/em&gt;) symbol. Use your imagination to invent new ones. Look at the Example #4.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Do not use the default values for the text which should be removed from the email address. Use your imagination to invent new ones. Look at the Example #4.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Do not use the default values for the classes or IDs (for both, elements and the “&lt;em&gt;without-no-spam&lt;/em&gt;” elements) and use your own ones. Look at the Example #4.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use the &lt;strong&gt;run&lt;/strong&gt; method instead of the main object and call it some milliseconds after the &lt;strong&gt;onload&lt;/strong&gt; event of the &lt;strong&gt;window&lt;/strong&gt; object is fired. Look at the Example #5.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Images or other elements instead of text can be used inside the “&lt;em&gt;without-no-spam&lt;/em&gt;” elements to make it harder for the spambots to figure out the email address. Have in mind that some browsers can have images disabled or even some people could not see them properly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can consider about using other events instead of the default ones to fire the script. That could, maybe, improve safety.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you are paranoid enough, you can consider using different ways to obfuscate the strings in the arrays used in the optional parameters and also use other ways of obfuscating. Again, use your own imagination.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;Final comments&lt;/h2&gt;

&lt;p&gt;Following the instructions and some guidelines (included inside the package), the email addresses should be human-understandable even when JavaScript is disabled.&lt;/p&gt;

&lt;p&gt;If you are tired of being spammed, you should try this little script (with an email address which spambots do not know yet!).&lt;/p&gt;

&lt;p&gt;Live example: &lt;a href="http://htmlpreview.github.io/?https://github.com/jalbam/easpm123/blob/master/test_min_eval.htm"&gt;http://htmlpreview.github.io/?https://github.com/jalbam/easpm123/blob/master/test_min_eval.htm&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;License&lt;/h2&gt;

&lt;p&gt;Forbidden to use without keeping the author’s name and copyright clauses. Other than that, just use this script freely but never sell it!&lt;/p&gt;


</description>
      <category>antispam</category>
      <category>library</category>
      <category>javascript</category>
      <category>email</category>
    </item>
    <item>
      <title>Super Queue – queue and lottery viral game in PHP and JavaScript (November 2014)</title>
      <dc:creator>Joan Alba Maldonado</dc:creator>
      <pubDate>Wed, 14 Nov 2018 17:40:26 +0000</pubDate>
      <link>https://dev.to/jalbam/super-queue--queue-and-lottery-viral-game-in-php-and-javascript-november-2014-4nge</link>
      <guid>https://dev.to/jalbam/super-queue--queue-and-lottery-viral-game-in-php-and-javascript-november-2014-4nge</guid>
      <description>&lt;p&gt;I made this game for a Chinese software company whose final client was a chain of jewelry stores that wanted a &lt;a href="https://es.wikipedia.org/wiki/WeChat" rel="noopener noreferrer"&gt;Weixin (aka WeChat)&lt;/a&gt; game to promote themselves by giving the players some prizes and coupons just during a week (to celebrate the &lt;a href="https://en.wikipedia.org/wiki/Singles%27_Day" rel="noopener noreferrer"&gt;Chinese Single’s day&lt;/a&gt;, the 11th of November). &lt;a href="https://es.wikipedia.org/wiki/WeChat" rel="noopener noreferrer"&gt;Weixin (WeChat)&lt;/a&gt; is the most used instant messaging client for mobile devices in China, made by &lt;a href="https://en.wikipedia.org/wiki/Tencent" rel="noopener noreferrer"&gt;Tencent&lt;/a&gt; (the same company that also owns &lt;a href="https://es.wikipedia.org/wiki/QQ" rel="noopener noreferrer"&gt;QQ&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs6cqute0e0t22jicib56.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs6cqute0e0t22jicib56.jpg" alt="Screenshot" width="640" height="640"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The graphics are made by 乔安 (Qiao An) and Chinese translation is done by 董双丽 (Dong Shuangli). The development took almost one month.&lt;/p&gt;

&lt;p&gt;The game consists of two levels. In the first level, you are waiting in a queue and your mission is to jump the queue until you can enter the door. Once you enter through the door, the second level consists in waiting for a partner of the opposite gender (it can be either a real player or a fake one if the game is configured to use fake players or the admin force it) and, when you get a partner, then each of you have to spin a roulette wheel with zodiac symbols and both will win a prize if you both get the same zodiac symbol. If you get a different symbol, you get a discount coupon instead.&lt;/p&gt;

&lt;p&gt;It is a viral game because players have to share the game to others in order to jump the queue they are waiting in. Every time someone registers through your invitation, you will jump two places. But others will also be able to jump and move in front of you so it becomes a kind of fight.&lt;/p&gt;

&lt;p&gt;Players do not need to have the game open all the time. So they can close the game and open it again later whenever they want to. If any progress has been made or any thing new has happened, the game will show it.&lt;/p&gt;

&lt;p&gt;There is a maximum number of people per queue, so the game creates a “new world” with a new queue every time a person joins the game for the first time if all other queues are full. The game also fills the queue with fake people in order to increase level difficulty and to avoid looking empty. All of that is configurable through variables.&lt;/p&gt;

&lt;p&gt;The way to log in, prizes, maximum people per queue, chances to win, and many other things can be configured through the configuration file.&lt;/p&gt;

&lt;p&gt;The game already includes Chinese and English languages. There is also a localization file that allows to translate the game into many more languages easily. The game will try to detect automatically the user’s language.&lt;/p&gt;

&lt;p&gt;The company wanted to run the game just for a week. During this week, the game was a complete success and had more than 50,000 players. All prizes were given out.&lt;/p&gt;

&lt;p&gt;The game was running on &lt;a href="https://es.wikipedia.org/wiki/WeChat" rel="noopener noreferrer"&gt;Weixin (WeChat)&lt;/a&gt; and uses some of its functions, but it can be configured without effort to be used in any other app or platform (as for example in &lt;a href="https://es.wikipedia.org/wiki/QQ" rel="noopener noreferrer"&gt;QQ&lt;/a&gt;, Facebook or any web browser with JavaScript and CSS enabled).&lt;/p&gt;

&lt;p&gt;There is a debug mode which can be accessed through a password. That debug mode shows useful information about the game in real time and it also provides an admin control panel (similar to a God mode panel) with many options to cheat, control other players, etc.&lt;/p&gt;

&lt;p&gt;It also includes an overload test page to check server limits.&lt;/p&gt;

&lt;p&gt;This game was made using technologies as HTML, CSS / CSS 3, JavaScript, JSON, XHR (AJAX), PHP, mySQL, RPC (Remote Procedure Call), OpenID, OAuth, &lt;a href="https://developers.weixin.qq.com/miniprogram/dev/api/" rel="noopener noreferrer"&gt;Weixin API&lt;/a&gt; (&lt;a href="http://admin.wechat.com/wiki/index.php?title=API_Introduction" rel="noopener noreferrer"&gt;WeChat API&lt;/a&gt;) / &lt;a href="https://github.com/Tencent/weui/wiki/%E5%BE%AE%E4%BF%A1JSAPI" rel="noopener noreferrer"&gt;WeixinJSBridge&lt;/a&gt;, etc.&lt;/p&gt;

&lt;p&gt;You can try the game by yourself just creating the database needed (a SQL file with the required tables is included) and editing the configuration file to use that database. Basically, you just need a web server that supports PHP and mySQL.&lt;/p&gt;

&lt;p&gt;It can be found on GitHub: &lt;a href="https://github.com/jalbam/super_queue" rel="noopener noreferrer"&gt;https://github.com/jalbam/super_queue&lt;/a&gt;&lt;/p&gt;

</description>
      <category>game</category>
      <category>gamedev</category>
      <category>php</category>
      <category>javascript</category>
    </item>
    <item>
      <title>TetrisDAI – Tetris in Java (May 2008)</title>
      <dc:creator>Joan Alba Maldonado</dc:creator>
      <pubDate>Thu, 08 Nov 2018 17:11:31 +0000</pubDate>
      <link>https://dev.to/jalbam/tetrisdai--tetris-in-java-may-2008-2kf</link>
      <guid>https://dev.to/jalbam/tetrisdai--tetris-in-java-may-2008-2kf</guid>
      <description>&lt;p&gt;“TetrisDAI” is an open source Tetris clone (highly modular) written in Java 1.6 (aka Java SE 6) with NetBeans.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0c698aqo776d52rjai0i.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0c698aqo776d52rjai0i.jpg" alt="Screenshot" width="400" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is my first Java game and was made in mid 2008.&lt;/p&gt;

&lt;p&gt;The code is extremely modular and is ready to be modified and configured pretty easily by anyone. For instance, you can change control keys, their delay, add new pieces with different shapes or change the current ones or even delete them, change the colour of the whole game (including the pieces), change game visual aspect and sizes (width and height of the cells and of the map, text aspect, margins), decide whether to use images or just simple computer-generated graphics for cells and background, decide language (game is already translated into Spanish, Catalan and English and just needs to change a variable to choose one among those languages) or add new languages easily, change menu items, change initial speed and speed increase when next level is reached, change needed lines to finish a level, modify score system (score for piece placed, score for each line and exponential score increase for multiple lines), enable or disable sound and so on.&lt;/p&gt;

&lt;p&gt;Official language is English but the code also includes Spanish and Catalan translations (as stated before, just by changing a variable, all the game will use the desired language).&lt;/p&gt;

&lt;p&gt;This game has been tested under Linux, NetBSD, OpenBSD, FreeBSD, Windows, Mac OS X, Haiku OS and others.&lt;/p&gt;

&lt;p&gt;Official web site: &lt;a href="http://tetrisdai.tuxfamily.org/" rel="noopener noreferrer"&gt;http://tetrisdai.tuxfamily.org/&lt;/a&gt; (mirror at &lt;a href="http://www.dhtmlgames.com/tetrisdai/" rel="noopener noreferrer"&gt;http://www.dhtmlgames.com/tetrisdai/&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;It can also be found on GitHub: &lt;a href="https://github.com/jalbam/tetrisdai" rel="noopener noreferrer"&gt;https://github.com/jalbam/tetrisdai&lt;/a&gt;&lt;/p&gt;

</description>
      <category>development</category>
      <category>gamedev</category>
      <category>games</category>
      <category>java</category>
    </item>
    <item>
      <title>Gamoliyas – Game of Life in JavaScript (August 2007)</title>
      <dc:creator>Joan Alba Maldonado</dc:creator>
      <pubDate>Fri, 02 Nov 2018 16:11:43 +0000</pubDate>
      <link>https://dev.to/jalbam/gamoliyas--game-of-life-in-javascript-august-2007-48ej</link>
      <guid>https://dev.to/jalbam/gamoliyas--game-of-life-in-javascript-august-2007-48ej</guid>
      <description>&lt;p&gt;“Gamoliyas” is an open source Conway’s Game of Life version (highly configurable) totally written in DHTML (HTML, CSS and JavaScript).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjv1844zq9jzdtdf5d2ha.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjv1844zq9jzdtdf5d2ha.gif" alt="Screenshot" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is my ninth DHTML game and was made in mid 2007.&lt;/p&gt;

&lt;p&gt;Players can configure the game with many options, as changing the world size, choosing between spherical and limited world, using colours that change depending on the number of neighbours, changing speed, saving a world or opening a previously stored one, drawing cells yourself or generating them randomly, etc.&lt;/p&gt;

&lt;p&gt;The game is specially designed to allow to be used inside any other web site (by using an IFRAME, for example). We just need to get the URL (which will be used in the SRC parameter of the IFRAME tag) generated by the “save world” option with the desired behaviour we have decided in the options that the game will ask us (world size, auto-play, spherical world, multicolour, hide top menu, hide bottom controls, hide bottom information panel, do not allow to draw, speed, size of the cells and space between cells). The game accessed through that URL will start containing the cells which were present when we pressed the “save world” option. You can see a live example using this game with an IFRAME in my personal portfolio: &lt;a href="http://www.joanalbamaldonado.com/portfolio/" rel="noopener noreferrer"&gt;http://www.joanalbamaldonado.com/portfolio/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also change the game behaviour easily by editing many of the configuration variables which are at the beginning of the script. To change the game images you just need to replace them with others.&lt;/p&gt;

&lt;p&gt;This game only uses a few images which are not necessary to make it work if we are using the game with the panels and such hidden. So all the rest you can see has been made using just pure HTML and CSS.&lt;/p&gt;

&lt;p&gt;Official languages are Spanish and English.&lt;/p&gt;

&lt;p&gt;You can find other modified and adapted versions of this game on the Internet, including one Opera widget.&lt;/p&gt;

&lt;p&gt;This game has been tested under BeOS, Linux, NetBSD, OpenBSD, FreeBSD, Windows, Mac OS X, BlackBerry Tablet OS, Android, iOS and others.&lt;/p&gt;

&lt;p&gt;Play online in English: &lt;a href="http://gamoliyas.tuxfamily.org/gamoliyas_english/" rel="noopener noreferrer"&gt;http://gamoliyas.tuxfamily.org/gamoliyas_english/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Play online in English (mirror): &lt;a href="http://www.dhtmlgames.com/gamoliyas/gamoliyas_english/" rel="noopener noreferrer"&gt;http://www.dhtmlgames.com/gamoliyas/gamoliyas_english/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Play online in Spanish: &lt;a href="http://gamoliyas.tuxfamily.org/gamoliyas_spanish/" rel="noopener noreferrer"&gt;http://gamoliyas.tuxfamily.org/gamoliyas_spanish/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Play online in Spanish (mirror): &lt;a href="http://www.dhtmlgames.com/gamoliyas/gamoliyas_spanish/" rel="noopener noreferrer"&gt;http://www.dhtmlgames.com/gamoliyas/gamoliyas_spanish/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Official web site: &lt;a href="http://gamoliyas.tuxfamily.org/" rel="noopener noreferrer"&gt;http://gamoliyas.tuxfamily.org/&lt;/a&gt; (mirror at &lt;a href="http://www.dhtmlgames.com/gamoliyas/" rel="noopener noreferrer"&gt;http://www.dhtmlgames.com/gamoliyas/&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;It can also be found on GitHub: &lt;a href="https://github.com/jalbam/gamoliyas" rel="noopener noreferrer"&gt;https://github.com/jalbam/gamoliyas&lt;/a&gt;&lt;/p&gt;

</description>
      <category>development</category>
      <category>gamedev</category>
      <category>game</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Hundiyas – Battleship game in JavaScript (June 2007)</title>
      <dc:creator>Joan Alba Maldonado</dc:creator>
      <pubDate>Tue, 30 Oct 2018 18:18:28 +0000</pubDate>
      <link>https://dev.to/jalbam/hundiyas--battleship-game-in-javascript-june-2007-224p</link>
      <guid>https://dev.to/jalbam/hundiyas--battleship-game-in-javascript-june-2007-224p</guid>
      <description>&lt;p&gt;“Hundiyas” is an open source Battleship (aka Battleships or Sea Battle) game totally written in DHTML (HTML, CSS and JavaScript). Highly configurable.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4uev4tsn2i017cd8jgic.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4uev4tsn2i017cd8jgic.gif" alt="Screenshot" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is my eighth DHTML game and was made in mid 2007.&lt;/p&gt;

&lt;p&gt;Players can configure the game with many options. For instance, you can change board size, decide whether to allow bombing same cell more than once or not, whether to allow to place two ships next to each other without any space between them or not, whether to mark already bombed cells or not, decide who will start playing first and choose among three difficulty levels (easy, normal and hard) that will change the AI (Artificial Intelligence) of the game.&lt;/p&gt;

&lt;p&gt;You can also change the game behaviour easily by editing many of the configuration variables which are at the beginning of the script. To change the game images you just need to replace them with others.&lt;/p&gt;

&lt;p&gt;Official languages are Spanish and English.&lt;/p&gt;

&lt;p&gt;You can find other modified and adapted versions of this game on the Internet, including one Opera widget.&lt;/p&gt;

&lt;p&gt;This game has been tested under BeOS, Linux, NetBSD, OpenBSD, FreeBSD, Windows, Mac OS X, BlackBerry Tablet OS, Android, iOS and others.&lt;/p&gt;

&lt;p&gt;Play online in English: &lt;a href="http://hundiyas.tuxfamily.org/hundiyas_english/" rel="noopener noreferrer"&gt;http://hundiyas.tuxfamily.org/hundiyas_english/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Play online in English (mirror): &lt;a href="http://www.dhtmlgames.com/hundiyas/hundiyas_english/" rel="noopener noreferrer"&gt;http://www.dhtmlgames.com/hundiyas/hundiyas_english/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Play online in Spanish: &lt;a href="http://hundiyas.tuxfamily.org/hundiyas_spanish/" rel="noopener noreferrer"&gt;http://hundiyas.tuxfamily.org/hundiyas_spanish/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Play online in Spanish (mirror): &lt;a href="http://www.dhtmlgames.com/hundiyas/hundiyas_spanish/" rel="noopener noreferrer"&gt;http://www.dhtmlgames.com/hundiyas/hundiyas_spanish/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Official web site: &lt;a href="http://hundiyas.tuxfamily.org/" rel="noopener noreferrer"&gt;http://hundiyas.tuxfamily.org/&lt;/a&gt; (mirror at &lt;a href="http://www.dhtmlgames.com/hundiyas/" rel="noopener noreferrer"&gt;http://www.dhtmlgames.com/hundiyas/&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;It can also be found on GitHub: &lt;a href="https://github.com/jalbam/hundiyas" rel="noopener noreferrer"&gt;https://github.com/jalbam/hundiyas&lt;/a&gt;&lt;/p&gt;

</description>
      <category>board</category>
      <category>game</category>
      <category>gamedev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Some C games (2006 to 2007)</title>
      <dc:creator>Joan Alba Maldonado</dc:creator>
      <pubDate>Sun, 28 Oct 2018 14:21:50 +0000</pubDate>
      <link>https://dev.to/jalbam/some-c-games-2006-to-2007-2j9e</link>
      <guid>https://dev.to/jalbam/some-c-games-2006-to-2007-2j9e</guid>
      <description>

&lt;p&gt;Here are some games in C language I made during the time I was studying the “Programació estructurada i modular / Programación estructurada y modular” (Structured and modular programming) subject that belonged to “CFGS DAI (Ciclo Formativo de Grado Superior en Desarrollo de Aplicaciones Informáticas)” which is a Software development associate degree equivalent (similar to Foundation degree in the UK, Diploma of Higher Education in Scotland or Higher Certificate in the Republic of Ireland) at IES Baix Camp school in Reus city (Spain).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--p5vjatXj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://raw.githubusercontent.com/jalbam/c_games/master/screenshot.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--p5vjatXj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://raw.githubusercontent.com/jalbam/c_games/master/screenshot.gif" alt="Screenshot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All are text-based games. It includes a Blackjack (aka Twenty-one) card game, a roulette game (with four different ways to play), a John Conway’s Game of Life (cells can be inserted either manually or randomly), a Mastermind game, Buscacaminas (pathfinding program with some Minesweeper characteristics), Pongetet (a pong game) and Pilotes (just a bouncing text generator). The IDE used was Bloodshed Dev-C++.&lt;/p&gt;

&lt;p&gt;They can be found on GitHub: &lt;a href="https://github.com/jalbam/c_games"&gt;https://github.com/jalbam/c_games&lt;/a&gt;&lt;/p&gt;


</description>
      <category>textbased</category>
      <category>terminal</category>
      <category>gamedev</category>
      <category>c</category>
    </item>
  </channel>
</rss>
