<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Web Dev on Mysterious Code - Senior AWS, DevOps &amp; security engineering</title><link>https://mysteriouscode.com/blog/category/web-dev/</link><description>Recent content in Web Dev on Mysterious Code - Senior AWS, DevOps &amp; security engineering</description><generator>Hugo</generator><language>en-gb</language><lastBuildDate>Mon, 12 Dec 2016 09:00:29 +0000</lastBuildDate><atom:link href="https://mysteriouscode.com/blog/category/web-dev/index.xml" rel="self" type="application/rss+xml"/><item><title>DHCP implementation in... PHP</title><link>https://mysteriouscode.com/blog/dhcp-implementation-in-php/</link><pubDate>Mon, 12 Dec 2016 09:00:29 +0000</pubDate><guid>https://mysteriouscode.com/blog/dhcp-implementation-in-php/</guid><description>&lt;p&gt;PHP is not usually used to implement network services - and generally for good reasons. Not because it can&amp;rsquo;t be done,
but rather because it&amp;rsquo;s not what it was meant to be used for. Although, if you think that PHP simply can&amp;rsquo;t be used for
anything other than serving your blog, think again. Because
my &lt;a href="https://github.com/pbudzon/dhcp-php"&gt;DHCP implementation in PHP&lt;/a&gt; seems to work quite well!&lt;/p&gt;</description></item><item><title>2a0++ misunderstanding</title><link>https://mysteriouscode.com/blog/2a0-misunderstanding/</link><pubDate>Fri, 08 Nov 2013 11:42:27 +0000</pubDate><guid>https://mysteriouscode.com/blog/2a0-misunderstanding/</guid><description>&lt;p&gt;The following eval&amp;rsquo;ed code was caused a lot of misunderstanding: &lt;a href="https://eval.in/61309"&gt;https://eval.in/61309&lt;/a&gt;. The
code looks like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;div style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;
&lt;table style="border-spacing:0;padding:0;margin:0;border:0;"&gt;&lt;tr&gt;&lt;td style="vertical-align:top;padding:0;margin:0;border:0;"&gt;
&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;1
&lt;/span&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;2
&lt;/span&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;3
&lt;/span&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;4
&lt;/span&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;5
&lt;/span&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"&gt;6
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%"&gt;
&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bb60d5"&gt;$a&lt;/span&gt; &lt;span style="color:#666"&gt;=&lt;/span&gt; &lt;span style="color:#4070a0"&gt;&amp;#34;2a0&amp;#34;&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#007020;font-weight:bold"&gt;for&lt;/span&gt;(&lt;span style="color:#bb60d5"&gt;$i&lt;/span&gt; &lt;span style="color:#666"&gt;=&lt;/span&gt; &lt;span style="color:#40a070"&gt;0&lt;/span&gt;; &lt;span style="color:#bb60d5"&gt;$i&lt;/span&gt; &lt;span style="color:#666"&gt;&amp;lt;&lt;/span&gt; &lt;span style="color:#40a070"&gt;50&lt;/span&gt;; &lt;span style="color:#bb60d5"&gt;$i&lt;/span&gt;&lt;span style="color:#666"&gt;++&lt;/span&gt;) {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#007020;font-weight:bold"&gt;print&lt;/span&gt; &lt;span style="color:#4070a0"&gt;&amp;#34;&lt;/span&gt;&lt;span style="color:#70a0d0"&gt;$a&lt;/span&gt;&lt;span style="color:#4070a0;font-weight:bold"&gt;\n&lt;/span&gt;&lt;span style="color:#4070a0"&gt;&amp;#34;&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#bb60d5"&gt;$a&lt;/span&gt;&lt;span style="color:#666"&gt;++&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;</description></item><item><title>Node.js: using socket.io with cluster module</title><link>https://mysteriouscode.com/blog/node-js-using-socket-io-with-cluster-module/</link><pubDate>Sun, 26 Aug 2012 23:15:27 +0000</pubDate><guid>https://mysteriouscode.com/blog/node-js-using-socket-io-with-cluster-module/</guid><description>&lt;p&gt;I&amp;rsquo;ve been recently working on a project that uses Node.js with cluster module and socket.io and I noticed that a lot of
people that try to use Node.js with socket.io have problems with how to make it work with cluster module.&lt;/p&gt;</description></item><item><title>Accessing Gmail with oAuth authorization in PHP</title><link>https://mysteriouscode.com/blog/accessing-gmail-with-oauth-authorization-in-php/</link><pubDate>Sun, 18 Dec 2011 15:00:22 +0000</pubDate><guid>https://mysteriouscode.com/blog/accessing-gmail-with-oauth-authorization-in-php/</guid><description>&lt;p&gt;Recently, I&amp;rsquo;ve joined a project that required accessing Gmail accounts using oAuth authentication with PHP. It turns
out, that&amp;rsquo;s not such a very simple thing to do, especially with PHP - &lt;a href="http://code.google.com/p/google-mail-xoauth-tools/wiki/PhpSampleCode"&gt;Zend has a very nice implementation for it&lt;/a&gt;,
but the wiki page is terribly old and outdated&amp;hellip; I&amp;rsquo;ve lost a few hours looking for a nice and clean solution and found
a &lt;a href="https://github.com/petewarden/handmadeimap"&gt;&amp;ldquo;handmadeimap&amp;rdquo; project done by Pete Warder&lt;/a&gt; some time ago. Bad thing is,
the latest commit was done in 2010. The good thing: not much has changed since then, so the code works perfectly. It&amp;rsquo;s
even better to use that php-imap extension, as you need to use raw IMAP commands, which gives you the chance to use, for
example, gmail&amp;rsquo;s special &lt;a href="http://code.google.com/apis/gmail/imap/#x-gm-raw"&gt;X-GM-RAW&lt;/a&gt; extension to SEARCH command.&lt;/p&gt;</description></item></channel></rss>