<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ray Farias on Medium]]></title>
        <description><![CDATA[Stories by Ray Farias on Medium]]></description>
        <link>https://medium.com/@sgnl?source=rss-3beed9687c4f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*gC-nRReRGSClG6eH.jpeg</url>
            <title>Stories by Ray Farias on Medium</title>
            <link>https://medium.com/@sgnl?source=rss-3beed9687c4f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 22:33:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sgnl/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A note on https://css-tricks.com/slide-in-as-you-scroll-down-boxes/]]></title>
            <link>https://medium.com/@sgnl/a-note-on-https-css-tricks-com-slide-in-as-you-scroll-down-boxes-5b580af46304?source=rss-3beed9687c4f------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b580af46304</guid>
            <category><![CDATA[css-tricks]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[jquery]]></category>
            <dc:creator><![CDATA[Ray Farias]]></dc:creator>
            <pubDate>Sat, 18 Nov 2017 07:35:46 GMT</pubDate>
            <atom:updated>2017-11-18T07:40:05.152Z</atom:updated>
            <content:encoded><![CDATA[<p>🔨 🔨 🔨 SHITTY CODE BELOW 🕶</p><p>Here’s my version where:</p><ul><li>the “cache” is updated on scroll</li><li>elements already in view have their animations removed</li><li>handles the case where the image is above the window’s scroll-position</li></ul><pre>var win = $(window);<br>var allMods = $(&quot;.slide-up-modules&quot;);</pre><pre>// this handles the case where a user loads into<br>// the middle of the page<br>allMods = allMods.filter(function(i, el) {<br>  var el = $(el);</pre><pre>  if (el.visible(true)) {<br>    // helper class to remove the animation declaration<br>    el.addClass(&quot;already-visible&quot;); <br>    return false;<br>  }</pre><pre>  return true;<br>});</pre><pre>$(window).scroll(function(event) {<br>  if (!allMods.length) return; // empty collection, bail 🏄🏽</pre><pre>  allMods = allMods.filter(function(i, el) {<br>    var el = $(el);</pre><pre>    if (el.visible(true)) {<br>      el.addClass(&quot;slide-up&quot;);<br>      return false;<br>    }</pre><pre>    // handles case where elements are above the window&#39;s scroll position<br>    if ($(window).scrollTop() &gt;= el.offset().top) {<br>      el.addClass(&quot;already-visible&quot;);<br>      return false;<br>    }</pre><pre>    return true;<br>  });<br>});</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b580af46304" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Installing Clojure on OSX]]></title>
            <link>https://medium.com/@sgnl/installing-clojure-on-osx-eb3bf77908c9?source=rss-3beed9687c4f------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb3bf77908c9</guid>
            <category><![CDATA[mac]]></category>
            <category><![CDATA[clojure]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Ray Farias]]></dc:creator>
            <pubDate>Fri, 03 Feb 2017 11:20:53 GMT</pubDate>
            <atom:updated>2017-02-03T11:20:53.690Z</atom:updated>
            <content:encoded><![CDATA[<h4>{:Clojure “1.8.0&quot; :Java “1.8u121” :OSX 10.11}</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*nrB4-lqwrHVi2H6IhHW5vQ.png" /></figure><p>Want to try out Clojure? This will walk you through the steps I took to install Clojure on my system:</p><ul><li>osx 10.11</li><li>java 1.8u121</li><li>clojure 1.8.0</li></ul><p>We’re OSX developers so let’s update brew and install java through the brew plugin called <a href="https://caskroom.github.io/">caskroom</a>. Get that terminal out and start slapping those fingers:</p><pre>brew update &amp;&amp; brew cask install java</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*UvEPeBnrxmAbf1hDUyGtPg.gif" /></figure><p>Now that we got those two dependencies out of the way the next thing to do in to install <a href="https://leiningen.org/">leiningen</a>:</p><pre>brew install leiningen</pre><p>What’s leiningen? Well, let’s take the direct quote from their <a href="https://leiningen.org/">website</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*1zKtFvYZoHUC0Y989dadCg.gif" /></figure><blockquote>for automating Clojure projects without setting your hair on fire</blockquote><p><strong>“SOUNDS GOOD TO ME</strong> 💅🏾 — ME</p><p>Leningen handles compilation of code, testing, creation of package, installation, etc.</p><p>Once you that installation is done, to get into the Clojure REPL wiggle your meat-fidgets to produce this command:</p><pre>lein repl</pre><p>At this point you may see some messages about fetching dependencies, not to worry that’s just normal behavior.</p><p>And.. you’re in — pretty painless huh? Now you can get started with the “Best Language Ever”™ or some shit.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb3bf77908c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Nodeku — control your Roku with Node.js]]></title>
            <link>https://medium.com/@sgnl/nodeku-control-your-roku-with-node-js-d8b8c87cdba6?source=rss-3beed9687c4f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d8b8c87cdba6</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[npm]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[roku]]></category>
            <dc:creator><![CDATA[Ray Farias]]></dc:creator>
            <pubDate>Wed, 19 Oct 2016 10:11:43 GMT</pubDate>
            <atom:updated>2017-10-06T21:58:47.155Z</atom:updated>
            <content:encoded><![CDATA[<p>Just a few hours ago I released an NPM package called <a href="https://www.npmjs.com/package/nodeku">Nodeku</a>. It will discover Roku devices on your local network and provide you with a module to interface with that device via HTTP requests. Refer to the <a href="https://github.com/sgnl/nodeku/">documentation</a> for help.</p><h3>Getting Started</h3><pre>$ npm install nodeku</pre><h3>Usage</h3><pre>const Nodeku = require(&#39;nodeku&#39;)</pre><pre>Nodeku()<br>  .then(device =&gt; device.launch(12)) // launches netflix app<br>  .catch(error =&gt; console.error(error.stack))</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*DX_ctGnIXZHKl3bhhTs6gg.gif" /><figcaption>this sucks, change it. heh heh</figcaption></figure><h3>Why did I build this?</h3><p>I was (un)inspired by <a href="https://www.npmjs.com/package/node-roku">this packag</a>e and how little it actually did, how it was more of a SEO boost for someone named “garciacom”, and most importantly — how the source code was no where to be found. Sketch. So I took a peak at the <a href="https://sdkdocs.roku.com/display/sdkdoc/External+Control+Guide#ExternalControlGuide-ExternalControlServiceCommands">Roku External Control API docs</a> and after some reading I discovered that you can send commands via HTTP requests.</p><p>Seemed like a fun side-project, I’m a web dev so this should be a piece of cake, right?</p><p>Along the way I learned about <a href="https://en.wikipedia.org/wiki/Simple_Service_Discovery_Protocol">SSDP</a>, got some practice with TDD, learned and implemented Continuous Delivery for publishing to NPM, and writing documentation.</p><h3>SSDP</h3><p>This was the first time I got to play with this protocol and I think it’s pretty neat. It’s a part of the <a href="https://en.wikipedia.org/wiki/Universal_Plug_and_Play#Protocol">Universal Plug and Plug Protocol (UPnP)</a>. Basically, devices ping a service, for example IPv4’s service resides at the IP address <strong>239.255.255.250 port 1900</strong>, to register themselves as available devices. Once registered you can ping that same service with certain headers to get information about a particular device or about any/all devices available. Here’s an example of headers for a request looking for a Roku device:</p><pre>M-SEARCH * HTTP/1.1<br>Host: 239.255.255.250:1900<br>Man: &quot;ssdp:discover&quot;<br>ST: roku:ecp</pre><p>In the case of my Roku device, it responded with XML data so I had to use the <a href="https://www.npmjs.com/package/xml2js">xml2json package</a> because<strong> fuck xml amirite?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*MDm-oBWDLpFRXqbqlucx9Q.gif" /><figcaption>xmlsux</figcaption></figure><h3>Tests</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*koyVgeBf5sShvpos0HL2RQ.png" /><figcaption>🚀 Futuristic JavaScript test runner</figcaption></figure><p>I’m using a test runner called <a href="https://github.com/avajs/ava">Ava</a>. It’s nice in that it’s api is inspired by <a href="https://github.com/substack/tape">Tape</a>, very simple and effective. It also has the ability to run tests asynchronously, I had to give it a try and so far it’s been nice.</p><p>For code coverage Nodeku is using <a href="https://github.com/istanbuljs/nyc">nyc</a> as recommended by ava’s docs. Setup was painless and getting it to work with CircleCI was as well. Here’s an image of the output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/689/1*2-jBFY6S6DcTnOcWvliApw.png" /><figcaption>nyc output after ava tests are completed. I’ve also read that 100% code coverage is a fool’s errand. It’s all about branches.</figcaption></figure><h3>~ImmutableJs~</h3><p>Just for kicks I threw in Immutable and I feel like it might kick me in the butt later on, maybe… we’ll see.</p><p>update 2017, Oct 6th: ImmutableJs has been removed!</p><h3>Auto-publishing to NPM</h3><p>Publishing made easy with CircleCI’s deployment scripts and a handy little NPM package named <a href="https://www.npmjs.com/package/publish">Publish</a>. I set up an npm script which runs the publish binary. Publish will check what version is on NPM and what the local version is, if the local version has been bumped then it will trigger a publish onto NPM. Nifty!</p><h3>What’s next?</h3><p>Originally, I wanted to build an electron app to control my Roku but I figured that I need a sort of base module to interface with the device before building the electron app. So this project is a one step towards that goal.</p><p>Next, I will build a simple electron app to control my device. At the same time I will be looking at the official docs for leads on other features I could implement. The ability to search would be a good feature to have.</p><p>Enjoy and please <a href="https://github.com/sgnl/nodeku/issues">report all issues on github</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8b8c87cdba6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>