<?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 Chinmay Patel on Medium]]></title>
        <description><![CDATA[Stories by Chinmay Patel on Medium]]></description>
        <link>https://medium.com/@chimptl?source=rss-1c2bc3411078------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*hOE7hYi509M7mlMH.jpeg</url>
            <title>Stories by Chinmay Patel on Medium</title>
            <link>https://medium.com/@chimptl?source=rss-1c2bc3411078------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 06:43:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@chimptl/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[Getting Started With Electron]]></title>
            <link>https://medium.com/@chimptl/getting-started-with-electron-7c5f5b4f7947?source=rss-1c2bc3411078------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c5f5b4f7947</guid>
            <category><![CDATA[chromium]]></category>
            <category><![CDATA[electron]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Chinmay Patel]]></dc:creator>
            <pubDate>Tue, 08 Dec 2015 21:54:28 GMT</pubDate>
            <atom:updated>2015-12-08T21:54:28.784Z</atom:updated>
            <content:encoded><![CDATA[<p>Agenda<br>- Basic setup<br>- Load a web app in Electron<br>- Create a flashing icon<br>- Pass data between main process and renderer process</p><h3>Basic Setup</h3><p>Create a node module</p><pre>npm init</pre><pre># Your package.json file should look like<br>{<br>  &quot;name&quot;: &quot;hello-electron&quot;,<br>  &quot;version&quot;: &quot;1.0.0&quot;,<br>  &quot;description&quot;: &quot;&quot;,<br>  &quot;main&quot;: &quot;index.js&quot;,<br>  &quot;scripts&quot;: {<br>    &quot;test&quot;: &quot;echo \&quot;Error: no test specified\&quot; &amp;&amp; exit 1&quot;<br>  },<br>  &quot;author&quot;: &quot;&quot;,<br>  &quot;license&quot;: &quot;ISC&quot;,<br>  &quot;devDependencies&quot;: {<br>    &quot;electron-prebuilt&quot;: &quot;^0.33.3&quot;<br>  }<br>}</pre><p>Install Electron Prebuild</p><pre># Install electron module in the package<br>npm install electron-prebuilt --save-dev</pre><pre># Install electron package to the OS<br>npm install -g electron-prebuilt</pre><p>Create an index.js file</p><pre>console.log(&#39;App is getting started.&#39;);</pre><pre>var app = require(&#39;app&#39;);</pre><pre>app.on(&#39;ready&#39;, function(){<br>  console.log(&#39;app is ready to be launched&#39;);<br>});</pre><p>Running or restarting the app</p><pre>electron . # where npm package is the current directory</pre><h3>Load a Web App In Electron</h3><p>Creating an HTML page to render (browser/index.html)</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>  &lt;head&gt;<br>    &lt;meta charset=&quot;utf-8&quot;&gt;<br>    &lt;title&gt;Hello World&lt;/title&gt;<br>  &lt;/head&gt;<br>  &lt;body&gt;<br>    &lt;h1&gt;Hello World&lt;/h1&gt;<br>&lt;/html&gt;</pre><p>Creating your first window</p><pre>...<br>var BrowserWindow = require(&#39;browser-window&#39;);<br>var mainWondow = null;</pre><pre>...<br>app.on(&#39;ready&#39;, function(){<br>  console.log(&#39;app is ready to be launched&#39;);<br>  createMainWindow();<br>});</pre><pre>...<br>app.on(&#39;window-all-closed&#39;, function(){<br>  app.quit();<br>});</pre><pre>...<br>function createMainWindow(){<br>  console.log(&#39;Creating Main Window&#39;);<br>  mainWindow = new BrowserWindow({<br>    &#39;width&#39;: 400,<br>    &#39;height&#39;: 400<br>  });</pre><pre>  mainWindow.loadUrl(&quot;file://&quot; + __dirname + &quot;/browser/index.html&quot;);<br>}</pre><h3>Creating a Flashing Window</h3><p>Update index.js</p><pre>// Somewhere at the start of the app<br>// may be inside app.on(&#39;ready&#39;)<br>setInterval(setFlashingWindow, 3000);<br></pre><pre>function setFlashingWindow(){<br>  console.log(&#39;The window should be flashing now&#39;);<br>  // Send Notification To User With Flashing Icon<br>  mainWindow.flashFrame(true);<br>}</pre><h3>Pass Data Between Main Process and Renderer Process</h3><p>Update index.js</p><pre>function setFlashingWindow(){<br>  ...<br>  // Send Notification To Browser Window<br>  var d = new Date();<br>  var data = &#39;Last flashed at &#39; + (new Date()).toString();<br>  // mainWindow.send(&#39;just-flashed&#39;, d);<br>  mainWindow.send(&#39;just-flashed&#39;, data);</pre><pre>}</pre><p>Update index.html</p><pre>&lt;body&gt;<br>    ...<br>    &lt;p id=&#39;flash-zone&#39;&gt;<br>    &lt;/p&gt;<br>  &lt;/body&gt;<br>  &lt;script&gt;<br>    var counter = 0;<br>    var ipc = require(&#39;ipc&#39;);<br>    ipc.on(&#39;just-flashed&#39;, function(d){<br>      console.log(d);<br>      document.getElementById(&quot;flash-zone&quot;).innerHTML = d;<br>    });<br>  &lt;/script&gt;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c5f5b4f7947" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Laws of Life]]></title>
            <link>https://medium.com/@chimptl/laws-of-life-441605a70380?source=rss-1c2bc3411078------2</link>
            <guid isPermaLink="false">https://medium.com/p/441605a70380</guid>
            <dc:creator><![CDATA[Chinmay Patel]]></dc:creator>
            <pubDate>Wed, 06 Nov 2013 19:59:10 GMT</pubDate>
            <atom:updated>2013-11-18T02:28:32.770Z</atom:updated>
            <content:encoded><![CDATA[<h4>Startups, Philosophy, and Programming</h4><p>My aim is to use medium.com as a medium to share my thoughts on latest startups, philosophical situations, and latest programming techniques.</p><p>Looking forward to blog something on regular intervals.</p><p>“The hardest part of starting a new journey is taking a leap of faith right at the beginning” — unknown.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=441605a70380" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>