<?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 Hu Chen on Medium]]></title>
        <description><![CDATA[Stories by Hu Chen on Medium]]></description>
        <link>https://medium.com/@chen?source=rss-dc12cffe5f2e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*wqXxW38QpnxDbRP_.jpeg</url>
            <title>Stories by Hu Chen on Medium</title>
            <link>https://medium.com/@chen?source=rss-dc12cffe5f2e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 17:09:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@chen/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[Adding Dark Mode to Your React App with Emotion CSS-in-JS]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://levelup.gitconnected.com/adding-dark-mode-to-your-react-app-with-emotion-css-in-js-fc5c0f926838?source=rss-dc12cffe5f2e------2"><img src="https://cdn-images-1.medium.com/max/1280/0*I2HpYUxuOnlXPEWl.jpg" width="1280"></a></p><p class="medium-feed-snippet">A guide to implementing dark mode in your React application</p><p class="medium-feed-link"><a href="https://levelup.gitconnected.com/adding-dark-mode-to-your-react-app-with-emotion-css-in-js-fc5c0f926838?source=rss-dc12cffe5f2e------2">Continue reading on Level Up Coding »</a></p></div>]]></description>
            <link>https://levelup.gitconnected.com/adding-dark-mode-to-your-react-app-with-emotion-css-in-js-fc5c0f926838?source=rss-dc12cffe5f2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc5c0f926838</guid>
            <category><![CDATA[design]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[dark-mode]]></category>
            <dc:creator><![CDATA[Hu Chen]]></dc:creator>
            <pubDate>Mon, 06 Jan 2020 16:46:59 GMT</pubDate>
            <atom:updated>2020-01-06T16:46:59.006Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How to use a background script to fetch data in a Chrome extension]]></title>
            <link>https://levelup.gitconnected.com/how-to-use-background-script-to-fetch-data-in-chrome-extension-ef9d7f69625d?source=rss-dc12cffe5f2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef9d7f69625d</guid>
            <category><![CDATA[create-react-app]]></category>
            <category><![CDATA[chrome-extension]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[developer-tools]]></category>
            <dc:creator><![CDATA[Hu Chen]]></dc:creator>
            <pubDate>Mon, 08 Jul 2019 09:02:47 GMT</pubDate>
            <atom:updated>2019-07-09T01:50:19.650Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to use background script to fetch data in a Chrome extension</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E3_Npitn4Hi9qedCf5aA5w.jpeg" /><figcaption>Hacker Tab: Chrome extension to view GitHub trending projects on new tab 📈</figcaption></figure><p>If you are not sure how to write a chrome extension, you may first have a look at my previous story <a href="https://levelup.gitconnected.com/how-to-use-react-js-to-create-chrome-extension-in-5-minutes-2ddb11899815"><strong>How to use React.js to create a cross-browser extension in 5 minutes</strong></a>. It teaches you how to use create-react-app to build a browser extension for the new tab.</p><p>The extension we built was good, but every time the user opens a new tab we will reload the latest trending repositories from API which could take a few seconds. Even if it just takes a second, it is still slow for a new tab opening.</p><blockquote>What if we fetch data in background periodically, save the data in localStorage, and read it on open a new Tab?</blockquote><p>I have spent a few days to research about it and discovered that it is totally feasible. In this article, I will share with you what I have learned during the process.</p><h3>1. Adding background script to manifest.json</h3><p>Background script can react to browser events and perform certain actions, the background page is loaded when it is needed, and unloaded when it goes idle. To use the background file, declare it as follows in the manifest.json file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*MFhgQocI8gTPcWm3BG1IUw.png" /></figure><p>You will notice the persistent parameter, a persistent background page exists during the lifetime of the extension and only one instance of it actively running in the background of the Chrome browser waiting for the user to interact with the extension.</p><p>According to <a href="https://developer.chrome.com/extensions/background_migration">Google developer documentation</a>, it is more recommended to use non-persist mode and it could help reduce the resource cost of your extension. A non-persistent background script is purely event-based, it stays dormant until an event they are listening for fires, react with specified instructions, then unload. Some examples of events include:</p><ul><li>The extension is first installed or updated to a new version or browser restarted.</li><li>The background page was listening for an event, and the event is dispatched. (e.g. We will create <a href="https://developers.chrome.com/extensions/alarms">alarm</a> to dispatch event periodically)</li><li>A content script or other extension <a href="https://developer.chrome.com/extensions/messaging">sends a message.</a></li><li>Another view in the extension, such as a popup, calls <a href="https://developer.chrome.com/extensions/runtime#method-getBackgroundPage">runtime.getBackgroundPage</a>.</li></ul><h3>2. Adding alarms to trigger actions periodically</h3><p>You might be familiar with the code below to run something periodically:</p><pre>window.setInterval(function() {<br>  console.log(&#39;Hello, world!&#39;); <br>}, 1000 * 60 * 3);</pre><p>It prints “Hello, world!” every 3 minutes. To change it to event-based alarm, we will use <a href="https://developer.chrome.com/extensions/alarms">alarms API</a> instead.</p><pre>chrome.alarms.create(&#39;refresh&#39;, { periodInMinutes: 3 });</pre><p>Then add a listener.</p><pre>chrome.alarms.onAlarm.addListener((alarm) =&gt; {<br>  alert(&quot;Hello, world!&quot;);<br>});</pre><p>We will need to create an alarm when the extension is installed so that the alarm will be triggered every 3 minutes in the background, this is our background.js so far.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ba8bbf6368fd1c13d645883823c7bef7/href">https://medium.com/media/ba8bbf6368fd1c13d645883823c7bef7/href</a></iframe><p>To use alarms, you will also need to add alarms permission in manifest.json</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6ae3a417c16e1fda11c52ea408c32fd0/href">https://medium.com/media/6ae3a417c16e1fda11c52ea408c32fd0/href</a></iframe><h3>3. Debugging background script</h3><p>To test whether the above scripts could run as expected, we will need to test it locally. This is very similar to the steps in <a href="https://levelup.gitconnected.com/how-to-use-react-js-to-create-chrome-extension-in-5-minutes-2ddb11899815">previous story</a>.</p><ol><li>Make sure developer mode is on as shown on the image above.</li><li>Click “Load unpacked” and target folder contains your manifest.json .</li><li>Instead of inspecting on the new tab, you should click background page, as background page is running in a separate process.</li><li>If you have changed code locally, you will need to click reload.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZZGyikrW8ch4wb5RpJrzWg.jpeg" /><figcaption>Test extension locally</figcaption></figure><p>As you can see from the image below, the alarms are running every 3 minutes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*bWmCzyGWk-6Hgo96hhGPyw.png" /><figcaption>Inspect background script</figcaption></figure><p>And you could check <strong>network</strong>, <strong>localStorage</strong> here as well. If your extension modified new tab, the localStorage is shared across your extension, that is how we communicate data between your background script and the new tab extension.</p><h3>4. Fetch data and save to localStorage</h3><p>Now we have a basic alarm working, let’s fetch data and save to local storage. Later in our React extension, we could direct read from local storage on loaded instead of fetch from API.</p><ol><li>We will create a “<strong>refresh</strong>” alarm to fetch and save data every 30 minutes when the extension is first installed or upgraded.</li><li>We will fetch data when chrome is restarted so that the user will get the latest data.</li><li>We will also create another “<strong>watchdog</strong>” alarm every 5 minutes to check whether the refresh alarm is still available, if not, we will create it. (It might not be necessary for it here)</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5f05d1299e1ad2adc81de74d2e2d7196/href">https://medium.com/media/5f05d1299e1ad2adc81de74d2e2d7196/href</a></iframe><h3>5. Reuse logic and transpile to ES5</h3><p>There are two problems with the code above and we will need to solve them now:</p><ol><li>Notice that we did not write the implementation for fetchRepositories and saveToLocalStorage, they are most likely already available in your React app, it is fine to copy the implementation to background.js but it will be better if we could reuse the functions to keep code DRY.</li><li>We have written the background.js using ES6 syntax like <strong>=&gt;</strong>and <strong>async await</strong>, older browsers might not be able to run it.</li></ol><p>Here we will use webpack to help bundle and transpile the code to ES5.</p><h4>5.1 Install dependencies</h4><pre>yarn add --dev webpack-cli npm-run-all rimraf</pre><p>Notice we should not install webpack.( react-scripts already have it in dependency and it will complain about another instance of webpack ). Feel free to install it if you are not using create-react-app .</p><h4>5.2 Change build script</h4><p>Now change your build script to build both your app and background script:</p><pre>&quot;prebuild&quot;: &quot;rimraf build&quot;,<br>&quot;build&quot;: &quot;npm-run-all build:*&quot;,<br>&quot;build:app&quot;: &quot;INLINE_RUNTIME_CHUNK=false react-scripts build&quot;,<br>&quot;build:bg&quot;: &quot;webpack --mode production ./src/background.js --output ./build/background.js&quot;,</pre><p>We have already covered INLINE_RUNTIME_CHUNK=false in a <a href="https://levelup.gitconnected.com/how-to-use-react-js-to-create-chrome-extension-in-5-minutes-2ddb11899815">previous tutorial</a>. After the change, if you run npm run build , it will perform</p><ul><li>Clean the build folder</li><li>Bundle the React extension using react-script</li><li>Bundle the src/background.js using webpack and export to build/background.js</li></ul><h4>5.3 Refactor ./src/background.js</h4><p>In your src/background.js , you are free to import any external libraries like lodash or import constants/functions from other files, such as:</p><pre>import { <br>  fetchRepositories, <br>  saveToLocalStorage<br>} from &#39;./lib/helpers&#39;;</pre><pre>chrome.runtime.onInstalled.addListener(() =&gt; {<br>...</pre><p>Your code is much cleaner now.</p><h4>5.4 Update ESlint config</h4><p>If you are using ESLint in your editor, it might be complaining about chrome is not defined in your ./src/background.js . That is because chrome API is only available in extensions, we will need to tell ESLint that we are developing extension and please ignore those.</p><p>Add/update the following lines in your package.json .</p><pre>&quot;eslintConfig&quot;: {<br>  &quot;extends&quot;: &quot;react-app&quot;,<br>  &quot;env&quot;: {<br>    &quot;browser&quot;: true,<br>    &quot;webextensions&quot;: true<br>  }<br>}</pre><p>After adding webextensions to env , editor will no longer complain about it.</p><h4>5.5 Add .babelrc</h4><p>Webpack will need a .babelrc file to compile, and we will need to add it manually. Since react-scripts have already installed babel-presets-react-app , we will just need to use it.</p><pre>{<br>  &quot;presets&quot;: [&quot;react-app&quot;]<br>}</pre><p>Now run npm run build will have your complete extension together with compiled background script in your build folder.</p><h3>That’s it!</h3><p>If you are curious, you could check all the file changed <a href="https://github.com/huchenme/hacker-tab-extension/commit/ff765829f2d96ea5e53265b11d4a27cec4133b5d">in the commit</a> of my extension on GitHub.</p><p>Thank you for reading this far. You could check the source code in <a href="https://github.com/huchenme/hacker-tab-extension">Github</a> or download the extension in <a href="https://chrome.google.com/webstore/detail/hacker-tab/ibomigipadcieapbemkegkmadbbanbgm">Chrome Web Store</a> and <a href="https://addons.mozilla.org/en-US/firefox/addon/hacker-tab/">Firefox Add-ons Hub</a>, happy hacking, and let me know what you have built!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef9d7f69625d" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/how-to-use-background-script-to-fetch-data-in-chrome-extension-ef9d7f69625d">How to use a background script to fetch data in a Chrome extension</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to scrape any website and build an API using cheerio.js]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://levelup.gitconnected.com/how-to-scrape-any-website-and-build-an-api-using-cheerio-js-6a3f0c651d2e?source=rss-dc12cffe5f2e------2"><img src="https://cdn-images-1.medium.com/max/1278/1*zWhHZUDWuxJwfEoumC1-OQ.png" width="1278"></a></p><p class="medium-feed-snippet">I was looking for GitHub trending projects API, but unfortunately, GitHub does not provide an official API for it. I end up building&#x2026;</p><p class="medium-feed-link"><a href="https://levelup.gitconnected.com/how-to-scrape-any-website-and-build-an-api-using-cheerio-js-6a3f0c651d2e?source=rss-dc12cffe5f2e------2">Continue reading on Level Up Coding »</a></p></div>]]></description>
            <link>https://levelup.gitconnected.com/how-to-scrape-any-website-and-build-an-api-using-cheerio-js-6a3f0c651d2e?source=rss-dc12cffe5f2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a3f0c651d2e</guid>
            <category><![CDATA[nowsh]]></category>
            <category><![CDATA[cheeriojs]]></category>
            <category><![CDATA[web-scraping]]></category>
            <category><![CDATA[expressjs]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Hu Chen]]></dc:creator>
            <pubDate>Sun, 09 Jun 2019 12:59:03 GMT</pubDate>
            <atom:updated>2019-06-10T08:58:44.490Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How to use React.js to create a Chrome extension in 5 minutes]]></title>
            <link>https://levelup.gitconnected.com/how-to-use-react-js-to-create-chrome-extension-in-5-minutes-2ddb11899815?source=rss-dc12cffe5f2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ddb11899815</guid>
            <category><![CDATA[chrome-extension]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[reactjs]]></category>
            <dc:creator><![CDATA[Hu Chen]]></dc:creator>
            <pubDate>Wed, 20 Feb 2019 15:40:28 GMT</pubDate>
            <atom:updated>2019-07-08T09:04:36.720Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to use React.js to create a cross-browser extension in 5 minutes</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZLuAHJBJ81KtkP8ZB9R8tA.jpeg" /><figcaption>Hacker Tab: Chrome extension to view GitHub trending projects on new tab 📈</figcaption></figure><blockquote><strong>Update</strong>: this blog post was originally targeted for Chrome extension, I have recently <a href="https://addons.mozilla.org/en-US/firefox/addon/hacker-tab/">ported to Firefox</a> and would like to share what I have learned here as well ✨.</blockquote><h4>Also Read:</h4><p><a href="https://medium.com/@chen/how-to-use-background-script-to-fetch-data-in-chrome-extension-ef9d7f69625d"><strong>Part 2: How to use background script to fetch data in Chrome extension</strong></a></p><p>Recently I have tried to create a <a href="https://chrome.google.com/webstore/detail/hacker-tab/ibomigipadcieapbemkegkmadbbanbgm">Chrome extension</a> that <strong>replaces new tab</strong> screen with GitHub trending projects, and it <a href="https://www.producthunt.com/posts/hacker-tab">got trending</a> in Product Hunt. I built it using <a href="https://github.com/facebook/create-react-app">create-react-app</a> and I would like to share how I did it, in 5 minutes.</p><h3>1. Create the application</h3><p>The Chrome extension I created replaces new tab screen to a custom page which I built with <strong>create-react-app</strong>. It does not matter which framework you are using — React.js, Vue.js, or vanilla HTML with CSS and JS, as long as you could serve the HTML file in the browser, it will work as a Chrome extension.</p><p>In my project, I used <a href="https://github.com/facebook/create-react-app">create-react-app</a> to create, run, and bundle application. I also used <a href="https://redux.js.org/">Redux</a> for state management and <a href="https://www.styled-components.com/">styled-components</a> for styling.</p><pre>$ npx create-react-app my-awesome-extension<br>$ cd my-awesome-extension<br>$ npm start</pre><p>You should be able to see the default creact-react-app launching page at <a href="http://localhost:3000/">http://localhost:3000</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DTdRTGlVt4Yrywfw5IaXRA.jpeg" /><figcaption>Launching page of create-react-app</figcaption></figure><p>This tutorial won’t cover how to develop a webpage using React.js, there are tons of great resources out there. I will focus on how to turn the app into a Chrome extension. Now heads down and code your application.</p><h3>2. Prepare for Chrome extension</h3><p>Once you have a working version locally, there are a few other things you will need to config when preparing your extension.</p><h4>Create manifest.json</h4><p>There was a manifest.json file in the public folder which is for PWA purposes or configuring our extension. You will need to replace it with content below, which will be copied over to the build folder during build process, and Chrome will use it as the configuration file of the extension.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/69a47435079fcd18060a1ca5127a65a3/href">https://medium.com/media/69a47435079fcd18060a1ca5127a65a3/href</a></iframe><p>The above snippet is what I have used in my extension. You can find <a href="https://developer.chrome.com/extensions/manifest">other config options</a> as well.</p><ul><li><a href="https://developer.chrome.com/extensions/manifest/version">version</a>: the version of your extension, you should update this when you plan to release a new version.</li><li><a href="https://developer.chrome.com/extensions/manifest/icons">icons</a>: you need different sizes of Icons to be used in different cases (e.g. Chrome Web Store), normally you will only need 16x16 , 48x48 and 128x128 .</li><li><a href="https://developer.chrome.com/extensions/override">chrome_url_overrides</a>: as we are overriding chrome new tab to a custom HTML page, we need to replace newtab to index.html</li><li><a href="https://developer.chrome.com/extensions/declare_permissions">permissions</a>: include the permissions you need in your extension. I am using <a href="https://developer.chrome.com/apps/storage">chrome.storage</a> API to store user preferred programming languages so I have added storage permission. In general practice, you should only add permissions required in the application.</li></ul><h4>INLINE_RUNTIME_CHUNK=false</h4><p>By default, Create React App embeds a small runtime script into index.html during the production build, this is to reduce the number of HTTP requests. But unfortunately, you will see console errors related to <a href="https://developers.google.com/web/fundamentals/security/csp/#inline_code_is_considered_harmful">CSP</a>. You could turn off the embedding behavior by setting the INLINE_RUNTIME_CHUNK flag to false .</p><p><strong>change in </strong><strong>package.json :</strong></p><pre>&quot;build&quot;: &quot;INLINE_RUNTIME_CHUNK=false react-scripts build&quot;</pre><h4>Switch to Chrome default tab</h4><p>Sometimes people would like to switch back to the default Chrome tab to access top sites. We could use chrome.tabs API.</p><pre>&lt;Button<br>  onClick={() =&gt; {<br>    chrome.tabs.getCurrent(tab =&gt; {<br>      chrome.tabs.update(tab.id, {<br>        url: &#39;chrome-search://local-ntp/local-ntp.html&#39;,<br>      });<br>    });<br>  }}&gt;<br>  Chrome Tab<br>&lt;/Button&gt;</pre><blockquote>The URL is not working for Firefox, I have used <a href="https://github.com/quentin-sommer/react-useragent">react-useragent</a> to only show this button for Chrome. <a href="https://github.com/huchenme/hacker-tab-extension/blob/v1.2.1/src/components/GitHub/TopBar.js#L38-L54">Check code here</a>.</blockquote><h4>Delete favicon</h4><p>Create React App comes with a default favicon.ico in the public folder. For Chrome New Tab, we do not want to have any favicons for the new tab, so we remove it from public folder and also remove the link in index.html .</p><h4>Adding launching placeholder</h4><p>Because React.js initially loads an empty page before the application is rendered in Javascript, from my experience there is a noticeable flash of blank page before everything gets rendered. This is not a great experience for the user.</p><p>There are a few ways to resolve this, one way is to <a href="https://facebook.github.io/create-react-app/docs/pre-rendering-into-static-html-files">pre-render into static HTML files</a> using <a href="https://www.npmjs.com/package/react-snapshot">react-snapshot</a> or <a href="https://github.com/stereobooster/react-snap">react-snap</a>.</p><p>This method does not suit the use case of my extension because it also pre-renders the data from the server, causing initial HTML to always contain outdated repositories before new data comes in.</p><p>At the time of writing, I have not figured out how to resolve this issue if using snapshot libraries, so I come with a simpler solution.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2395f7c0a2c3412d1f86997c010bba7b/href">https://medium.com/media/2395f7c0a2c3412d1f86997c010bba7b/href</a></iframe><p>I have styled index.html so that it displays a grey logo at the center of the page before the application gets rendered, and it works quite nicely.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RnOZoIFWLbs9OanaNrx4Wg.jpeg" /><figcaption>Launching Page</figcaption></figure><p>Once Javascript finished rendering, root will be replaced with actual content.</p><h3>3. Testing locally for Chrome</h3><p>Before publishing to Chrome Web Store, it is always good to test locally.</p><p>All you need to do is to run npm run build to put everything required into build folder, then launch <a href="/service/chrome://extensions/">chrome://extensions/</a> in Google Chrome.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BQ8s3XtYXvWSKETlp2KYIA.jpeg" /><figcaption>Test extension locally</figcaption></figure><ol><li>Make sure developer mode is on as shown on the image above (1).</li><li>Click “Load unpacked” and target “build” folder in your project, it should contain index.html , manifest.json, different sizes of logos, and bundled javascript files (2).</li><li>Make sure other extensions like <a href="https://chrome.google.com/webstore/detail/momentum/laookkfknpbbblfpciffpaejjkokdgca">Momentum</a> which also modify new tab is disabled (3).</li><li>If you have already published a version in production and you are testing a newer version, you should also disable the production version. (The local version will have a red icon at bottom right corner as in the picture (4))</li></ol><p>Opening a new tab should allow you to test your shiny new extensions!</p><p>To update the extension, you will need to change the code, run npm run build again, and click the “Refresh” button (5).</p><h3>4. Testing locally on Firefox</h3><p>Luckily the code we have just done works out of the box on Firefox, testing on Firefox is similar as well.</p><p>Launch <a href="/service/about:addons">about:addons</a> in Firefox browser and turn on “debug addons”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NrnYoeAugZMrHgOCZH837A.jpeg" /><figcaption>Turn on “Debug Addons”</figcaption></figure><p>You could see interface has changed slightly, now click “Load Temporary Add-on”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ElpYimMiCcU7vLf8Yqn6HA.jpeg" /></figure><p>Click any file in “build” folder, you could just choose “manifest.json”.</p><p>Now you could see your extension in the list as well, open a new tab and test everything is ok, if you would like to make a change, run npm run build again and click “Reload” button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N_xZ0atrv9JrCDLmGC6zCA.jpeg" /></figure><h3>That’s it!</h3><p>Now you have your extension ready, just follow this official documentation and publish your extension to <a href="https://developer.chrome.com/webstore/publish">Chrome Web Store</a> or <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/Distribution/Submitting_an_add-on">Firefox Add-ons Hub</a>.</p><h4>Also Read:</h4><p><a href="https://medium.com/@chen/how-to-use-background-script-to-fetch-data-in-chrome-extension-ef9d7f69625d"><strong>Part 2: How to use background script to fetch data in Chrome extension</strong></a></p><p>Thank you for reading this far. You could check the source code in <a href="https://github.com/huchenme/hacker-tab-extension">Github</a> or download the extension in <a href="https://chrome.google.com/webstore/detail/hacker-tab/ibomigipadcieapbemkegkmadbbanbgm">Chrome Web Store</a> and <a href="https://addons.mozilla.org/en-US/firefox/addon/hacker-tab/">Firefox Add-ons Hub</a>, happy hacking, and let me know what you have built!</p><figure><a href="https://levelup.gitconnected.com/"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E6CoI_MRyZ1JInNPsBSHtA.png" /></a></figure><p><a href="https://gitconnected.com/learn/react">Learn React - Best React Tutorials (2019) | gitconnected</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ddb11899815" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/how-to-use-react-js-to-create-chrome-extension-in-5-minutes-2ddb11899815">How to use React.js to create a Chrome extension in 5 minutes</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Some Advanced Git Tips]]></title>
            <link>https://medium.com/free-code-camp/index-e24a27d02fa?source=rss-dc12cffe5f2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/e24a27d02fa</guid>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Hu Chen]]></dc:creator>
            <pubDate>Sat, 21 Apr 2018 15:42:01 GMT</pubDate>
            <atom:updated>2018-04-21T15:42:57.081Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y8rB1U51Y48BEgi4lxJUhQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@helloimnik">Hello I’m Nik</a></figcaption></figure><p>Recently I learnt <a href="https://frontendmasters.com/courses/git-in-depth/">Git In-depth</a> in <a href="https://frontendmasters.com/">Frontend Masters</a> by <a href="https://twitter.com/nnja">Nina</a>, it was about 4 hours course, I <a href="https://twitter.com/huchenme/status/986621093472485376">tweeted</a> some notes while learning and I think it is nice to convert them into a blog post.</p><h4>Most useful</h4><ul><li>git add -p will add your changes in chunks, like what <a href="https://www.sourcetreeapp.com/">SourceTree</a> is able to do, but git add -p is more powerful, you can even divide chunks into smaller pieces.</li><li>git show &lt;SHA&gt; will show all the details of a commit, which I did not know before.</li><li>git merge --no-ff will merge with a merge commit, even if there is no conflict and git is able to fast forward, and I finally learnt what does fast forward means.</li><li>git config rerere.enabled true no more repeat same merge conflict again, resolve once and git will remember it and automatically does the same for you next time.</li><li>git branch --merged=master find all branches that have already been merged into master, it is very handy when you want to do some cleanups.</li><li>git stash --include-untracked will stash untracked files as well.</li><li>git commit --fixup &lt;SHA&gt; combined with git rebase -i --autosquash &lt;SHA&gt;~ is awesome! I was doing some random commit message and squash using git rebase -i, now I don&#39;t need to write random commit message any more!</li><li>git clean -d will clean untracked files and directories. You need to combine with -f to do actual clean or --dry-run to see what will be cleaned.</li><li>git reset --merge ORIG_HEAD will undo a merge.</li></ul><h4>Some random tips</h4><ul><li>cat .git/HEAD will show where the current HEAD is.</li><li>git stash save &#39;message&#39; will stash with messages.</li><li>git show-ref will show hashes of all local and remote branches and tags.</li><li>HEAD~ is same as HEAD~1, and try not to use ^, it is most likely not what you want.</li><li>git log --name-status --follow filename will show all history of that file</li></ul><h4>git reset vs git checkout</h4><p>This might be the most confusing part of git. Normally we use git checkout to checkout a branch, or certain commits, and use git reset to undo a commit. But it is more than that.</p><h4>git checkout</h4><ul><li>If you use git checkout on a file, that is git checkout &lt;SHA&gt; -- filename, serves as a way to revert back to an old version of an individual file.</li><li>git checkout HEAD -- filename will reset a file to HEAD version, no matter whether you have staged the changes of the file.</li><li>git checkout -- filename will remove local changes which are not staged, but not make change in staging area.</li></ul><h4>git reset</h4><ul><li>git reset -- filename will move a file out of staging area, which means unstage a file.</li><li>git reset -- filename is same as git reset HEAD -- filename.</li><li>git reset &lt;SHA&gt; -- filename will update the file in staging area, and keep working area unchanged. git reset &lt;SHA&gt; -- filename + git checkout -- filename = git checkout &lt;SHA&gt; -- filename.</li><li>git reset &lt;SHA&gt; will move HEAD to the commit, and keep diff of current version and commit version in working area.</li><li>git reset --soft &lt;SHA&gt; will move HEAD to the commit, and keep diff of current version and commit version in staging area. As if you make a change, stage it and make a commit, you can consider this command one step backward.</li><li>git reset --hard &lt;SHA&gt; will move HEAD to the commit, and discard changes.</li></ul><h4>Conclusion</h4><p>You can find the full slides and tips <a href="https://github.com/nnja/advanced-git">here</a>, it is the place I will constantly check back.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e24a27d02fa" width="1" height="1" alt=""><hr><p><a href="https://medium.com/free-code-camp/index-e24a27d02fa">Some Advanced Git Tips</a> was originally published in <a href="https://medium.com/free-code-camp">We’ve moved to freeCodeCamp.org/news</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to use Gatsby to create your blog and work on it from your phone]]></title>
            <link>https://medium.com/free-code-camp/how-to-write-a-blog-using-gatsby-from-your-phone-e92a99851a04?source=rss-dc12cffe5f2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/e92a99851a04</guid>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[blog]]></category>
            <dc:creator><![CDATA[Hu Chen]]></dc:creator>
            <pubDate>Wed, 18 Apr 2018 09:46:27 GMT</pubDate>
            <atom:updated>2018-04-25T12:41:38.669Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YFDeSO9ljiYaszZk1FXm8Q.jpeg" /><figcaption><em>Image by </em><a href="https://unsplash.com/@jesuskiteque"><strong><em>Jesus Kiteque</em></strong></a></figcaption></figure><p>Recently, I decided to migrate my blog to <a href="https://www.gatsbyjs.org/">Gatsby</a>. Gatsby is a blazing fast static site generator based on React.</p><h3><strong><em>The Issue</em></strong></h3><h4><strong><em>Why do people love to write on platforms like Medium rather than using static site generator?</em></strong></h4><p>There are two kinds of people: people who write on platforms like Medium and people who code the blog themselves using static site generators.</p><p>There are lots of advantages to writing on public platforms like Medium over static site generators. If you write in public platforms, you can write on a laptop, and edit on your phone. Once you’ve finished writing, you just need to click the “Publish” button. Everything is done, your blog is live, and you can reach your audience right away.</p><p>On the other hand, if you write a blog in static site generator, you will need to remember all the scripts, preview the blog on localhost, build the blog for production, commit and push your changes to GitHub, and deploy your site to the public. If anything goes wrong, you might have to repeat some of the steps and wait a few minutes until the blog online is what you want.</p><p>You will end up spending much more time doing unimportant things other than the actual writing.</p><h4><strong><em>Why should you write on Gatsby instead of public platforms?</em></strong></h4><p>I guess this is why people eventually give up writing using a static site generator and write on Medium instead. But there is something Medium or Wordpress cannot provide: the more you write, the more you want to keep your writings in a secure place, in a simple format, just like you might keep your diary books for years.</p><p>But imagine that one day you want to migrate everything you wrote from Medium to somewhere else. That is when you hope you have written everything in Markdown and have a site hosting those Markdown files.</p><h4><strong><em>But how can I make writing in Gatsby as easy as writing on Medium?</em></strong></h4><p>Writing using a static site generator does not need to be difficult. I always believe that the easier it is to write and publish your blog, the more you will write. After trying and researching different setups, I am pretty happy with the result.</p><p>In my setup with Travis CI, git push is the new &quot;Publish&quot; button. All you need to do is to commit and push your code. And I will also share how to edit the blog on your phone.</p><p>I’ve divided this post into five sections:</p><ol><li><strong>How to create a Gatsby blog</strong></li><li><strong>Setting up Github Pages to host your blog</strong></li><li><strong>Seting up Travis for automatic deployment</strong></li><li><strong>Adding a new blog and publishing it</strong></li><li><strong>Bonus: How to write a blog on your phone</strong></li></ol><h3>1. How to create a Gatsby blog</h3><p>There are <a href="https://scotch.io/tutorials/zero-to-deploy-a-practical-guide-to-static-sites-with-gatsbyjs">plenty</a> of <a href="https://www.gatsbyjs.org/tutorial/">tutorials</a> on how to setup a blog using Gatsby that discuss all the powerful features Gatsby provides. This post will not focus on that, but I will still show some basic steps to get your blog up and running.</p><p>I assume you are already a JavaScript developer and know some basics of npm, yarn, and continuous integration. For this tutorial, I will be using yarn but feel free to use npm.</p><p>First, install gatsby-cli and create a new repo using Gatsby&#39;s official blog starter.</p><pre>$ yarn global add gatsby-cli</pre><pre>$ gatsby new gatsby-blog https://github.com/gatsbyjs/gatsby-starter-blog</pre><pre>$ cd gatsby-blog</pre><pre>$ gatsby develop</pre><p>Now, open localhost:8000 in your browser and you should see the generated blog in your browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5Z7vn-S6ovBOLUX_GVPpqQ.jpeg" /></figure><h3>2. Setup Github Pages to host your blog</h3><p>Now, let’s host the blog publicly.</p><p>There are plenty of options to host your site for free, but I prefer to put both source code and production code in a single place. Since I commit my code to GitHub, I prefer to host my site using <a href="https://pages.github.com/">GitHub Pages</a>. But feel free to use other services to host your static site.</p><blockquote>Note: Later I will need to use <a href="https://travis-ci.org/">Travis CI</a> to automatically deploy the website after each commit, so you might also need to check which <a href="https://docs.travis-ci.com/user/deployment/">platforms they support</a> for deployment.</blockquote><p>Now, create a repo named <strong>username.github.io.</strong> This will be the repo of both the source code for your site and the generated production build.</p><p>Because GitHub Page serves content from the master branch, you will need to deploy the content of the public folder generated by the yarn build command to the master branch. We will need to put our source code into another branch. We’ll call it develop.</p><p>Let’s create an initial commit and rename the branch to develop.</p><pre>$ git init</pre><pre>$ git add .</pre><pre>$ git commit -m “Initial Commit”</pre><pre>$ git branch -m develop</pre><p>Now, we need to push our code into GitHub. If you have already created the repo named <strong>username.github.io</strong>, push your code into the repo.</p><pre>$ git remote add origin git@github.com:username/username.github.io.git</pre><pre>$ git push -u origin develop</pre><p>Make sure that there is no master branch in your GitHub repo, and that the default branch is set to develop.</p><h3>3. Setup Travis for automatic deployment</h3><p>This is an important step. Although we can use yarn deploy to deploy, that is another three steps: generate public folder, deploy to GitHub Page, wait and check online.</p><p>But we can get rid of those steps with <a href="https://travis-ci.org/">Travis CI</a>. Travis CI is a hosted, distributed, continuous integration service used to build and test software projects hosted on GitHub.</p><p>If your project is public on GitHub, Travis CI is free. Now, create a Travis account by connecting to your GitHub and add your repo in Travis.</p><h4>Create a .travis.yml file in the project root</h4><pre>language: node_js</pre><pre>cache:</pre><pre>  directories:</pre><pre>    - ~/.npm</pre><pre>notifications:</pre><pre>  email:</pre><pre>    recipients:</pre><pre>      - chen@huchen.me</pre><pre>    on_success: always</pre><pre>    on_failure: always</pre><pre>node_js:</pre><pre>  - &#39;9&#39;</pre><pre>git:</pre><pre>  depth: 3</pre><pre>script:</pre><pre>  - yarn build</pre><pre>deploy:</pre><pre>  provider: pages</pre><pre>  skip-cleanup: true</pre><pre>  keep-history: true</pre><pre>  github-token: $GITHUB_TOKEN</pre><pre>  local-dir: public</pre><pre>  target-branch: master</pre><pre>  on:</pre><pre>    branch: develop</pre><p>You can also view on <a href="https://gist.github.com/huchenme/fc3afa589cd64d6cdedad92fb7d70851">Gist</a>. Let me explain this config:</p><ul><li><strong>notifications</strong>: I asked Travis to send me an email on both success and failed to build. By default, it only sends an email if the status changed (for example, if it was success but changed to failed, or if it was failed, and changed to fixed the build). But I wanted to receive email even if it was success so I could double-check online.</li><li><strong>git:depth:3</strong>: I asked Travis to use depth 3 when cloning the project, as it will help make the build faster.</li><li><strong>script</strong>: The script Travis needs to run is yarn build, which creates static files in the public folder for further deployment.</li><li><strong>deploy</strong>: I asked Travis to deploy to GitHub Pages after yarn build script success. It uses the $GITHUB_TOKEN I set in the Travis repo setting (I will come to this next), pushes contents in public folder into GitHub master branch, and should only trigger deploy on the develop branch. Click <a href="https://docs.travis-ci.com/user/deployment/pages/">here</a> to read more about deploying config.</li></ul><h4>Create a token for Travis to push to GitHub</h4><p>You’ll need to <a href="https://help.github.com/articles/creating-an-access-token-for-command-line-use/">generate a personal access token</a> with the public_repo or repo scope (repo is required for private repositories) to allow Travis to push code to the GitHub repo. This is because Travis runs yarn build and needs to push the public folder into the master branch where GitHub Pages is serving.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N-H6EJB4kxiuG1uCId7DTQ.jpeg" /></figure><p>Once a token is created, you will need to <strong>copy and paste it</strong> into your Travis repo settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G1ta1ia2PcSJltqVzVWwhQ.jpeg" /></figure><p>Now, add .travis.yml in git and push changes to GitHub.</p><pre>$ git add .travis.yml</pre><pre>$ git commit -m “Add Travis config file”</pre><pre>$ git push origin develop</pre><p>Now, you can check the status on Travis. You should see Travis’ status changed to yellow (running). If everything is ok, it will turn green in a few minutes, and you should receive an email about the successful build. You can visit https://username.github.io to view your blog you just created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qRCpjhz6YAFUri9B_NKPpQ.jpeg" /></figure><h3>4. Add a new blog and publish</h3><p>Here comes the fun part. Now I will demonstrate how easy it is to publish a new blog using this process.</p><p>Now, let’s add a new blog.</p><ol><li>Create a file index.md in src/pages/new-blog; . You will need to create a new folder new-blog as well.</li><li>Put some simple content in index.md.</li></ol><pre>---</pre><pre>title: Hello New Blog</pre><pre>date: &quot;2018–04–16T23:46:37.121Z&quot;</pre><pre>---</pre><pre>Hello World</pre><p>3. Commit this new file and push into GitHub</p><pre>$ git add .</pre><pre>$ git commit -m “Add a new blog”</pre><pre>$ git push origin develop</pre><p>4. Wait for Travis to finish and check online. After you receive an email a few minutes later, you can check https://username.github.io again. You should see your new blog in the list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ElYE6gsAbamBlLf-M7KEYQ.jpeg" /></figure><h3>5. Bonus: how to write the blog from your phone</h3><p>I want to remove another barrier to writing your blog. I was only able to write my blog when I was with my laptop, but I wondered: could I use my phone to craft ideas and edit?</p><p>It turned out to be pretty easy. All you need to do is to <a href="https://support.apple.com/en-sg/HT206985">add your Desktop and Documents files to iCloud Drive</a> and put your repo either in Desktop or Documents. It may take some time initially, but once everything is uploaded, the updates are instant and I can view my edits in my laptop, my iPhone, and iPad at the same time without any issues.</p><p>There are plenty of markdown apps on iPhone. Personally, I find <a href="https://ia.net/writer">IA Writer</a> is the best: it supports all platforms, it is elegant and focused on writing, and it supports iCloud Drive very well.</p><p>Although I can also setup my iPhone to do git commits and pushes, I feel it is not necessary. If the most difficult part of writing a blog is already done, using a laptop to do the final checking and committing the code is not a big issue for me. git push is as simple as clicking the &quot;Publish&quot; button on Medium.</p><h3>That’s it!</h3><p>We have come to the end of this tutorial. Thank you for reading this far.</p><p>This post is just the tip of the iceberg of Gatsby’s features. I am amazed by its flexibility and powerful features. You should definitely checkout its <a href="https://www.gatsbyjs.org/tutorial/">official tutorial</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e92a99851a04" width="1" height="1" alt=""><hr><p><a href="https://medium.com/free-code-camp/how-to-write-a-blog-using-gatsby-from-your-phone-e92a99851a04">How to use Gatsby to create your blog and work on it from your phone</a> was originally published in <a href="https://medium.com/free-code-camp">We’ve moved to freeCodeCamp.org/news</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My priority A goals]]></title>
            <link>https://medium.com/@chen/priority-a-goals-509e5a375ed4?source=rss-dc12cffe5f2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/509e5a375ed4</guid>
            <dc:creator><![CDATA[Hu Chen]]></dc:creator>
            <pubDate>Fri, 06 Jun 2014 08:46:07 GMT</pubDate>
            <atom:updated>2014-07-18T04:42:13.229Z</atom:updated>
            <content:encoded><![CDATA[<h4>What I need to focus on in my next 5 years</h4><p>I was struggling for years to figure out what I want and what goals should be my top priorities.</p><p>I want to build an awesome startup; I want to meet more awesome people and know more people; I want to improve my design and frontend skills; I want to win design awards; I want to learn iOS development and Swift language; I want to finish reading books in my list; I want to improve my English; I want to travel around the world; I want to finish triathlon; I want to attend Boston marathon; I want to write stuff of what I just learnt; I want to learn lots of new things and technologies; I can keep going for ten minutes if you really want to hear.</p><p>If one of my friends ask me what is your plan and things you like, I can’t really tell in simple words.</p><blockquote>I should seriously priorities my goals.</blockquote><p>Today I watched <a href="https://www.youtube.com/watch?v=nrWavoJsEks#t=624">Paul Graham’s interview</a>, suddenly I am able to make my goals clear.</p><p>In YC Paul ask people to just focus on 3 things: build product; talk with customer and exercise, nothings else is that important. Keep goals short and few helps us remembering them and apply them to all our decision makings.</p><p>So I filtered and categorized my goals into 3.</p><ul><li><strong>Keep building stuffs (for myself).</strong> At the very early stage, nobody will know what idea will take off, it is just so hard to predict which one will success. In fact, surprising number of the most successful startups were not even supposed to be businesses in the very beginning, they were just projects. But one thing for sure, you won’t success by dreaming. I have so many ideas but I only put into actions for few of them, and most of them are died half way because my scope was too big and I want to put too many things into it at the beginning. Why not just spend one week to build an ugly V1 and start using it myself, release it, ask people to try it? I am going to do that from now.</li><li><strong>Keep things organized. </strong>I am a fan of personal productivity mostly because I am not a productive guy. I have experimented lots of methods and read lots of books: Get Things Done, Eat That Frog, Pomodoro Technique; tried apps like Omnifocus, Things, Clear. The more I tried, the more I get confused. Finally I realised that the problem is that I need a fixed routine and know exactly what I need to do now instead of thinking and procrastination. Another problem is that I keep fiddling, I never stick withe plan for more than 1 week.</li><li><strong>Exercise.</strong></li></ul><p>I have other things need to focus as well, they are not as urgent as the three things above. So I put them as priority B:</p><ul><li><strong>Cultivate friendships.</strong></li><li><strong>Write ideas and thoughts done.</strong></li><li><strong>Be helpful to others.</strong></li><li><strong>Read books and keep learning.</strong></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=509e5a375ed4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to spend my time]]></title>
            <link>https://medium.com/@chen/how-to-spend-my-time-c9d8f8ffde1f?source=rss-dc12cffe5f2e------2</link>
            <guid isPermaLink="false">https://medium.com/p/c9d8f8ffde1f</guid>
            <dc:creator><![CDATA[Hu Chen]]></dc:creator>
            <pubDate>Tue, 03 Jun 2014 13:20:58 GMT</pubDate>
            <atom:updated>2014-09-01T03:12:03.836Z</atom:updated>
            <content:encoded><![CDATA[<p>The book “Get Things Done” said that people are more productive if they know what to focus in different contexts. To keep a reference, I am listing my list of things to do for different contexts.</p><h4>Night</h4><p>Night is the most important time to improve myself.</p><ul><li>Work on a project</li><li>Read book</li><li>Improve or learn a new skill (including languages)</li><li>Exercise</li><li>Write blog</li><li>Plan for tomorrow</li></ul><h4>Saturday</h4><p>Just do all the non-working stuff and relax for the whole day.</p><ul><li>Sports</li><li>Movie</li><li>Outdoor activities</li><li>Video chat with parents</li><li>Shopping</li><li>Clean room</li><li>Hangout with friends</li></ul><h4>Sunday</h4><p>Sunday is the only day which I have long block time, use it wisely and get something significantly done.</p><ul><li>Eat a big frog</li><li>Write blog</li><li>Review and plan for next week</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9d8f8ffde1f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>