<?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 Teo Cheng Yong on Medium]]></title>
        <description><![CDATA[Stories by Teo Cheng Yong on Medium]]></description>
        <link>https://medium.com/@teochengyong?source=rss-a69851e6d838------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*YgNwzzjl_ZLs6B0gHC0psg.jpeg</url>
            <title>Stories by Teo Cheng Yong on Medium</title>
            <link>https://medium.com/@teochengyong?source=rss-a69851e6d838------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 04:00:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@teochengyong/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[Modern Deployment using Heroku review app and Circle CI V2 for Angular]]></title>
            <link>https://medium.com/@teochengyong/modern-deployment-using-heroku-review-app-and-circle-ci-v2-for-angular-f0b82870c88e?source=rss-a69851e6d838------2</link>
            <guid isPermaLink="false">https://medium.com/p/f0b82870c88e</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[heroku]]></category>
            <category><![CDATA[deployment]]></category>
            <dc:creator><![CDATA[Teo Cheng Yong]]></dc:creator>
            <pubDate>Sun, 09 Sep 2018 12:58:41 GMT</pubDate>
            <atom:updated>2018-09-09T12:58:41.393Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why is it important ?</h3><p>By understanding the process of deployment, front end developer can accelerate the feature release to market quickly and help their company gain an edge over their competitors.</p><p>There are 2 important things that are frequently needed in the front end development. The first one is the ability to preview the changes done for a particular feature, and test it. Secondly, releasing the feature to production after proper testing is done.</p><h3>Previewing changes</h3><p>In this example, I will be using Heroku Review App to tackle this problem as this is really the strength of the Heroku platform, plus it is also free!</p><p>Heroku Review App</p><ol><li>Setting project in Heroku. In this example, I have forked the excellent <a href="https://github.com/teochengyong/angular6-example-app">starter repo</a> of Angular 6 to use it as a base project to showcase this.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZUXyTYA7wpnKBQmuwFNpkQ.png" /><figcaption>Create New App in Heroku platform</figcaption></figure><p>We can add the new app using heroku platform</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4DGBGTJpj8ETYMRw-jiwZQ.png" /><figcaption>Create a name for the app and a new pipeline is required as part</figcaption></figure><p>In this step, we will need to create a new app name for the angular 6 example app as well as a new pipeline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F22jOo48EsXA1bhJp9yvqw.png" /><figcaption>Pipeline successfully created for the angular 6 example app</figcaption></figure><p>The next step is that we are going to connect the angular6-example-app with out github repo so that we can see the changes being reflected in our github pull request directly. Click <strong>Connect</strong>. (make sure you have the admin rights for the repository before executing this step)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nLMGsa6UDDC-Ma_02xHw8g.png" /><figcaption>Connecting the app to our github account to enable Heroku Review App functionality</figcaption></figure><p>Once, connected we should be see that our repository is connected. For now, we would not be using automatic deploy of heroku since we will only be using Heroku review app function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SckLqrigpMQMzFvfcmwvxA.png" /></figure><p>Finally to enable the heroku review app, we will need to click on the <strong>angular6-example-app-pipeline </strong>and click on the<strong> Enable Review Apps</strong> function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zVI-Yrfb9WmqeQhtZvterQ.png" /></figure><p>But before we can enable it, we will need to create an <strong>app.json</strong> file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g7FuZO3w1FH3cagTO7Prig.png" /></figure><p>Thankfully, Heroku is kindly enough to guide us through this process. For this project, we will be using <strong>heroku/nodejs </strong>build pack and finally we get this committed to the repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pWx9Dngx5ccBUeQ4tyPOKg.png" /></figure><p>Until now we have yet to see the review app, there are a few more things that needs to be before we can get the review app up and running. Let’s get those things in.</p><p>Once that is done, we can click on enable review apps with the check create new review apps for new requests automatically which will automate the part of creating a new app automatically whenever a PR is raised.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AaH-QnYEwfdlDuZxD2Yvlg.png" /></figure><p>Let’s try to create a PR and see whether we can get the app up and running!</p><p>At this step, if you find that the review app is still not created. Do check whether the pipeline got disconnected from the github repo. It happens to me and I connected the pipeline again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YWDSO7EuBNebF3czqsz7HA.png" /></figure><p>If it is done properly, you should be able to see that the Heroku review app is being created automatically on github</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*we9-PrqKGWgeiV0RkpjABg.png" /><figcaption>Heroku building our app automatically.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XFSiKFp2LmJPKLZohVtRig.png" /><figcaption>Tracking review app being build process in the console</figcaption></figure><p>Once the app is successfully build it will be deployed with a V<strong>iew Deployment</strong> button shown on the right. Click on it will bring us to review app hosted temporarily on heroku itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kcyK2gp-jrDe_LhE60yN_Q.png" /></figure><p>Clicking on this link will show us this error. This is because we have yet to tell heroku how to serve our app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-80G2ZTFWJyvqpK4py1p-A.png" /></figure><p>Checking on the view latest build we will understand how Heroku is deploying our app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*nbO9TfWalHwFR1ElDzLfmw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*ByGT4w_bD73govsBea-eOA.png" /></figure><p>Seemed like heroku runs the default npm install command, to make sure that heroku is able to run additional command after post install we add a postinstall script command in our package.json to run additional processes after npm install is done.</p><p>There are 3 things to be done: Setting up the procfile, server.js, build script in package.json</p><p>In package.json, we will be adding the following command.</p><pre>&quot;postinstall&quot;: &quot;npm run build&quot;</pre><p>Pushing the following changes into our PR will trigger another build and this time we see that the postinstall script will be triggered to run the build command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2nQklSDuMOjKO1L0FKk5Fw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*A5gKaYz2j6xdg20E6QzZFQ.png" /></figure><p>Click on the latest build we see that the<strong> ng build </strong>is being triggered.</p><p>However, this is not enough as we have yet to set up Heroku to serve our app yet. For this angular app to be served, we will be adding a npm command to run the server with the <strong>server.js</strong> and include a <strong>Procfile</strong> to run command when the app is ready to be served.</p><p>In package.json, add the following to the scripts section in package.json.</p><pre>&quot;serve&quot;: &quot;node ./server.js&quot;,</pre><p>Next, we will need to install express and compression using</p><pre>npm i -S express compression</pre><p>Finally, we will add server.js to the root of the project.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/17c1649e6882d2ee64c80453a9932c55/href">https://medium.com/media/17c1649e6882d2ee64c80453a9932c55/href</a></iframe><p>Next, we should commit and push our changes to the PR again. The build should be done and we should be able to see our deployment using <strong>View Deployment </strong>button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/1*XDEe2Qq_NgCheKu1UKMU3g.png" /><figcaption>Final Deployment</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*xTJqtbS-T9A5JirRl2GKbQ.png" /><figcaption>Voila!we get to see the app being deployed.</figcaption></figure><p>Protip: Sometimes the app is not working well and we might need to check why is it problem. Heroku provide a way for us to run console for us to debug the app itself using <strong>Run console.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/1*G63SDZ5bJULpxmBpC4Zmew.png" /></figure><p>Seemed like the review app is working well now, if I were to merge the pull request now. Heroku will automatically remove the review app as well.</p><p><strong>Deploying Changes</strong></p><p>Stay tuned for the next step for CI/CD using CircleCI</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f0b82870c88e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Smartwatch = personal life-saving device]]></title>
            <link>https://medium.com/@teochengyong/smartwatch-personal-life-saving-device-a85b1712605d?source=rss-a69851e6d838------2</link>
            <guid isPermaLink="false">https://medium.com/p/a85b1712605d</guid>
            <category><![CDATA[public-health]]></category>
            <category><![CDATA[healthcare]]></category>
            <category><![CDATA[wearables]]></category>
            <category><![CDATA[smartwatch]]></category>
            <category><![CDATA[startup]]></category>
            <dc:creator><![CDATA[Teo Cheng Yong]]></dc:creator>
            <pubDate>Thu, 25 Aug 2016 01:00:34 GMT</pubDate>
            <atom:updated>2016-08-25T01:00:34.999Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zPipxjT9y3N9VJDw2ptBYw.jpeg" /></figure><p>A week ago, while I was queuing to pay for my groceries at a local supermarket, an old lady fainted and everyone was trying to support her while a young guy immediately called the ambulance. After about a minute or so, she woke up and wanted to go on her on way but she was still weak and people were advising her to stay put until the emergency response team arrived.</p><p>It was quite hard to convince her to stay put as she did not seem to understand English and could only utter a few words and generally did not trust people around her. When the emergency response team arrived, she refused to let them check her vital signs or bring her to the hospital. However, the emergency response team could not let her go as they needed her family member to accompany her home. Luckily, someone managed to get in contact with her nephew and he came and picked her up.</p><p>Thankfully things turned out to be okay.</p><p>Now imagine a bad scenario where she falls down from stairs or in the bathroom and no one can hear her. She will be incapacitated and won’t be able to call for help at all.</p><p>This got me thinking as the technology to potentially save her life is already here — a personal device that you wear everywhere you go and is able to call for help whenever you need it. Imagine a watch that is able to monitor your health condition and make the appropriate judgement to call for help when you need it.</p><h3>Steps during an emergency situation</h3><p>Let’s go through the sequence to replace all the manual effort that is being done in the above story and replace it with a similar process by a smartwatch.</p><ol><li>She blacked out and fell.</li><li>Someone called for an ambulance.</li><li>Someone tried to calm her down.</li><li>Someone called her family members.</li><li>The emergency response team took her vital signs like blood pressure, heart rate and sugar level.</li><li>The emergency response team needed to pin point the location of the patient.</li><li>The emergency response team needed the identification number of the patient.</li></ol><p>A smartwatch is technically capable of performing all the above functions in seconds.</p><ol><li>It can detect fall by using an accelerometer sensor. A heart rate monitor can be used to confirm the condition of the patient.</li><li>The smartwatch can vibrate and inform the user that it is calling for help. If the user does not response to the vibration, an emergency response should be dispatched immediately.</li><li>The smartwatch can send an alert to the user’s family members.</li><li>The GPS in the smartwatch can help the emergency response team pin point the exact location of the user.</li><li>All the details about the user are readily available to the emergency response team including the insurance information or family members contact number.</li></ol><p>All this can happen within <strong>seconds </strong>instead of <strong>minutes</strong>, and every second counts for people who are in a emergency situation.</p><h3>What are the minimum features for a life-saving smart watch?</h3><p>An article from <a href="https://www.seniorwise.eu/en/potential-smartwatches-seniors/">seniorwise</a> highlighted the potential usage of the smartwatches for the seniors and it matches some of the points that i observed as well.</p><p>In my opinion, there are 5 key features that a life-saving smartwatch should have.</p><ol><li>Emergency call.</li><li>GPS location service.</li><li>Fall detection.</li><li>GSM radio capable.</li><li>Heart rate monitor</li></ol><p>Here is a comparison of the smartwatches that are currently in the market:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/855/1*o1btSw02y3lvzUBF2moclA.png" /><figcaption>Overview of smartwatches in the market</figcaption></figure><p>It would seem that the only<a href="http://www.samsung.com/global/galaxy/gear-s2/#!/spec"> Samsung Gear S2</a> and <a href="https://www.pebble.com/buy-pebble-2-smartwatch">Pebble 2 + heart rate</a> + <a href="https://www.pebble.com/buy-pebble-core">Pebble Core</a> are the only devices that fulfill most of the conditions. Other devices would need to pair with a smartphone to get GPS location or to send and receive messages.</p><p>Samsung Gear S2 ($299 USD) is definitely more expensive and requires daily charging whereas Pebble 2 ($129) is cheaper and comes with 7 days battery life. The downside is that you have to buy the Pebble core separately.</p><h3>Software and services</h3><p>Dedicated app and services have to be developed to cater to fall detection and to have an emergency response team ready for those situation.</p><p><a href="http://www.mylively.com/">Lively</a> has simple apps that seem to be able to cater to those situations but it has yet to be able to be integrated with the local emergency response system. Secondly, it is not common as compared to other smartwatches.</p><p>In my opinion, the services has to be part of the public services provided by the government and the network providers. It is already possible to place an emergency call with a phone without a SIM. The smartwatch should be able to do that as well. Once we have a smartwatch that is always on the lookout for us, there should be more use cases other than just detecting a fall and placing emergency call.</p><h3><strong>Preventive instead of reactive</strong></h3><p>In the future, it might be even possible to detect early signs of heart attack with ECG on the smartwatch and may even prevent those emergency situation.</p><p>The potential for the smartwatch as a personal life-saving device is limitless as it is one of the device that we wear daily and provides valuable insights by using various sensors to detect the state of our body. Once we have those insights, medical professionals can detect early signs of abnormalities and help prevent health that might otherwise gone undetected.</p><h3>Platform For Personal Health</h3><p>Smartwatch with open standard hardware and standard APIs endpoint will be crucial for it to be the window to one’s personal health. Once we have those, it will be easy for hardware manufacturers to integrate more sensors and developers can build health services on top of these smartwatches. Smartwatches are poised to be the platform for personal health. Entrepreneur and businesses should seize this opportunity to create services on top of this smartwatches.</p><h3>Conclusion</h3><p>A smartwatch that can be your personal life-saving device should be a generic mass market smartwatch that everyone can readily buy. Additionally, it should be integrated into the system of the emergency response team so that appropriate measures can be carried out as well. This would seem to be an ideal public project where a government should make this as part of the public health program and making sure the network providers are able to support this as part of their emergency call services. The smartwatch can even provide preventive measures to help detect early signs of health issues where we can take actions immediately. More importantly, smartwatches with open standard hardware and standard APIs will make it easy for businesses to build services on top of these devices and drives the next revolution of personal health.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a85b1712605d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>