<?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 Tianye Song on Medium]]></title>
        <description><![CDATA[Stories by Tianye Song on Medium]]></description>
        <link>https://medium.com/@tianyesong?source=rss-ec5e84f44b9a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*OyhXZIP6oB6TMzKw.</url>
            <title>Stories by Tianye Song on Medium</title>
            <link>https://medium.com/@tianyesong?source=rss-ec5e84f44b9a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 20:30:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tianyesong/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[Viewports, font sizes, zoom in and zoom outs.]]></title>
            <link>https://medium.com/@tianyesong/viewports-font-sizes-zoom-in-and-zoom-outs-b60fb12095fd?source=rss-ec5e84f44b9a------2</link>
            <guid isPermaLink="false">https://medium.com/p/b60fb12095fd</guid>
            <category><![CDATA[css]]></category>
            <dc:creator><![CDATA[Tianye Song]]></dc:creator>
            <pubDate>Mon, 22 Jan 2018 19:27:08 GMT</pubDate>
            <atom:updated>2018-01-22T19:27:10.358Z</atom:updated>
            <content:encoded><![CDATA[<p>A chrome extension has to be user friendly for any device. That means all kinds of screen sizes and zoom levels. In other words, different viewport sizes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kxFie-L14IuYDFOT5oT9fA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jg1nlxvYNwkoW0EhvfHDHA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oHIqDAkqEyTs4SidonGPEw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-0BUCM5ZhxrmsQAUwZAw6w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J3V36yTbl-kugxy2436pig.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7mXdiDWYptGiolExo9Jy0w.png" /><figcaption>Zoom level from 75% to 125%</figcaption></figure><p>Clearly, settings section is a mess when zoomed out.</p><p>The problem is for the fonts I was using vw (viewport width) units. One vw = 1% of device width. Due to the fact that device width does not change during zooming in and outs, the font sizes will not change either.</p><p>However, the sizes of HTML are constantly changing in the mean time. As a result, the words are out of place.</p><p>This is easily fixed by changing units for font-size from vw to px.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b60fb12095fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Modularizing the first component of Inspired by Unboundly extension]]></title>
            <link>https://medium.com/@tianyesong/modularizing-the-first-component-of-inspired-by-unboundly-extension-ab0dc44a6934?source=rss-ec5e84f44b9a------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab0dc44a6934</guid>
            <category><![CDATA[html]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[asynchronous]]></category>
            <dc:creator><![CDATA[Tianye Song]]></dc:creator>
            <pubDate>Wed, 17 Jan 2018 18:48:14 GMT</pubDate>
            <atom:updated>2018-01-22T18:48:41.691Z</atom:updated>
            <content:encoded><![CDATA[<p>In order to make my code succinct for Inspired, I had to first clear up on the sequence of execution of different tasks.</p><p>Because this extension makes heavy use of user’s geolocation data, namely (latitude, longitude) pairs, I have decided to make the “geolocation” module the first to conquer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*TyqBfr1HNM7h1gEUejAiLw.png" /><figcaption>Self-explanatory.</figcaption></figure><p>In order to obtain user’s location coordinate, I have decided to use the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/Using_geolocation">Html geolocation API</a>. It is an asynchronous call to detect user’s location, if user permits the request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tmuYWv1tz5xZGrD6kA2Amg.png" /><figcaption>Core function in context of this article.</figcaption></figure><p>In the above coding snippet, both s<em>uccess() </em>&amp; <em>fail() </em>trigger <em>getIATA()</em>, a function that<em> </em>finds airport closest to user’s location returned by the Html geolocation API. In addition, the <em>helper function</em> computes the distance between two given coordinates using <a href="https://www.movable-type.co.uk/scripts/latlong.html">Haversine’s formula</a>.</p><p>1/18/2018</p><p>Today I am proceeding to solve the next problem: what the extension should do once it has the home airport figured out.</p><p>When the extension has the home IATA code figured out, it can call a callback function to go ahead and make the Unboundly API call, in order to retrieve all the useful information needed to render the UI.</p><p>The API call looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6qCu_JLF0-OVxNEn4Wliwg.png" /></figure><p>IAD is the home airport, AMS is the airport I’m going to, and the two date ranges are departure date range and return date range.</p><p>To be able to construct an API call with this, the extension will need to know <strong>where the user is going, when’s a good time for the user to take the trip, and how long he/she will be away for</strong>. These data are stored in our AWS RDS.</p><p>Therefore, if I can get user data from RDS, combined with the home airport information that is available already, I can construct the API call and render the page then.</p><p>So right after html geolocation API call I would like to send a message to my eventPage and start the data fetching effort.</p><p>Nonetheless, to get user’s data, I need user idToken, which requires firebaseAuth to be ready. I will bypass the implementation of firebaseAuth by using an idToken that is known.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab0dc44a6934" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[On building a Chrome Extension with succinct code.]]></title>
            <link>https://medium.com/series/on-building-a-chrome-extension-with-succinct-code-152d1190fe63?source=rss-ec5e84f44b9a------2</link>
            <guid isPermaLink="false">https://medium.com/p/152d1190fe63</guid>
            <dc:creator><![CDATA[Tianye Song]]></dc:creator>
            <pubDate>Mon, 15 Jan 2018 16:25:07 GMT</pubDate>
            <atom:updated>2018-01-15T16:25:07.024Z</atom:updated>
            <content:encoded><![CDATA[<h4>My first ever project working as a software developer was this extension for a website called Unboundly. It is a single-page web application with a pretty UI and a recommendation engine. Link is <a href="https://chrome.google.com/webstore/detail/inspired-by-unboundly/hklhkgemmdgmcmfclaeeonjgliengdjb?hl=en-US&amp;authuser=2">here</a>.</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=152d1190fe63" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The root of all sin: $(document).ready(…);]]></title>
            <link>https://medium.com/@tianyesong/how-to-build-a-chrome-extension-and-then-make-the-code-really-succinct-a11903c0b1c9?source=rss-ec5e84f44b9a------2</link>
            <guid isPermaLink="false">https://medium.com/p/a11903c0b1c9</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[jquery]]></category>
            <category><![CDATA[chrome-extension]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[software]]></category>
            <dc:creator><![CDATA[Tianye Song]]></dc:creator>
            <pubDate>Mon, 15 Jan 2018 16:14:45 GMT</pubDate>
            <atom:updated>2018-01-15T17:39:42.984Z</atom:updated>
            <content:encoded><![CDATA[<p>I am faced with an issue of a slow loaded background image. The reason was actually pretty simple.</p><p>Each functionality module in my extension is an IIFE, with a master file makes use of every module. This master file is a simple $(document).ready() function call, which uses functionality of each of the modules in a sequential manner. With no exception, the background image module is also called within this master file.</p><p>Here then comes the problem: the master file is only parsed and run after all DOM elements are parsed. Thus, the background image will only start to load once all DOM elements are ready. Now this, is very slow.</p><p>So today, I am going to fix the issue by re-structuring the architecture of the way that this extension works.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a11903c0b1c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>