<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">



<title type="text">//TODO</title>
<generator uri="https://github.com/mojombo/jekyll">Jekyll</generator>
<link rel="self" type="application/atom+xml" href="http://blog.championswimmer.in/feed.xml" />
<link rel="alternate" type="text/html" href="http://blog.championswimmer.in/" />
<updated>2022-10-07T20:02:20+05:30</updated>
<id>http://blog.championswimmer.in/</id>
<author>
  <name>Arnav Gupta</name>
  <uri>http://blog.championswimmer.in/</uri>
  <email>championswimmer@gmail.com</email>
</author>


<entry>
  <title type="html"><![CDATA[Hustle Culture]]></title>
  <link rel="alternate" type="text/html" href="http://blog.championswimmer.in/2022/01/hustle-culture/"/>
  <id>http://blog.championswimmer.in/2022/01/hustle-culture</id>
  <published>2022-01-26T00:00:00+05:30</published>
  <updated>2022-01-26T00:00:00+05:30</updated>
  <author>
    <name>Arnav Gupta</name>
    <uri>http://blog.championswimmer.in</uri>
    <email>championswimmer@gmail.com</email>
  </author>
  <category scheme="http://blog.championswimmer.in/tags/#life,stories,blog" term="life,stories,blog" />
  <content type="html">
  
    &lt;p&gt;The last few years I have been at the intersection of tech, content, hustle culture, startups, creator economy and the move towards more indepent work.&lt;/p&gt;

&lt;p&gt;A thread about the current state and the road ahead. 🧵👇🏼&lt;/p&gt;

&lt;p&gt;(Might as well add a dystopian prophecy trigger warning)&lt;/p&gt;

&lt;p&gt;Today if you look around people are making a lot of noise about a few things&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;remote work, freelancing, independent work&lt;/li&gt;
  &lt;li&gt;side hustles, personal growth, financial advice&lt;/li&gt;
  &lt;li&gt;creator economy, social media, YT/Insta growth&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Seems doing all this is both sexy + essential to survive&lt;/p&gt;

&lt;p&gt;Here’s what I want to break it down at - it is sexy because some people you have come to like are constantly hammering that thought down your head.&lt;/p&gt;

&lt;p&gt;Reality is, it is becoming a way of life, and that is making surviving in the modern world an increasingly uphill battle.&lt;/p&gt;

&lt;p&gt;Let’s take an example of D2C brands. Making small crafts/utility/food products, selling to people.&lt;/p&gt;

&lt;p&gt;A lot of people are shouting from the roofs that D2C is bringing the power back to small makers, mom &amp;amp; pop business, and is a radical/liberal takeback from BigTech. Ok, but wait.&lt;/p&gt;

&lt;p&gt;Go to D2C subreddits, forums, telegram groups, discord servers or clubhouse rooms and try to find out what it takes to be D2C and a smol maker.&lt;/p&gt;

&lt;p&gt;Everyone invariably says - make an insta account, make catchy reels, get distribution.&lt;/p&gt;

&lt;p&gt;This starts to break apart the initial core argument that we are taking back control from big tech. Just because you don’t want to sell on Amazon, you now have to sell on Facebook (Instagram).&lt;/p&gt;

&lt;p&gt;Also everyone says how you can open up your own cute little store with Shopify&lt;/p&gt;

&lt;p&gt;Shopify, to be very honest, isn’t any flagbearer of small business. They are a $300B dollar company first of all. Second, they are closing the loop on the consumer end of it via &lt;a href=&quot;http://shop.app&quot;&gt;shop.app&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Shopify + &lt;a href=&quot;http://Shop.app&quot;&gt;Shop.app&lt;/a&gt; = Amazon pretty much. Fuck D2C.&lt;/p&gt;

&lt;p&gt;Let’s go back to another track of things - the hustle culture.&lt;/p&gt;

&lt;p&gt;Everyone’s saying “make side projects”, “open an YouTube channel”, “build in open”.&lt;/p&gt;

&lt;p&gt;Sounds nice. There are a lot of success stories too. (You can include me in that).&lt;/p&gt;

&lt;p&gt;But can everyone afford to do all that?&lt;/p&gt;

&lt;p&gt;2 years back, in my webdev classroom program, a young guy joined. He was exactly my age (25 then). 
A few years of work-ex, in a govt of India department working on IT support. He wanted to break into big tech or product companies. 
Sounded pretty normal to me.&lt;/p&gt;

&lt;p&gt;But whenever my 5-8pm classes would stretch a little longer, he’d ask to be excused early and leave. After a couple of times, he told me that he needs to go pick his wife (who is also working), and back home there is a 2 yr old kid.&lt;/p&gt;

&lt;p&gt;Suddenly I felt my stomach is missing.&lt;/p&gt;

&lt;p&gt;Like holy fucking crap. Here I am advertising side projects and staying up at night to build your own Tinder clone to get ahead in life. There’s someone responsible for a 2 year old kid.&lt;/p&gt;

&lt;p&gt;Easy to blame that on bad life decisions. But point is &lt;em&gt;privileges&lt;/em&gt; exist. Admit it.&lt;/p&gt;

&lt;p&gt;So yeah, it is easy to showcase a coupe of poster kids of hustle culture, who got a little successful with their YouTube live streams and positivity rants on Insta reels, and never had any financial/social burden to look back upon and proclaim that independent work is on the rise&lt;/p&gt;

&lt;p&gt;The reality is the median got shifted up. 
The day-and-night horns of hustle culture blaring makes us all think that is normal, and that leaves those without the privilege to hustle quite high and dry. Their normal (by last decade’s standards) lifestyle is now deprecated.&lt;/p&gt;

&lt;p&gt;Like look at the world around for a second and honestly ask yourself if we really are not in an episode of Black Mirror.&lt;/p&gt;

&lt;p&gt;To be able to knit some sweaters and sell, you need to go and dance on TikTok and hope enough creepy people find it sexy and hit like and share.&lt;/p&gt;

&lt;p&gt;To be able to stay relevant in the job market, so that if you ever want to switch jobs you can easily - you now have to, &lt;em&gt;after&lt;/em&gt; working 8 hours at your workplace, also work 8 more on side projects, which there is no guarantee of working.&lt;/p&gt;

&lt;p&gt;At work you might be working on only tech, or product, or marketing.&lt;/p&gt;

&lt;p&gt;For side projects, you have to come up with an idea, develop it, market it, and pray there are users who like it. Might need to do some ‘thought leadership’ threads on Twitter to drum up attention too.&lt;/p&gt;

&lt;p&gt;When did the world suddenly turn into this nightmare where everyone needs to have business-running skills, company-creating skills, just to be able to survive and life a life that matches up to the expectations and norms being advertised as bare minimum in the media.&lt;/p&gt;

&lt;p&gt;The pandemic has pushed the agenda forward. Those who are lockstep in with this newly changing ecosystem, and have the privilege to adapt to it, are drumming up the fervor for it.&lt;/p&gt;

&lt;p&gt;“2020s is creator economy” they shout with glee. “content is king” they proclaim. 
hurrah.&lt;/p&gt;

&lt;p&gt;Today for a mid sized company to just barely survive - they are told - they need to spew out an article everyday. “You can’t not have a newsletter bro!”. 
Who will write it though ? You don’t have the time to. So you hire a ‘writer’. They are a college kid with a blog.&lt;/p&gt;

&lt;p&gt;They don’t know jackshit about your business. But they got their first job at your place. They could’ve been so much happier writing what they love to write. But they need to survive too, so they take the job. 
Now they’re churning an article a day. Abt something they DON’T KNOW&lt;/p&gt;

&lt;p&gt;The articles are trash, adds no value to anyone, but out here in the internet with 3 billion brain dead pair of hands holding a glowing rectangular slab - whatever you push out in sufficient ‘volume’, gets this golden currency called ‘traction’. It works! Yay. Sales pour in.&lt;/p&gt;

&lt;p&gt;When David Graeber talked about bullshit jobs - even he probably never imagined what the world post 2020 will look like.&lt;/p&gt;

&lt;p&gt;But my oh my oh my. Have we created an economy actually solely around bullshit jobs.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.vox.com/2018/5/8/17308744/bullshit-jobs-book-david-graeber-occupy-wall-street-karl-marx&quot;&gt;vox.com/2018/5/8/17308…&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Have you talked to any friends recently who have one of those dead Instagram accounts ? 5 posts, 10 followers. And no Twitter account. Not even an Alt. 
Have left using Facebook too. And a LinkedIn which just has work-ex details filled, but not a single post.&lt;/p&gt;

&lt;p&gt;What do you think of them? Not up to much in life right ? 
Come on. If they were hitting some home runs at work, they would describe their ‘winning mantra’ on LinkedIn right ? 
If they had some hot takes on current geopolitical atmosphere, they’d tweet right ?&lt;/p&gt;

&lt;p&gt;If they were really enjoying life, travelling places, or cooking good food with their significant other, they must have posted photos on Instagram. Right ?&lt;/p&gt;

&lt;p&gt;What a sad life they must be having.&lt;/p&gt;

&lt;p&gt;I don’t know what’s sadder. That we think this way, or that IT IS ACTUALLY TRUE!&lt;/p&gt;

&lt;p&gt;What do I mean by it being actually true? 
Well, if you are not beating up your resume drum night and day on LinkedIn, you’ll statistically have less success in switching jobs. 
If you’re not sharing hot takes on Twitter and dumping pics on Instagram - how’ll you make friends ?&lt;/p&gt;

&lt;p&gt;Hell how’ll you even date? It is not like 90’s American sitcoms that you walk into a bar, order your whisky sour in sexy voice sitting beside someone from the other gender, and then end the night in bed with them, and 5 years later married to them.&lt;/p&gt;

&lt;p&gt;Everyone’s drumming up remote work too a lot. Nice I get that. But countless young folks are getting swept by that same wave into a ‘remote life’ too.&lt;/p&gt;

&lt;p&gt;Sitting in dark rooms they prefer to call studios, living out a virtual life, powered by dopamine blasts…&lt;/p&gt;

&lt;p&gt;… every time someone is watching their sad life on Twitch or YouTube.&lt;/p&gt;

&lt;p&gt;Some even break through. The rate 0.1% are able to do orbit-shifting maneovres, end up with millions of followers, actually mint some money, and win in this Black Mirror episode.&lt;/p&gt;

&lt;p&gt;But go look at Twitch and YouTube stats. How many are making hours and hours of videos from their sunlight-less rooms, which are watched by almost none. This despondency creates mental health problems, not to mention scurvy and weak bones due to siting in a prison cell all day&lt;/p&gt;

&lt;p&gt;Read this 2018 article Verge did about thousands of Twitch streamers whom no one watches&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.theverge.com/2018/7/16/17569520/twitch-streamers-zero-viewers-motivation-community&quot;&gt;theverge.com/2018/7/16/1756…&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I cannot fathom so many things.&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;why did they initially want to stream ? inspired by other streamers ? but what end goal ?&lt;/li&gt;
  &lt;li&gt;what they feel when no one watches ?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This fascination with ‘independent work life’ at the top financial/social strata is interesting in the sense that people from the top most strata are seemingly unable to look at and learn from the same cycle that played out for the strata just beneath them - the “GIG ECONOMY”.&lt;/p&gt;

&lt;p&gt;Today the “CREATOR ECONOMY” is where the “GIG ECONOMY” was 10-15 years ago.&lt;/p&gt;

&lt;p&gt;A certain social strata considered that as the holy grail of lifestyle shift, the golden ticket for upwards mobility.&lt;/p&gt;

&lt;p&gt;And for a few lucky + privileged + early adopters, it happened too.&lt;/p&gt;

&lt;p&gt;There are stories of cab drivers who turned millionaires.&lt;/p&gt;

&lt;p&gt;But there are chilling stories like this of a gig economy worker whose DoorDash van was stolen &lt;em&gt;with his 2 kids inside it&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.wired.com/story/gig-economy-uber-lyft-doordash-jeffrey-fang/&quot;&gt;wired.com/story/gig-econ…&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Want a jolt of reality? Read it.&lt;/p&gt;


  
  &lt;p&gt;&lt;a href=&quot;http://blog.championswimmer.in/2022/01/hustle-culture/&quot;&gt;Hustle Culture&lt;/a&gt; was originally published by Arnav Gupta at &lt;a href=&quot;http://blog.championswimmer.in&quot;&gt;//TODO&lt;/a&gt; on January 26, 2022.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[Delhi to Bangalore Road Trip]]></title>
  <link rel="alternate" type="text/html" href="http://blog.championswimmer.in/2022/01/delhi-to-bangalore-road-trip/"/>
  <id>http://blog.championswimmer.in/2022/01/delhi-to-bangalore-road-trip</id>
  <published>2022-01-22T00:00:00+05:30</published>
  <updated>2022-01-22T00:00:00+05:30</updated>
  <author>
    <name>Arnav Gupta</name>
    <uri>http://blog.championswimmer.in</uri>
    <email>championswimmer@gmail.com</email>
  </author>
  <category scheme="http://blog.championswimmer.in/tags/#life,stories,blog" term="life,stories,blog" />
  <content type="html">
  
    &lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/profile_images/1440946683123208192/-Lr_1ChM_normal.jpg&quot; alt=&quot;championswimmer&quot; /&gt;
Arnav Gupta 😷 💉🟢 💉🟢 (&lt;a href=&quot;https://twitter.com/championswimmer&quot;&gt;@championswimmer&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;So I recently moved from &lt;a href=&quot;https://twitter.com/hashtag/Delhi&quot;&gt;#Delhi&lt;/a&gt;  to &lt;a href=&quot;https://twitter.com/hashtag/Bangalore&quot;&gt;#Bangalore&lt;/a&gt;  and the easiest and fastest way I could move my work desk setup (monitors, PC, gaming chair) and my car was to stuff all that into the 🚗 and drive it all the way down.&lt;/p&gt;

&lt;p&gt;So here’s a smol thread 🧵 on a DEL-BLR road trip. &lt;a href=&quot;https://twitter.com/championswimmer/status/1453420393482440707/photo/1&quot;&gt;pic.twitter.com/CHIU2Ey63o&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/media/FCuWJJWVkAQ71Hq.jpg&quot; alt=&quot;3_1453420388629712900&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://twitter.com/championswimmer/status/1453420393482440707&quot;&gt;Tweet link&lt;/a&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/profile_images/1440946683123208192/-Lr_1ChM_normal.jpg&quot; alt=&quot;championswimmer&quot; /&gt;
Arnav Gupta 😷 💉🟢 💉🟢 (&lt;a href=&quot;https://twitter.com/championswimmer&quot;&gt;@championswimmer&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Day 1 was planned to be &lt;a href=&quot;https://twitter.com/hashtag/Delhi&quot;&gt;#Delhi&lt;/a&gt;  to &lt;a href=&quot;https://twitter.com/hashtag/Gwalior&quot;&gt;#Gwalior&lt;/a&gt; . But that would have left a very long 2nd day, so we planned to go a little further to Jhansi.&lt;/p&gt;

&lt;p&gt;A complete chance browsing through &lt;a href=&quot;https://twitter.com/bookingcom&quot;&gt;@bookingcom&lt;/a&gt; led us to discover this beautiful Bundelkhand Riverside Resort at Orchcha to stay. &lt;a href=&quot;https://twitter.com/championswimmer/status/1453420403158753282/photo/1&quot;&gt;pic.twitter.com/kKYFpbGAn1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/media/FCuWJ1zVQAItyGL.jpg&quot; alt=&quot;3_1453420400562487298&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://twitter.com/championswimmer/status/1453420403158753282&quot;&gt;Tweet link&lt;/a&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/profile_images/1440946683123208192/-Lr_1ChM_normal.jpg&quot; alt=&quot;championswimmer&quot; /&gt;
Arnav Gupta 😷 💉🟢 💉🟢 (&lt;a href=&quot;https://twitter.com/championswimmer&quot;&gt;@championswimmer&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Day 1 was 425 km. Total drive time was 10hrs+, because we stopped at Agra to visit &lt;a href=&quot;https://twitter.com/TajMahal&quot;&gt;@TajMahal&lt;/a&gt; too.&lt;/p&gt;

&lt;p&gt;Booked Hotel Atulyaa Taaj (apart from Oberoi Amarvilas, this is the nearest hotel to Taj) simply as an expensive parking spot 😅 as the car was loaded with stuff. &lt;a href=&quot;https://twitter.com/championswimmer/status/1453421547536801795/photo/1&quot;&gt;pic.twitter.com/vXZs8kooRh&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/media/FCuXMdTVcAMSimw.jpg&quot; alt=&quot;3_1453421545037066243&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://twitter.com/championswimmer/status/1453421547536801795&quot;&gt;Tweet link&lt;/a&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/profile_images/1440946683123208192/-Lr_1ChM_normal.jpg&quot; alt=&quot;championswimmer&quot; /&gt;
Arnav Gupta 😷 💉🟢 💉🟢 (&lt;a href=&quot;https://twitter.com/championswimmer&quot;&gt;@championswimmer&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;The Bundelkhand Riverside Resort is the haveli of the erstwhile Raja of Orchcha, and imho, the best possible place one can do a highway stop on the first leg of this trip. Highly recommended! &lt;a href=&quot;https://twitter.com/championswimmer/status/1453422488906440705/photo/1&quot;&gt;pic.twitter.com/T4QaGiyTAh&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/media/FCuYBjYUYAQbdve.jpg&quot; alt=&quot;3_1453422457201647620&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/media/FCuYCEnVQAIdhNn.jpg&quot; alt=&quot;3_1453422466122989570&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/media/FCuYCpcVEAAigxa.jpg&quot; alt=&quot;3_1453422476008951808&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/media/FCuYDNnVEAME6yb.jpg&quot; alt=&quot;3_1453422485718765571&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://twitter.com/championswimmer/status/1453422488906440705&quot;&gt;Tweet link&lt;/a&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/profile_images/1440946683123208192/-Lr_1ChM_normal.jpg&quot; alt=&quot;championswimmer&quot; /&gt;
Arnav Gupta 😷 💉🟢 💉🟢 (&lt;a href=&quot;https://twitter.com/championswimmer&quot;&gt;@championswimmer&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Next day we went from Orchcha (Jhansi) to Nagpur.&lt;/p&gt;

&lt;p&gt;In terms of road quality, we faced the worst stretches on this leg. Places where the highway goes through a city and is pretty much a city road. Places under construction/repair.&lt;/p&gt;

&lt;p&gt;90% of it is still 100kmph level good. &lt;a href=&quot;https://twitter.com/championswimmer/status/1453423182195478528/photo/1&quot;&gt;pic.twitter.com/0QznI2K5iF&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/media/FCuYrmMVgAECiiJ.jpg&quot; alt=&quot;3_1453423179511201793&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://twitter.com/championswimmer/status/1453423182195478528&quot;&gt;Tweet link&lt;/a&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/profile_images/1440946683123208192/-Lr_1ChM_normal.jpg&quot; alt=&quot;championswimmer&quot; /&gt;
Arnav Gupta 😷 💉🟢 💉🟢 (&lt;a href=&quot;https://twitter.com/championswimmer&quot;&gt;@championswimmer&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Day 2 was 550 kms of driving. And thus again 10hrs on the road.&lt;/p&gt;

&lt;p&gt;We stopped just a little before Nagpur inside the &lt;a href=&quot;https://twitter.com/PenchMP&quot;&gt;@PenchMP&lt;/a&gt; Tiger Reserve 🐯 to check out the resorts.&lt;/p&gt;

&lt;p&gt;Sadly post COVID, all are at very low/nil occupancy. But worth staying if you have 2 spare days in the trip. &lt;a href=&quot;https://twitter.com/championswimmer/status/1453424234277998592/photo/1&quot;&gt;pic.twitter.com/VxfRPe1LbW&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/media/FCuZo2tVQAEEa0U.jpg&quot; alt=&quot;3_1453424231916584961&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://twitter.com/championswimmer/status/1453424234277998592&quot;&gt;Tweet link&lt;/a&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/profile_images/1440946683123208192/-Lr_1ChM_normal.jpg&quot; alt=&quot;championswimmer&quot; /&gt;
Arnav Gupta 😷 💉🟢 💉🟢 (&lt;a href=&quot;https://twitter.com/championswimmer&quot;&gt;@championswimmer&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;There’s a lot of stretch of the National Highway that cuts through the tiger reserve. Despite tall barricades along the roads, monkeys on the road are a common feature.&lt;/p&gt;

&lt;p&gt;We had to get out of Pench post sundown and it was spine-chillingly eerie to drive through the unlit jungle. &lt;a href=&quot;https://twitter.com/championswimmer/status/1453425190600249344/photo/1&quot;&gt;pic.twitter.com/ABd5ufNLyG&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/media/FCuafU9VUAYiPGm.jpg&quot; alt=&quot;3_1453425167749697542&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/media/FCuaf21UcAQLoc4.jpg&quot; alt=&quot;3_1453425176842891268&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/media/FCuagY3VcAIyW-t.jpg&quot; alt=&quot;3_1453425185978150914&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://twitter.com/championswimmer/status/1453425190600249344&quot;&gt;Tweet link&lt;/a&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/profile_images/1440946683123208192/-Lr_1ChM_normal.jpg&quot; alt=&quot;championswimmer&quot; /&gt;
Arnav Gupta 😷 💉🟢 💉🟢 (&lt;a href=&quot;https://twitter.com/championswimmer&quot;&gt;@championswimmer&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Next day we drove down to &lt;a href=&quot;https://twitter.com/hashtag/Hyderabad&quot;&gt;#Hyderabad&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This was quite a beauty of a drive. The amount of greenery, hills, valleys, small river crossings we saw around will be unparalleled. Great roads too, the whole stretch. &lt;a href=&quot;https://twitter.com/championswimmer/status/1453521160767881227/photo/1&quot;&gt;pic.twitter.com/mJBq3ACbvn&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/media/FCvxybnVEAU7b-E.jpg&quot; alt=&quot;3_1453521153465585669&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://twitter.com/championswimmer/status/1453521160767881227&quot;&gt;Tweet link&lt;/a&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/profile_images/1440946683123208192/-Lr_1ChM_normal.jpg&quot; alt=&quot;championswimmer&quot; /&gt;
Arnav Gupta 😷 💉🟢 💉🟢 (&lt;a href=&quot;https://twitter.com/championswimmer&quot;&gt;@championswimmer&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Not gonna lie, Hyderabad stop was all about &lt;a href=&quot;https://twitter.com/IKEA&quot;&gt;@IKEA&lt;/a&gt; pilgrimage.&lt;/p&gt;

&lt;p&gt;First time visit to IKEA, and totalllly worth it! Bought a bunch of things, and noted down a bunch more to order.&lt;/p&gt;

&lt;p&gt;Protip: Good place to take out someone too 😅, won’t run out of conversation starters. &lt;a href=&quot;https://twitter.com/championswimmer/status/1453522567730380806/photo/1&quot;&gt;pic.twitter.com/YVQwbPsTxr&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/media/FCvzA2NVQAQoH_m.jpg&quot; alt=&quot;3_1453522500634099716&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/media/FCvzB7-VgAIvAov.jpg&quot; alt=&quot;3_1453522519361683458&quot; /&gt;&lt;/p&gt;

&lt;p&gt;![3&lt;em&gt;1453522535434231809](https://pbs.twimg.com/media/FCvzC32VIAEv6z&lt;/em&gt;.jpg)&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/media/FCvzDyuVQAIxgP9.jpg&quot; alt=&quot;3_1453522551238377474&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://twitter.com/championswimmer/status/1453522567730380806&quot;&gt;Tweet link&lt;/a&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/profile_images/1440946683123208192/-Lr_1ChM_normal.jpg&quot; alt=&quot;championswimmer&quot; /&gt;
Arnav Gupta 😷 💉🟢 💉🟢 (&lt;a href=&quot;https://twitter.com/championswimmer&quot;&gt;@championswimmer&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Day 3 was 500km, and we didn’t stop at all (had to hurry to reach before IKEA closes) so covered it all in 8 hrs.&lt;/p&gt;

&lt;p&gt;The last 50km stretch, the bypass around Hyderabad and the road to HiTech city were just 👨‍🍳🤌&lt;/p&gt;

&lt;p&gt;Easily 150kph capable roads, 4 lanes throughout,  well maintained! &lt;a href=&quot;https://twitter.com/championswimmer/status/1453523992619327489/photo/1&quot;&gt;pic.twitter.com/FRoxTIBlH6&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/media/FCv0XHGVkAECgwI.jpg&quot; alt=&quot;3_1453523982636912641&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://twitter.com/championswimmer/status/1453523992619327489&quot;&gt;Tweet link&lt;/a&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/profile_images/1440946683123208192/-Lr_1ChM_normal.jpg&quot; alt=&quot;championswimmer&quot; /&gt;
Arnav Gupta 😷 💉🟢 💉🟢 (&lt;a href=&quot;https://twitter.com/championswimmer&quot;&gt;@championswimmer&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;At every stop I tried to stay at a good hotel, primarily because I wanted the car, laden to the brim with my stuff, to be parked properly.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://twitter.com/Westin&quot;&gt;@Westin&lt;/a&gt; at Hyderabad has one of the best breakfast buffet spreads, I figured, as a result. Definitely recommended just for the breakfast. &lt;a href=&quot;https://twitter.com/championswimmer/status/1453577024581169161/photo/1&quot;&gt;pic.twitter.com/FejoZzqVZR&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/media/FCwkgS1VIAM-_N7.jpg&quot; alt=&quot;3_1453576916963762179&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/media/FCwkjEfVkBMJUx6.jpg&quot; alt=&quot;3_1453576964653027347&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/media/FCwkkIuVUAALCNW.jpg&quot; alt=&quot;3_1453576982969536512&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/media/FCwklTkVIAQC8lg.jpg&quot; alt=&quot;3_1453577003060240388&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://twitter.com/championswimmer/status/1453577024581169161&quot;&gt;Tweet link&lt;/a&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/profile_images/1440946683123208192/-Lr_1ChM_normal.jpg&quot; alt=&quot;championswimmer&quot; /&gt;
Arnav Gupta 😷 💉🟢 💉🟢 (&lt;a href=&quot;https://twitter.com/championswimmer&quot;&gt;@championswimmer&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Final leg - home run. Compared to the last 2 legs, where there would often be 30-40 min stretches of driving through literally middle of nowhere (no dhabas, no small towns, no civilisation), this whole leg is through quite populated areas. Not a single deserted stretch. &lt;a href=&quot;https://twitter.com/championswimmer/status/1453578154006564867/photo/1&quot;&gt;pic.twitter.com/hVO6mXmAFa&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/media/FCwlnMqVcAUBHJq.jpg&quot; alt=&quot;3_1453578135077744645&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://twitter.com/championswimmer/status/1453578154006564867&quot;&gt;Tweet link&lt;/a&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/profile_images/1440946683123208192/-Lr_1ChM_normal.jpg&quot; alt=&quot;championswimmer&quot; /&gt;
Arnav Gupta 😷 💉🟢 💉🟢 (&lt;a href=&quot;https://twitter.com/championswimmer&quot;&gt;@championswimmer&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Day 4: Another 525 km.&lt;/p&gt;

&lt;p&gt;Stopped at IKEA again in the morning 😅
Also stopped at &lt;a href=&quot;https://twitter.com/Lenskart_com&quot;&gt;@Lenskart_com&lt;/a&gt; as driving with the sun in the eye was starting to get to me. Buying shades helped a lot, albeit only on the last day.&lt;/p&gt;

&lt;p&gt;Reached &lt;a href=&quot;https://twitter.com/peakbengaluru&quot;&gt;@peakbengaluru&lt;/a&gt; quite late into the night. &lt;a href=&quot;https://twitter.com/championswimmer/status/1453579026216280065/photo/1&quot;&gt;pic.twitter.com/84jquNrgbM&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/media/FCwmaQKVgAcdQod.jpg&quot; alt=&quot;3_1453579012190601223&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://twitter.com/championswimmer/status/1453579026216280065&quot;&gt;Tweet link&lt;/a&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;img src=&quot;https://pbs.twimg.com/profile_images/1440946683123208192/-Lr_1ChM_normal.jpg&quot; alt=&quot;championswimmer&quot; /&gt;
Arnav Gupta 😷 💉🟢 💉🟢 (&lt;a href=&quot;https://twitter.com/championswimmer&quot;&gt;@championswimmer&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Thankfully journey ended at Indiranagar and didn’t need to go upto &lt;a href=&quot;https://twitter.com/SonyWorldJn&quot;&gt;@SonyWorldJn&lt;/a&gt;, or else would have had taken another 4 days to cross the stretch of deleted road at Koramangala😅😅&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://twitter.com/championswimmer/status/1453580150663041028&quot;&gt;Tweet link&lt;/a&gt;&lt;/p&gt;

  
  &lt;p&gt;&lt;a href=&quot;http://blog.championswimmer.in/2022/01/delhi-to-bangalore-road-trip/&quot;&gt;Delhi to Bangalore Road Trip&lt;/a&gt; was originally published by Arnav Gupta at &lt;a href=&quot;http://blog.championswimmer.in&quot;&gt;//TODO&lt;/a&gt; on January 22, 2022.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[Nativescript-Vue: Native Mobile Apps in Javascript without the Hard Parts™]]></title>
  <link rel="alternate" type="text/html" href="http://blog.championswimmer.in/2018/08/nativescript-vue-introduction/"/>
  <id>http://blog.championswimmer.in/2018/08/nativescript-vue-introduction</id>
  <published>2018-08-23T00:00:00+05:30</published>
  <updated>2018-08-23T00:00:00+05:30</updated>
  <author>
    <name>Arnav Gupta</name>
    <uri>http://blog.championswimmer.in</uri>
    <email>championswimmer@gmail.com</email>
  </author>
  <category scheme="http://blog.championswimmer.in/tags/#typescript,vuejs,nativescript" term="typescript,vuejs,nativescript" />
  <content type="html">
  
    &lt;p&gt;&lt;img src=&quot;https://speakerd.s3.amazonaws.com/presentations/631d316c9e6d4b6ab16448dd57b266db/slide_0.jpg&quot; alt=&quot;&quot; /&gt;A promising alternative to React Native&lt;/p&gt;
&lt;h2 id=&quot;why-vue--why-nativescript--why-nativescript-vue&quot;&gt;Why Vue ? Why Nativescript ? Why Nativescript-Vue?&lt;/h2&gt;

&lt;p&gt;I am a fan of Vue. It is the easiest “framework” to grasp for people who just have bare minimum knowledge of vanilla HTML, CSS and Javascript. And then gives them so much power to build components, complex state management and the blazing fast speed of virtual DOM diffing.&lt;/p&gt;

&lt;p&gt;While the world lapped up React like it is the new jQuery (and I get it’s many advantages, I really do), I could never get myself to commit to it. Sure making some fast updates on the page, use React over jQuery - yeah ok. But buy into the ecosystem? That’s where I take my leave - because nothing is opinionated in React - you have 10 different blog posts by 10 different React veterans telling 10 completely different &lt;em&gt;best practices&lt;/em&gt;. State management? Redux is what everyone uses. MobX is what everyone recommends. Even basic setup of project is done by &lt;em&gt;create-react-app&lt;/em&gt;, which strictly speaking is not made or maintained by the core team. And finally, there are advantages of JSX and CSS-in-JS, but there’s a reason markup languages have existed, and it is this - people just find it easy to read declarative markups instead of figuring out how higher-order-functions are recursed to form a view. Vue lets you write familiar HTML and before you fire your project up, it turns it into React-like render function. And that is what a great framework should do - abstract the hard work away from you, not make you write functional view composing functions.&lt;/p&gt;

&lt;p&gt;Anyway, my little React rant is here because I want to preface why we are talking about Nativescript today, and not React Native (the most popular way to write cross-platform Javascript mobile apps today). I have used React Native, and I must say it is a great effort. *I have spent 8 years of my life developing native Android apps using Java, more recently Kotlin, and even a bit of C++. *To get things like animated views and smoothly working lists, simply by throwing an array at a template is not easy in mobile. And writing it in Javascript and expecting the underlying framework to translate it to actual native widgets, while keeping the best performance practices in place is quite a big ask, and React Native delivers. But there are niggles and quirks.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;The first thing I hate is broken promises. And just after you cross the basic todolist type of apps, React breaks the promise of building the entire project in Javascript. Now I am no stranger to native codebases, but when I am promised pure Javascript, and then for every little task I have to write &lt;strong&gt;&lt;em&gt;bridges&lt;/em&gt;&lt;/strong&gt; and end up with a codebase having 5 languages (JS, Swift, ObjC, Java, Kotlin), or 6 if you count JSX 😅&lt;/li&gt;
  &lt;li&gt;The concept of running React Native code in a thread that is **not **the UI thread is actually bad for mobile development. The web is different. You need to keep everything async. But on mobile, if you do have 2 different threads - then you come around to the biggest problem of animating items on screen. The function that calculates the position of a view 60 times a second (in the JS interpreter) and the function that sets the position of the view actually on the screen (in Java/Swift realm) are on two separate threads. And there goes 60 fps flying out of the window. 
*Note: Some of the bridging problems are going to get sorted as there is an upcoming change in their architecture - *&lt;a href=&quot;http://facebook.github.io/react-native/blog/2018/06/14/state-of-react-native-2018&quot;&gt;http://facebook.github.io/react-native/blog/2018/06/14/state-of-react-native-2018&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;It isn’t really &lt;strong&gt;write once.&lt;/strong&gt; As has been described in AirBnB’s extremely detailed, well written and balanced series on medium - &lt;a href=&quot;https://medium.com/airbnb-engineering/sunsetting-react-native-1868ba28e30a&quot;&gt;https://medium.com/airbnb-engineering/sunsetting-react-native-1868ba28e30a&lt;/a&gt;
You do end up maintaing 3 apps. The actual view layer, and two entire projects consisting of iOS and Android bridges respectively. Even the UI layer is not 100% common code as many components exist only in iOS or only in Android.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;https://speakerd.s3.amazonaws.com/presentations/631d316c9e6d4b6ab16448dd57b266db/slide_2.jpg&quot; alt=&quot;&quot; /&gt;
The reason I am really excited about Nativescript-Vue is the same as the inherent weaknesses I see in React as a framework and React Native as a platform. What I like about Nativescript is unlike React Native - which was an effort to take a web framework into mobile, they created an extremely generic solution as to how Javascript can be executed on mobiles, how native Java or Objective-C classes can be instantiated from exactly equivalent Javascript code, and how native widgets can be constructed from Javascript. Since this solution is generic, accessing native parts from your Javascript does not require special bridges - &lt;a href=&quot;https://docs.nativescript.org/core-concepts/android-runtime/advanced-topics/execution-flow&quot;&gt;because a generic bridge already exists and available at runtime&lt;/a&gt; - it is synchronous. Your code runs &lt;strong&gt;on&lt;/strong&gt; the UI thread just like native mobile apps traditionally do (with the ability to break out into threads for things like File operations or Network operations). &lt;a href=&quot;https://github.com/NativeScript/sample-iOS-Profiling/tree/performance-tests&quot;&gt;Performance benchmarks &lt;/a&gt;(synthetic ones, and a bit old, but current numbers are similar) show this difference - NativeScript has overhead of starting up, but once started, the marshalling of data from Javascript to native and back takes much less time compared to other solutions. 
&lt;img src=&quot;https://speakerd.s3.amazonaws.com/presentations/631d316c9e6d4b6ab16448dd57b266db/slide_5.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h2 id=&quot;how-nativescript-works&quot;&gt;How Nativescript works&lt;/h2&gt;

&lt;h3 id=&quot;the-layouts&quot;&gt;The Layouts&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://speakerd.s3.amazonaws.com/presentations/631d316c9e6d4b6ab16448dd57b266db/slide_6.jpg&quot; alt=&quot;&quot; /&gt;
Nativescript has in-built layout systems that map pretty much to similar layouts that exist in the Android and iOS world.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://speakerd.s3.amazonaws.com/presentations/631d316c9e6d4b6ab16448dd57b266db/slide_7.jpg&quot; alt=&quot;&quot; /&gt;&lt;img src=&quot;https://speakerd.s3.amazonaws.com/presentations/631d316c9e6d4b6ab16448dd57b266db/slide_8.jpg&quot; alt=&quot;&quot; /&gt;The GridLayout is a very powerful layout style, not easy to achievevia XMLs in Android or NIBs in iOS easily too‌‌&lt;img src=&quot;https://speakerd.s3.amazonaws.com/presentations/631d316c9e6d4b6ab16448dd57b266db/slide_9.jpg&quot; alt=&quot;&quot; /&gt;StackLayouts lay out items linearly in horizontal or vertical manner&lt;img src=&quot;https://speakerd.s3.amazonaws.com/presentations/631d316c9e6d4b6ab16448dd57b266db/slide_10.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3 id=&quot;working-with-the-native-ecosystem&quot;&gt;Working with the Native Ecosystem&lt;/h3&gt;

&lt;p&gt;You can extend your project via other native libraries (i.e. Gradle/Maven dependencies for Android and Cocoapods for iOS), and you can also add NPM modules to your project.
&lt;img src=&quot;https://speakerd.s3.amazonaws.com/presentations/631d316c9e6d4b6ab16448dd57b266db/slide_11.jpg&quot; alt=&quot;&quot; /&gt;
You need to be careful about NPM modules. Those that have C++ bindings are not straightforward to get to work. Also those that depend on NodeJS features that are not present in Nativescript will not work either. My experience with Nativescript has been that most things we require while building a mobile app will usually work out of the box.&lt;/p&gt;

&lt;p&gt;Nativescript uses &lt;strong&gt;JavaScriptCore&lt;/strong&gt; (as it is practically the only option) for iOS and it uses V8 for Android. This has some performance gains over React Native using JavaScriptCore on Android, because V8 is better optimised for Android due to the billions Google invests into Chrome for Android. 
&lt;img src=&quot;https://speakerd.s3.amazonaws.com/presentations/631d316c9e6d4b6ab16448dd57b266db/slide_12.jpg&quot; alt=&quot;&quot; /&gt;
The &lt;strong&gt;&lt;em&gt;most beautiful part **&lt;/em&gt;Nativescript is that you can access Android SDK’s Java classes and iOS SDK’s Obj-C classes directly from Javascript. In case of Java - whose syntax is similar to Javascript - **it literally is copying Java code, pasting it into Javascript file and voila!! it works.&lt;/strong&gt;
&lt;img src=&quot;https://speakerd.s3.amazonaws.com/presentations/631d316c9e6d4b6ab16448dd57b266db/slide_13.jpg&quot; alt=&quot;&quot; /&gt;&lt;img src=&quot;https://speakerd.s3.amazonaws.com/presentations/631d316c9e6d4b6ab16448dd57b266db/slide_14.jpg&quot; alt=&quot;&quot; /&gt;
There is a fantastic blog post by T J VanToll that describes how this mind-bending trick works under the hood - &lt;a href=&quot;https://developer.telerik.com/featured/nativescript-works/&quot;&gt;https://developer.telerik.com/featured/nativescript-works/&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;the-app-architecture-and-using-frameworks&quot;&gt;The App architecture and using Frameworks&lt;/h3&gt;

&lt;p&gt;Nativescript is two things.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Executing Javascript on mobile&lt;/li&gt;
  &lt;li&gt;A set of prebuilt views (or widgets) that are basically translated into native iOS/Android widgets at runtime. So a “Button” is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;com.android.widgets.Button&lt;/code&gt; on Android and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;UIButton&lt;/code&gt; on iOS.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Apart from that, Nativescript does not depend on being written in any particular way, or using any particulay framework. The creators heavily recommend Typescript, but that’s because you get 100% type definition support, and errors are found out at compile stage, that could have creeped into runtime.&lt;/p&gt;

&lt;p&gt;Basically there are many ways you can use NativeScript -&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Without Framework&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Only JS files&lt;/strong&gt; - construct views with functions and constructors&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;JS for logic + XML for template&lt;/strong&gt;  - XML is transpiled into render functions when bundling, or interpreted at runtime&lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;TS for Logic + XML for templates&lt;/strong&gt; - brings type-safety in. Also recommended in most guides&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;With Framework&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Angular with Typescript&lt;/strong&gt; - most common way, starter kit does this&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Vue&lt;/strong&gt; - Nativescript-Vue, still beta, but everything mostly works&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The fun part here is, when using Vue, you can use JS, TS, Coffeescript for logic. You can use HTML, Pug, EJS for templates. CSS/SASS/Less/Stylus for styling&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://speakerd.s3.amazonaws.com/presentations/631d316c9e6d4b6ab16448dd57b266db/slide_16.jpg&quot; alt=&quot;&quot; /&gt;&lt;img src=&quot;https://speakerd.s3.amazonaws.com/presentations/631d316c9e6d4b6ab16448dd57b266db/slide_17.jpg&quot; alt=&quot;&quot; /&gt;&lt;img src=&quot;https://speakerd.s3.amazonaws.com/presentations/631d316c9e6d4b6ab16448dd57b266db/slide_18.jpg&quot; alt=&quot;&quot; /&gt;&lt;img src=&quot;https://speakerd.s3.amazonaws.com/presentations/631d316c9e6d4b6ab16448dd57b266db/slide_19.jpg&quot; alt=&quot;&quot; /&gt;
Right now there are two common ways to work with Nativescript-Vue, using the &lt;strong&gt;vue-cli-template **or via **nativescript-vue-template. **When version 2.0 comes out, **vue-cli-template&lt;/strong&gt; will be the common one using benefits from both sides (single build step = fast reloads, also .vue single file components). As of version 1.3 you have to chose between fast builds or single file components. 
&lt;img src=&quot;https://speakerd.s3.amazonaws.com/presentations/631d316c9e6d4b6ab16448dd57b266db/slide_20.jpg&quot; alt=&quot;&quot; /&gt;&lt;img src=&quot;https://speakerd.s3.amazonaws.com/presentations/631d316c9e6d4b6ab16448dd57b266db/slide_21.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3 id=&quot;things-to-take-care-of---&quot;&gt;Things to take care of . . .&lt;/h3&gt;

&lt;p&gt;When building mobile apps with web frameworks, one most important thing is to keep in mind it is not the web DOM we are targeting. Things specific to the DOM like event capturing and bubbling aren’t similar here.&lt;/p&gt;

&lt;p&gt;Also do **not ** use http and fs APIs from DOM or NodeJS. You need to use Nativescript’s own implementation of File and Network APIs. 
&lt;img src=&quot;https://speakerd.s3.amazonaws.com/presentations/631d316c9e6d4b6ab16448dd57b266db/slide_24.jpg&quot; alt=&quot;&quot; /&gt;
And finally, yes, before you start off using NativeScript, you need to prepare your development machine for compiling and debugging native apps. Setting up the Android SDK is pretty easy these days. And the iOS side of things work only on a Mac. On MacOS setting up XCode and iOS SDK is also 2-3 click affair.&lt;/p&gt;

&lt;p&gt;Run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;tns doctor&lt;/code&gt; via the Nativescript CLI to make sure all is up and running before you start creating your first app. 
&lt;img src=&quot;https://speakerd.s3.amazonaws.com/presentations/631d316c9e6d4b6ab16448dd57b266db/slide_25.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;
&lt;h3 id=&quot;---and-you-are-&quot;&gt;. . . and you are ?&lt;/h3&gt;

&lt;p&gt;I love building mobile and web apps. Vue currently is the framework I am in love most (apart from Ember). You can follow @championswimmer on &lt;a href=&quot;https://twitter.com/championswimmer&quot;&gt;Twitter&lt;/a&gt; or &lt;a href=&quot;https://github.com/championswimmer&quot;&gt;Github&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also I am the co-founder of &lt;a href=&quot;https://cb.lk&quot;&gt;Coding Blocks&lt;/a&gt; a software development bootcamp with offline classes in India and online courses for anyone over the globe ! Please check out out online courses at -&lt;a href=&quot;https://online.codingblocks.com&quot;&gt; https://online.codingblocks.com&lt;/a&gt; !
&lt;img src=&quot;https://speakerd.s3.amazonaws.com/presentations/631d316c9e6d4b6ab16448dd57b266db/slide_1.jpg&quot; alt=&quot;&quot; /&gt;A bit about myself&lt;/p&gt;

  
  &lt;p&gt;&lt;a href=&quot;http://blog.championswimmer.in/2018/08/nativescript-vue-introduction/&quot;&gt;Nativescript-Vue: Native Mobile Apps in Javascript without the Hard Parts™&lt;/a&gt; was originally published by Arnav Gupta at &lt;a href=&quot;http://blog.championswimmer.in&quot;&gt;//TODO&lt;/a&gt; on August 23, 2018.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[Very Strict Sequelize: Into the land of Typescript Overkill]]></title>
  <link rel="alternate" type="text/html" href="http://blog.championswimmer.in/2018/04/very-strict-sequelize-into-the-land-of-typescript-overkill/"/>
  <id>http://blog.championswimmer.in/2018/04/very-strict-sequelize-into-the-land-of-typescript-overkill</id>
  <published>2018-04-06T00:00:00+05:30</published>
  <updated>2018-04-06T00:00:00+05:30</updated>
  <author>
    <name>Arnav Gupta</name>
    <uri>http://blog.championswimmer.in</uri>
    <email>championswimmer@gmail.com</email>
  </author>
  <category scheme="http://blog.championswimmer.in/tags/#nodejs,sequelize,typescript,javascript" term="nodejs,sequelize,typescript,javascript" />
  <content type="html">
  
    &lt;blockquote&gt;
  &lt;p&gt;&lt;em&gt;Disclaimer: If you believe that Typescript is a conspiracy by Microsoft to turn Javascript into C# and you believe in the religion of monkey-patching objects, then please do not proceed further. This article will burn your soul if you read it&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2 id=&quot;typescript-enforce-correct-code&quot;&gt;Typescript: Enforce ‘correct’ code&lt;/h2&gt;
&lt;p&gt;Ever since I have started using Typescript, I cannot imagine writing large projects in plain JS anymore. 
My relationship to Typescript is best explained by this very nicely &lt;a href=&quot;https://medium.com/@tomdale/glimmer-js-whats-the-deal-with-typescript-f666d1a3aad0&quot;&gt;articulated piece by Tom Dale&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While Typescript can make working with frontend frameworks like Angular and Vue a whole new revelation, using it on backend projects can have equally pleasing results. 
What I like about Typescript is the strictness can be turned a few notches up or down based on your requirements. And as you keep turning the strictness up by notches, you start seeing Typescripting starting to block off all those cracks and crevices in your code that were sitting there, waiting for you to slip into them at runtime, and cause hard-to-debug errors.&lt;/p&gt;

&lt;p&gt;Since Typescript brings in the concept of &lt;strong&gt;compilation&lt;/strong&gt; before &lt;strong&gt;running&lt;/strong&gt; the code, the obvious error-prone code blocks will be straightaway flagged by Typescript, and you’ll have to fix them before you can even get to the &lt;strong&gt;running&lt;/strong&gt; stage&lt;/p&gt;

&lt;h2 id=&quot;sequelize-a-good-target&quot;&gt;Sequelize: A good target&lt;/h2&gt;
&lt;p&gt;Here is an example of a run of the mill Sequelize code -&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Sequelize&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;sequelize&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Sequelize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;pass&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
	&lt;span class=&quot;na&quot;&gt;dialect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;postgres&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;User&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;define&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;users&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
	&lt;span class=&quot;c1&quot;&gt;// line A&lt;/span&gt;
	&lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Sequelize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;STRING&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
	&lt;span class=&quot;na&quot;&gt;age&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Sequelize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;INTEGER&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
	&lt;span class=&quot;na&quot;&gt;city&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Sequelize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;STRING&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
	&lt;span class=&quot;na&quot;&gt;isAdmin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Sequelize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;BOOLEAN&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;defaultValue&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;sync&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;then&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
	&lt;span class=&quot;nx&quot;&gt;User&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;create&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;
		&lt;span class=&quot;c1&quot;&gt;// line B&lt;/span&gt;
		&lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;Arnav&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;age&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;23&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;city&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;Delhi&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;isAdmin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;}).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;then&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;user&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
		&lt;span class=&quot;c1&quot;&gt;// line C&lt;/span&gt;
		&lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;age&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// 23&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Usual points of failure of this code are at:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Line A: What if I miss any keys while defining, or jumble up the properties like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;type&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;defaultValue&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Line B: What if I miss any keys, or mis-type the key name&lt;/li&gt;
  &lt;li&gt;Line C: What if I do not use correct key names when fetching data from &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;user&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Most IDEs like &lt;em&gt;Webstorm&lt;/em&gt; or &lt;em&gt;VS Code&lt;/em&gt; will only give rough suggestions, and not very indicative autocompletes either.&lt;/p&gt;

&lt;p&gt;When dealing with 15-20 models in your project (usual mid-size node/express projects get there pretty fast), you’d want a little more strictness around your models’ keys and better autocomplete would always be welcome.&lt;/p&gt;

&lt;h2 id=&quot;typescript--sequelize-were-pretty-much-in-javac-land-here&quot;&gt;Typescript + Sequelize: We’re pretty much in Java/C# land here&lt;/h2&gt;
&lt;p&gt;To start using Typescript, you’ll need &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;typescript&lt;/code&gt; module, and to make better use of types from &lt;strong&gt;sequelize&lt;/strong&gt; you should also get the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;@types/sequelize&lt;/code&gt; module&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;npm &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-D&lt;/span&gt; typescript @types/sequelize
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You can check out what the entire project structure looks like &lt;a href=&quot;https://github.com/championswimmer/dukaan-backend/tree/fcdc211e51f6c864063d1dca513fbb7c579a6a34&quot;&gt;here&lt;/a&gt;, but here is the lowdown -&lt;/p&gt;

&lt;p&gt;Here is what my &lt;em&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/db/models/Client.ts&lt;/code&gt;&lt;/strong&gt;&lt;/em&gt; file looks like -&lt;/p&gt;
&lt;div class=&quot;language-typescript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;DefineAttributes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Instance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Model&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;sequelize&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Sequelize&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;sequelize&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// This is signature of my 'Client' objects&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// Whenever I create 'Client' rows, the objects will be of this type&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;kr&quot;&gt;interface&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ClientAttributes&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kr&quot;&gt;number&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;secret&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kr&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;whitelist_domains&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kr&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[],&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;whitelist_ips&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kr&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[],&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;redirect_url&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kr&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[]&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// To define Client in db, the columns must be one of the &lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// keys of 'ClientAttributes', hence (( in keyof ClientAttributes )) &lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ClientDefineAttributes&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;kr&quot;&gt;keyof&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ClientAttributes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]:&lt;/span&gt; &lt;span class=&quot;kr&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;DataTypeAbstract&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;DefineAttributeColumnOptions&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// When writing this, I cannot stray away from **having to**&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// use keys as in 'ClientAttributes'&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;// In Webstorm/VSCode I get autocomplete too&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;clientAttrs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ClientDefineAttributes&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Sequelize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;INTEGER&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;primaryKey&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;autoIncrement&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;secret&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Sequelize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;STRING&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;32&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;whitelist_domains&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Sequelize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ARRAY&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Sequelize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;STRING&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;whitelist_ips&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Sequelize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ARRAY&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Sequelize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;STRING&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;redirect_url&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Sequelize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;STRING&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;kr&quot;&gt;interface&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ClientInstance&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Instance&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ClientAttributes&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;():&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ClientAttributes&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;kr&quot;&gt;interface&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Client&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Model&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ClientInstance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ClientAttributes&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And then once many such models are defined, my &lt;em&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/db/index.ts&lt;/code&gt;&lt;/strong&gt;&lt;/em&gt; will look like this -&lt;/p&gt;

&lt;div class=&quot;language-typescript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Sequelize&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;sequelize&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;DataTypes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;sequelize&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;config&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;../../config&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ClientAttributes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;clientAttrs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ClientInstance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;./models/Client&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ProductCategoryAttributes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;productCategoryAttrs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ProductCategoryInstance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;./models/ProductCategory&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;TaxAttributes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;taxAttrs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;TaxInstance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;./models/Tax&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Sequelize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;config&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;DB&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;NAME&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;config&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;DB&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;USER&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;config&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;DB&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;PASSWORD&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;dialect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;postgres&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Clients&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;define&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ClientInstance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ClientAttributes&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;clients&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;clientAttrs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ProductCategories&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;define&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ProductCategoryInstance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ProductCategoryAttributes&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;product_categories&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;productCategoryAttrs&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Tax&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;define&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;TaxInstance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;TaxAttributes&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;tax&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;taxAttrs&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;leverage-live-templates-do-not-write-boilerplate&quot;&gt;Leverage Live Templates: Do not write boilerplate&lt;/h2&gt;
&lt;p&gt;As long as you’re using a good IDE (or even Vim with the appropriate plugins), you do not need to write those cumbersome boilerplates all over again. 
We can create &lt;em&gt;Apache Velocity&lt;/em&gt; templates for the define statement and the model file.&lt;/p&gt;

&lt;p&gt;Here is what my Model file template looks like - 
NOTE: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;${NAME}&lt;/code&gt; is file name&lt;/p&gt;
&lt;div class=&quot;language-typescript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;err&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;$fileName&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$NAME&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;substring&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;toLowerCase&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$NAME&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;substring&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;DataTypeAbstract&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;DefineAttributeColumnOptions&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;DefineAttributes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Instance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Model&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;sequelize&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Sequelize&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;sequelize&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;kr&quot;&gt;interface&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;NAME&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Attributes&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kr&quot;&gt;number&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;type&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;NAME&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;DefineAttributes&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;kr&quot;&gt;keyof&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;NAME&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Attributes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]:&lt;/span&gt; &lt;span class=&quot;kr&quot;&gt;string&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;DataTypeAbstract&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;DefineAttributeColumnOptions&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;fileName&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;Attrs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;NAME&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;DefineAttributes&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Sequelize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;INTEGER&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;primaryKey&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;autoIncrement&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;kr&quot;&gt;interface&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;NAME&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Instance&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Instance&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;NAME&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Attributes&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;():&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;NAME&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Attributes&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;kr&quot;&gt;interface&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;NAME&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Model&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;NAME&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Instance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;NAME&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Attributes&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So as soon as I generate a file of name &lt;strong&gt;MyModel.ts&lt;/strong&gt; all the scaffolding is already done for me.&lt;/p&gt;

&lt;p&gt;Similarly I have created a live template to generate the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;db.define&lt;/code&gt; statements -&lt;/p&gt;

&lt;div class=&quot;language-typescript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$NAME$&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;define&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;$NAME$Instance&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$NAME$Attributes&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;$SNAKENAME$&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;$SMALLNAME$Attrs&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;autocomplete-bliss---no-typo-mayhem-in-run-time&quot;&gt;Autocomplete Bliss  + No Typo Mayhem in run time&lt;/h2&gt;

&lt;p&gt;Whenever I want to create objects, I can see the keys and their types in autocomplete
&lt;img src=&quot;https://imgur.com/JopsxMx.jpg&quot; alt=&quot;Create Autocomplete&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Unless the object I save is exactly right, I get a compile error 
&lt;img src=&quot;https://imgur.com/uVdwNL5.jpg&quot; alt=&quot;Error&quot; /&gt;&lt;/p&gt;

&lt;p&gt;And I get similar fluent autocomplete in the query result item as well
&lt;img src=&quot;https://imgur.com/Rg0NPvg.jpg&quot; alt=&quot;Result&quot; /&gt;&lt;/p&gt;

&lt;p&gt;And finally I get the same luxury on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;where&lt;/code&gt; queries too 
&lt;img src=&quot;https://imgur.com/q9gwSr4.jpg&quot; alt=&quot;Where&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;typescript-invest-in-boilerpate-for-long-term-safety&quot;&gt;Typescript: Invest in boilerpate for long term safety&lt;/h2&gt;
&lt;p&gt;A little bit of investment into boilerplate; whether you type manually everytime - which IMHO is a bit cumbersome or you take advantage of your IDE/Editor and create templates; is required when using Typescript, but the advantages we get in terms of code completion and more importantly, compile-time error checking, even before we go into run-time mode, is well worth the time invested.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Could not have written without &lt;a href=&quot;https://stackedit.io/&quot;&gt;StackEdit&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Obligatory shameless self-plug :&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;
I am one of the co-founders of &lt;a href=&quot;https://codingblocks.com&quot;&gt;Coding Blocks&lt;/a&gt; - A Software Programming bootcamp, based out of New Delhi, India. Among other things, we teach Full Stack Web Development using NodeJS, via both classroom programmes, as well as online classes. You can follow our Medium to find more articles on Android and Web development.&lt;/p&gt;


  
  &lt;p&gt;&lt;a href=&quot;http://blog.championswimmer.in/2018/04/very-strict-sequelize-into-the-land-of-typescript-overkill/&quot;&gt;Very Strict Sequelize: Into the land of Typescript Overkill&lt;/a&gt; was originally published by Arnav Gupta at &lt;a href=&quot;http://blog.championswimmer.in&quot;&gt;//TODO&lt;/a&gt; on April 06, 2018.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[Creating an Ember.js Addon]]></title>
  <link rel="alternate" type="text/html" href="http://blog.championswimmer.in/2018/04/creating-an-ember-js-addon/"/>
  <id>http://blog.championswimmer.in/2018/04/creating-an-ember-js-addon</id>
  <published>2018-04-06T00:00:00+05:30</published>
  <updated>2018-04-06T00:00:00+05:30</updated>
  <author>
    <name>Arnav Gupta</name>
    <uri>http://blog.championswimmer.in</uri>
    <email>championswimmer@gmail.com</email>
  </author>
  <category scheme="http://blog.championswimmer.in/tags/#emberjs," term="emberjs," /><category scheme="http://blog.championswimmer.in/tags/#javascript," term="javascript," /><category scheme="http://blog.championswimmer.in/tags/#typescript" term="typescript" />
  <content type="html">
  
    &lt;h2 id=&quot;getting-started&quot;&gt;Getting Started&lt;/h2&gt;
&lt;p&gt;Use ember-cli to create basic structure (like you start with creating an app)&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ember addon &amp;lt;addon-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This will generate the following directory structure&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;.
├── addon						# your addon code goes here
├── app							# things you want to inject into consumer apps' namespace 
├── config					
│   ├── ember-try.js			# testing config
│   └── environment.js
├── ember-cli-build.js			# how the dummy test app is built
├── index.js					# how your app is built (read more - https://ember-cli.com/api/classes/Addon.html ) 
├── package-lock.json
├── package.json
├── testem.js
├── tests
│   ├── dummy					# dummy app (for testing) 
│   │   ├── app
│   │   ├── config
│   │   └── public
│   ├── helpers
│   ├── index.html
│   ├── integration				# e2e tests for your addon
│   ├── test-helper.js			# test setup config for your addon
│   └── unit					# unit tests for your addon
└── vendor
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;adding-an-util&quot;&gt;Adding an util&lt;/h2&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ember generate util &amp;lt;util-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;using-typescript&quot;&gt;Using Typescript&lt;/h2&gt;

&lt;h3 id=&quot;extend-instead-of-create&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;extend&lt;/code&gt; instead of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.create()&lt;/code&gt;&lt;/h3&gt;

&lt;p&gt;In JS we write&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;default&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Mixin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;create&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We can instead use -&lt;/p&gt;
&lt;div class=&quot;language-typescript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;default&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;PromiseResolver&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Mixin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;PromiseResolver&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;Written with &lt;a href=&quot;https://stackedit.io/&quot;&gt;StackEdit&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

  
  &lt;p&gt;&lt;a href=&quot;http://blog.championswimmer.in/2018/04/creating-an-ember-js-addon/&quot;&gt;Creating an Ember.js Addon&lt;/a&gt; was originally published by Arnav Gupta at &lt;a href=&quot;http://blog.championswimmer.in&quot;&gt;//TODO&lt;/a&gt; on April 06, 2018.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[Tech Conferences : A fun place to be]]></title>
  <link rel="alternate" type="text/html" href="http://blog.championswimmer.in/2017/06/tech-conferences-a-fun-place-to-be/"/>
  <id>http://blog.championswimmer.in/2017/06/tech-conferences--a-fun-place-to-be</id>
  <published>2017-06-29T00:00:00+05:30</published>
  <updated>2017-06-29 16:38:46 +0530T00:00:00-00:00</updated>
  
  <author>
    <name>Arnav Gupta</name>
    <uri>http://blog.championswimmer.in</uri>
    <email>championswimmer@gmail.com</email>
  </author>
  <category scheme="http://blog.championswimmer.in/tags/#tech%20conference" term="tech conference" /><category scheme="http://blog.championswimmer.in/tags/#conference" term="conference" /><category scheme="http://blog.championswimmer.in/tags/#experience" term="experience" /><category scheme="http://blog.championswimmer.in/tags/#sarcasm" term="sarcasm" /><category scheme="http://blog.championswimmer.in/tags/#comedy" term="comedy" />
  <content type="html">
  
    &lt;p&gt;So I have had the good fortune to &lt;a href=&quot;https://www.youtube.com/playlist?list=PLgc7EY7uwmbUyKQwLWYDIiVSPvj_nQm6A&quot;&gt;present at quite a few tech
conferences&lt;/a&gt;.
A large number of them have been at &lt;a href=&quot;https://medium.com/@hasgeek&quot;&gt;HasGeek&lt;/a&gt;
events. Quick shoutout to &lt;a href=&quot;https://medium.com/@jackerhack&quot;&gt;Kiran Jonnalagadda,&lt;/a&gt;
&lt;a href=&quot;https://medium.com/@zainabbawa&quot;&gt;Zainab Bawa,&lt;/a&gt; &lt;a href=&quot;https://medium.com/@karthikb351&quot;&gt;Karthik
Balakrishnan,&lt;/a&gt; &lt;a href=&quot;https://medium.com/@sandygrains&quot;&gt;Sandhya
Ramesh,&lt;/a&gt; &lt;a href=&quot;https://medium.com/@haricm&quot;&gt;Hari
(ഹരി)&lt;/a&gt; and everyone else on the HasGeek team for the
awesome tech conferences they host. It was also an honour to be on the Editoral
board a couple of editions of Droidcon too.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Putting those thanks aside right in the beginning, because here is where I
start making fun of conferences. :P The HasGeek events are some of the most
sorted conferences in India, but I have been to some other ones too, which are
not that . . . well put together.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/posts/tech-conferences/fig1.jpg&quot; alt=&quot;&quot; /&gt;
&lt;span class=&quot;figcaption_hack&quot;&gt;From right to left: Someone taking notes, someone hurriedly fixing bugs in the
release they pushed out yesterday or getting ready for their talk up next,
someone probably requisitioning nudes on WhatsApp and Kiran having an
existential crisis. (credits: nicked it from here
&lt;a href=&quot;https://factordaily.com/profile-kiran-jonnalagadda-zainab-bawa-hasgeek/&quot;&gt;https://factordaily.com/profile-kiran-jonnalagadda-zainab-bawa-hasgeek/&lt;/a&gt;)&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;So a lot of funny things happen at conferences. When you haven’t gone to one
yet, or have attended maybe just one before, you have this assumption that this
is a place full of serious people, who mean business, accumulated here to gain
valuable insights from eminent and knowledgeable speakers.&lt;/p&gt;

&lt;p&gt;But what tech conferences are, could be wildly different. There’s strictly two
specific motivations for attending them. For speakers — you get to travel to a
new city for free (if the organisers have managed to get quite a few sponsors on
board, you get lodged into a decent hotel too). And for the attendees — you get
free lunch, and your company pays for you to attend it. So for one whole day,
you don’t need to dredge through your scrum in your gloomy desk, and instead
meet new people, have good food and munch on free donuts.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/posts/tech-conferences/fig2.jpg&quot; alt=&quot;&quot; /&gt;
&lt;span class=&quot;figcaption_hack&quot;&gt;And you also get to take selfies in front of cool wall art like this&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why do companies send their employees to these conferences you wonder?&lt;/strong&gt; Well
isn’t it obvious ? To learn new about the latest and greatest in the software
world (read: participate in the hype cycle). &lt;br /&gt; &lt;strong&gt;But that doesn’t always work
out&lt;/strong&gt;. Because you see, other than geeky developers, who else goes to tech
conferences ? Greasy startup founders and technical recruiters. Who are always
lurking to poach employees. So that bright developer you sent to pick up new
skills at #AwesomeConf ? Too bad, &lt;strong&gt;Pochr.io&lt;/strong&gt; just nicked him.&lt;/p&gt;

&lt;h4 id=&quot;the-talks&quot;&gt;The Talks&lt;/h4&gt;

&lt;p&gt;&lt;img src=&quot;/images/posts/tech-conferences/fig3.jpg&quot; alt=&quot;&quot; /&gt;
&lt;span class=&quot;figcaption_hack&quot;&gt;The Gartner Hype Cycle. I am perennially on the trough of disillusionment, while
the rest of the world seems to be constantly on the peak of inflated
expectations&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Most conferences will divide their talks into 3 categories, based on their
difficulty and/or depth —&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Beginner&lt;/strong&gt; — These are on topics which are in the first slope of the hype
cycle. Imagine Kotlin in 2016 or TensorFlow in 2015 or React in 2014. And these
talks are nothing but the exact content you’ll find on the ‘Getting Started’
page of the respective technology. It’s slightly worse than the Getting Started
page, because that page gets updated in the future. This talk will get recorded
and uploaded on Youtube as a permanent record of poor topic selection, if the
said technology’s hype cycle bursts.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Intermediate — **These are the opinionated as f&lt;/strong&gt;* talks. This is the category
into which every mediocre conference speaker proposes a “Best Practices for
Creating a &lt;strong&gt;_ project” talk. This is the category into which every judgemental
developer proposes a “What not to do when working with __&lt;/strong&gt;” talk. This is
usually going to be about a technology that the whole world is already using,
but the ecosystem is not mature, so everyone is figuring shit out on their own,
and there are no ‘best practices’ yet, so everyone thinks their variable names,
function names, folder structures and file names are the best. Like everyone
Javascript conference will have a talk on Vue, and every speaker will have
his/her opinion on whether Axios is better or Vue-resource is. Every Android
conference is talking about the pros and cons of RxJava.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Advanced&lt;/strong&gt; — This is where the fun is. Advanced talks will usually be about a
technology that is in use since the advent of computers. &lt;em&gt;But&lt;/em&gt; it will be about
a particular niche which only 8 developers from Valley and 2 from Bangalore are
working on. This category is called ‘advanced’ not because the technologies used
are complex, but because it deals with something like — ‘&lt;em&gt;When we were scaling
up, our NodeJS codebase was so large the number of require() calls hit the Unix
process limit of number of open files&lt;/em&gt;’ — i.e. the kind of problems engineers at
Facebook or Google scale worry about, or people with a funded research on ‘how
to screw your computer’ ponder over.&lt;/li&gt;
&lt;/ol&gt;

&lt;hr /&gt;

&lt;h4 id=&quot;the-speakers&quot;&gt;The Speakers&lt;/h4&gt;

&lt;p&gt;While those were the types of talks. There are also a handful of types of
speakers you get at these conferences. Any speaker can be put into one of these
categories.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;First there will be the &lt;strong&gt;geeks with untested demos&lt;/strong&gt;. These guys do not have
slides. They want to give you a tech demo. Of a product that uses the latest,
most unstable version of every tool possible, that runs on a prototype kit that
they got from their last I/O or WWDC trip. These guys are found fidgeting with
their demo 2 minutes before their talk is scheduled in the speakers’ lounge. The
demo, will invariably &lt;em&gt;not work&lt;/em&gt;. Then they will tell you, in the most
unconvincing tone you’ve ever heard, what it would have been like, &lt;strong&gt;had the
demo worked&lt;/strong&gt;.&lt;/li&gt;
  &lt;li&gt;Then there will be the &lt;strong&gt;product guys&lt;/strong&gt;, the &lt;strong&gt;marketing heroes&lt;/strong&gt; hidden under
the developers’ capes, the &lt;strong&gt;sellers&lt;/strong&gt;, the smart talkers. They will convince
the editorial panel in all ways possible it is not a pitch of their product or a
blatant marketing of their &lt;strong&gt;‘all new platform that will make developing a
breeze’&lt;/strong&gt;. (I’ve been on the editorial board. When an interview starts with “&lt;em&gt;I
don’t want to promote it in anyway but. . .&lt;/em&gt;”, I know exactly where it’s
headed). These are the guys who tend to use use phrases like ‘and this is where
all the magic happens’. You know when to call bullshit now if you hear this
right ?&lt;/li&gt;
  &lt;li&gt;Some of us are the &lt;strong&gt;regular guys&lt;/strong&gt;. The &lt;strong&gt;usual suspects&lt;/strong&gt;. The &lt;strong&gt;weathered
speakers&lt;/strong&gt;. We have spoken at multiple conferences, and we know the feedback and
reviews of the conference will depend more on the quality of lunch, than our
slides. We know you’re here for a company-paid day off with free food and some .
. *ahem . . *networking. We know you’re not really sitting here to understand
how important it is to set objects volatile and functions synchronized for
error-free multi-threading. We know the true reason you are here — &lt;strong&gt;you are
here for the memes, the jokes, and the gotchas.&lt;/strong&gt; And we follow the footsteps of
lord &lt;a href=&quot;https://www.destroyallsoftware.com/&quot;&gt;Gary Bernhardt&lt;/a&gt; and the supreme
leader &lt;a href=&quot;https://mickens.seas.harvard.edu/wisdom-james-mickens&quot;&gt;James Mickens&lt;/a&gt;.
(The liberal use of **we, **if had not clearly pointed out, then yes, this is
the category I belong to).&lt;/li&gt;
&lt;/ul&gt;

&lt;iframe width=&quot;300&quot; height=&quot;200&quot; src=&quot;https://www.youtube.com/embed/TVaud_9bJCA?list=PLgc7EY7uwmbUyKQwLWYDIiVSPvj_nQm6A&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;
&lt;p&gt;&lt;span class=&quot;figcaption_hack&quot;&gt;Here you go, meme-ified, on your face facts, about how your Digital money isn’t
all that safe&lt;/span&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Finally there will be the &lt;strong&gt;visionaries&lt;/strong&gt;. The &lt;strong&gt;legends&lt;/strong&gt;. The &lt;strong&gt;torch bearers
of technology&lt;/strong&gt;. The keynote speakers. These will be guys like &lt;a href=&quot;https://www.youtube.com/watch?v=ztspvPYybIY&quot;&gt;Ryan Dahl,
showcasing his summer project&lt;/a&gt; —
that eventually turned into NodeJS. Or &lt;a href=&quot;https://www.youtube.com/watch?v=8aGhZQkoFbQ&quot;&gt;Phillip Roberts casually telling you
about the Event Loop&lt;/a&gt;. Or it could
be the creator of Wordpress, Socket.IO and Mongoose — Guillermo Rauch (trivia:
caught up with him smoking a desi joint an hour before this talk) &lt;a href=&quot;https://www.youtube.com/watch?v=mfpLCdSBEJA&quot;&gt;describing
the future of chat.&lt;/a&gt; These guys are
the reason the handful of serious attendees who have come, are here for. These
guys don’t talk code, or 10% performance bumps. These guys talk ideas. But never
mind, because you won’t get it now. And when you’ll get it, it’d have been too
late to jump onto the hype train.&lt;/li&gt;
  &lt;li&gt;There is also this one last type of speaker, for whom there is a** special place
in hell&lt;strong&gt;. The guys who propose “&lt;/strong&gt;Building for the billions&lt;strong&gt;” talks. And there
is going to be at least half a dozen such proposals. “*User Experience for the
next billion”, “Design for the next billion internet users” *and what not.
Here’s the thing — there are only a handful of apps on the play store with more
than a billion downloads: **Gmail&lt;/strong&gt;, &lt;strong&gt;Google **Search (because they’re bundled
in every Android phone), **Whatsapp **(because it’s the new SMS), **Messenger
**(because Mark effin Zuckerberg forced everyone to download it), **Twitter
**and **Facebook **(because 1 billion adults are shitposting cat pics on the
internet everyday). If you’re not Facebook, Twitter or Google, you need to get
your ducks in order and figure out how to **GET AT LEAST 1 BILLION USERS&lt;/strong&gt;
before you can *design better for the next billion. *You know who needs to build
for the next billion ? &lt;a href=&quot;https://play.google.com/store/apps/details?id=com.ShakeMe.shake&amp;amp;hl=en&quot;&gt;This
guy&lt;/a&gt;.
Your app that solves NP-hard problem ? No one cares.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;the-networking&quot;&gt;The Networking&lt;/h4&gt;

&lt;p&gt;.. or huddling around that one Google employee there, wagging your tails hoping
to . . . idk what ? Get a job ?&lt;/p&gt;

&lt;p&gt;So networking at tech conference is downright favour currying. You are either
recruiting talent for your next ‘1 billion user’ idea (if you’re a CTO). Or
you’re trying to appear deeply interested in the conversation one speaker is
having with another about a language you first heard 1 hour ago. Or you’re
trying to ask intriguing follow up questions to that big-company developer who
just spoke in the pre-lunch session, and are only managing to ask the most
obvious google-searchable questions.&lt;/p&gt;

&lt;p&gt;Then there’s going to be that one huddle of undergrad open source developers
(who are on sponsored tickets), gorging on all the available chicken and ice
cream, and discussing about the best gaming laptop and having a dick-measuring
contest about their Github commit-streak. THAT IS NETWORKING. At least they are
having fun doing it.&lt;/p&gt;

&lt;p&gt;There’ll be also be some horny fellows in a corner trying to make a pass on one
of thinly spread female attendees. &lt;serious note=&quot;&quot;&gt; Geez. Please don’t. Like
everything else in a shitty conference is still fine. But this isn’t. Wondering
why there aren’t enough women in tech, this could be one of the reasons
&amp;lt;/serious note&amp;gt;&lt;/serious&gt;&lt;/p&gt;

&lt;h4 id=&quot;the-sponsor-kiosks&quot;&gt;The Sponsor Kiosks&lt;/h4&gt;

&lt;p&gt;The most important part of the pilgrimage to a tech conference, is to visit the
shrine of every sponsor. Because the offerings from the the divine sponsors are
what keeps us going from one conference to another. Like literally, all 4 years
of college, I did not buy a single &lt;strong&gt;T-shirt&lt;/strong&gt;. Whenever I would run out of
shirts, I’d turn up at hackathons and tech conferences and grab a dozen new
ones.&lt;/p&gt;

&lt;p&gt;Some of the upright ones, like Digital Ocean and Facebook would be having an
open table of &lt;strong&gt;stickers&lt;/strong&gt;, &lt;strong&gt;pens&lt;/strong&gt;, &lt;strong&gt;notepads **and other
corporate-marketing-enwrapped **swags&lt;/strong&gt;. Then there’ll be snide data collectors
who’d be like, fill up this form and get a T-Shirt. Like seriously ? You think
I’d give up some of my real data for a free T-Shirt ? &lt;br /&gt; Then, there are some
who try to gamify the heck out of it. Udacity was making us answer a quiz to
give us a &lt;strong&gt;mug&lt;/strong&gt;. I just cheezeballed my way with the lady on the counter to
get mine. I am sure so did others. Quiz my ass.&lt;/p&gt;

&lt;p&gt;Here’s a golden rule about sponsor kiosks. Don’t go asking about open roles and
asking about technology. Like just think it over. These companies, who’d love to
make you work on Sundays too, have sent these folks for 3 whole days to stand at
kiosks and take selfies with attendees. Guess who these folks are ? Yep the
temps, interns and the most dispensable ones. They ain’t giving you any jobs.
The know nothing about the next SDK release. Get back to the lunch, or the next
talk about the next billion users please.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;The best part about a tech conference is that they give you this black
side-carry bag, which has this one recyclable pen made of paper pulp, which
breaks apart the moment you put some pressure on it to write. There would be a
notepad — they’re actually expecting you to take notes. And there’ll be a bunch
of marketing material. Now the sponsors are charged extra for their marketing
brochures to be put into this bag. The best use, personally, I had of these
brochures, was to fan myself when sitting outside the auditorium in of the
conferences I attended in hot and humid Chennai. And the cherry on the cake
would be that conference T-Shirt, which if you wore, would look like a Formula-1
driver, because of the number of sponsor logs printed on it’s back. It’ll never
be a size that fits you. And you cannot give away a T-Shirt with that many
sponsor logos to anyone but your younger brother.&lt;/p&gt;

&lt;hr /&gt;

&lt;blockquote&gt;
  &lt;p&gt;Tech conferences are really nice places to pick up new trends, and meet great
people. This is a piece of comedy, and mostly everything after the 2nd paragraph
is the worst of all conferences I have attended cherry-picked into a single
story. Do keep attending conferences. Especially the ones hosted by &lt;a href=&quot;http://hasgeek.com/&quot;&gt;HasGeek
&lt;/a&gt;in India are some of the best ones. HasGeek has
conferences on &lt;a href=&quot;https://jsfoo.in/2017/&quot;&gt;Javascript&lt;/a&gt;, React and Mobile lined up
from 12th to16th September. If you’re coming to any one of them, hit me up on
&lt;a href=&quot;http://twitter.com/championswimmer&quot;&gt;twitter,&lt;/a&gt; and we can ‘network’ and go
‘sponsor kiosk’ pilgrimage together ;)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;P.S. Thanks to &lt;a href=&quot;https://medium.com/@sahildua2305&quot;&gt;Sahil Dua&lt;/a&gt; for pointing out a
couple of corrections in this.&lt;/p&gt;

  
  &lt;p&gt;&lt;a href=&quot;http://blog.championswimmer.in/2017/06/tech-conferences-a-fun-place-to-be/&quot;&gt;Tech Conferences : A fun place to be&lt;/a&gt; was originally published by Arnav Gupta at &lt;a href=&quot;http://blog.championswimmer.in&quot;&gt;//TODO&lt;/a&gt; on June 29, 2017.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[Indian Parents : Before and after graduating]]></title>
  <link rel="alternate" type="text/html" href="http://blog.championswimmer.in/2017/06/indian-parents-before-and-after-graduating/"/>
  <id>http://blog.championswimmer.in/2017/06/indian-parents--before-and-after-graduating</id>
  <published>2017-06-29T00:00:00+05:30</published>
  <updated>2017-06-29 16:13:09 +0530T00:00:00-00:00</updated>
  
  <author>
    <name>Arnav Gupta</name>
    <uri>http://blog.championswimmer.in</uri>
    <email>championswimmer@gmail.com</email>
  </author>
  <category scheme="http://blog.championswimmer.in/tags/#indian%20parents" term="indian parents" /><category scheme="http://blog.championswimmer.in/tags/#parenting" term="parenting" /><category scheme="http://blog.championswimmer.in/tags/#indian" term="indian" /><category scheme="http://blog.championswimmer.in/tags/#whining" term="whining" /><category scheme="http://blog.championswimmer.in/tags/#comedy" term="comedy" />
  <content type="html">
  
    &lt;p&gt;&lt;img src=&quot;/images/posts/indian-parents/feature.jpg&quot; alt=&quot;&quot; /&gt;
&lt;span class=&quot;figcaption_hack&quot;&gt;Indian Parents have no chill&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;“Indian parents” is the ideal topic to joke on, for Indians. It’s dead straight.
You narrate any incident of any interaction, big or small, with your parents,
and it’s going to be funny.&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;figcaption_hack&quot;&gt;For a quick TL;DR, you can hear me narrate this blog post on my SoundCloud&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;It has been a year I am out of college. So I did engineering. Like every other
Indian guy. (Those sissies who didn’t couldn’t handle math and/or physics. Those
passion stories are bullshit).&lt;/p&gt;

&lt;p&gt;And I got ‘placed’ into a few software firms like Zomato and Facebook. Just like
any other Indian guy. (You see I didn’t even mention my majors. It wasn’t
Computer Science. But that’s besides the point).&lt;/p&gt;

&lt;p&gt;And I didn’t join either. Here’s where the &lt;em&gt;regular Indian Guy&lt;/em&gt; story goes off
the plot. I joined a startup called &lt;a href=&quot;http://cb.lk/&quot;&gt;Coding Blocks&lt;/a&gt; as one of the
founding members. We teach Indian college students (who, as you by now know are
all engineering undergrads, unless they can’t math) to develop software. Because
the engineering colleges don’t. So that they can get ‘placed’ into companies
like Zomato and Facebook. &lt;em&gt;I can hear you sigh at the irony, but wait, the
actual joke hasn’t even begun.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;So, now, my parents are in a very uneasy situation. For 22 years, they have been
building the muscle memory of asking &lt;strong&gt;“Why aren’t you studying?”&lt;/strong&gt;, every time
they had eye contact with me.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Reading a novel&lt;/em&gt; : Why aren’t you studying ?&lt;/p&gt;

&lt;p&gt;*Taking too long to eat *: Why aren’t you studying ?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Constipation&lt;/em&gt;: Why don’t you take a book inside ?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Looking at the stars and figuring out the answer to life universe and
everything&lt;/em&gt; : Son, it’s 42. Now please get back to your studies.&lt;/p&gt;

&lt;p&gt;And on those rare occasions when I was found performing unspeakable acts that do
not befit a hard working student — like playing FIFA, or watching a series —
basically almost any activity involving my laptop, I have this massive guilt
trip. You can’t look your parents in the eye for a week. You will be doing the
dishes, turning off the fan diligently, putting the water bottle in the fridge,
and other acts of an *adarsh baalak *(ideal son) and fervently wishing you get
back into the good books as soon as possible.&lt;/p&gt;

&lt;p&gt;That’s because for all these years, the only constant in my life was an upcoming
exam. Midterm, Sessional, Half-yearly, FA, SA, IITJEE, AIEEE, AISSCE, Olympiad —
they come in various names. (No, the only constant in life is not change. If you
are above 22, the only certain thing is death and taxes. If you’re below 22, the
only certain thing is exams and parent’s telling you to study).&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;**But now, there are no more exams to study for. School is over. College is
over. **This is such a deal breaker for your parents.&lt;/p&gt;

&lt;p&gt;Now I can play FIFA on my PS4, that I bought with my own fucking money (we’re
not getting into details like how it cost me a month’s salary), on the TV in the
living room, on full volume.&lt;/p&gt;

&lt;p&gt;Now I can stay on my bed for the entire long weekend. With 3 canisters of
overpriced Pringles (another month’s). And binge watch Last Week Tonight on
loop. Without the headphones.&lt;/p&gt;

&lt;p&gt;AND I CAN LOOK THEM IN THE EYE WHILE DOING ALL THIS.&lt;/p&gt;

&lt;p&gt;This is something they can’t stand now. You can see them squirm every passing
second your nose is not in between the pages a thick academic material. They are
not used to this new reality — the cannot imagine a world where their son
doesn’t have an upcoming exam to study for.&lt;/p&gt;

&lt;p&gt;They develop this midlife crisis. This existential gloom clouds over them. Their
only purpose in life when they are at home — of telling me to study, is now
snatched away from them. And a man without purpose is a man lost.&lt;/p&gt;

&lt;p&gt;So now they have other questions. Like what am I going to do in life. Yeah
**‘what am I going to do in life’. **I am part of a team running a profitable
company which grew 5x and opened 3 new offices in the last year. But . . . WHAT
AM I GOING TO DO IN LIFE.&lt;/p&gt;

&lt;p&gt;Aren’t you going to apply to Google or something ?&lt;/p&gt;

&lt;p&gt;Will you try to appear for UPSC ?&lt;/p&gt;

&lt;p&gt;Do you have plans for MBA ?&lt;/p&gt;

&lt;p&gt;What have you considered about MS ?&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Do you see a pattern there ? These are all indirect questions about &lt;em&gt;when is the
next time in life I have to appear for an exam ?&lt;/em&gt;. &lt;strong&gt;When will they, again in
life, get the chance to ask me ‘WHY ARE YOU NOT STUDYING?’.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And when I am able to successfully evade such questions with the perfectly
logical answer — “Coding Blocks is working out well, can you just let me
concentrate on that” — I get threatened by the eternal nightmare of Indians in
their 20’s — the ‘marriage’ question.&lt;/p&gt;

&lt;p&gt;Now, the fact of the matter is, they know my girlfriend (who is completing her
MBBS — yep doctor ❤ engineer == bells whistles, cliche Indian perfect couple),
and they know very well her and my plans for the coming few years. And thus the
marriage question is not a real question — but just a the sword hanging over my
head, to force me to answer the most important question — ‘When can you get the
opportunity to force you to study, and give you guilt trips for enjoying your
life again’.&lt;/p&gt;

&lt;p&gt;Here’s hoping I do not have to go for MS to Trump’s USA. Here’s hoping I do not
have to go for MBA and take a bank job. Here’s hoping I do not need to clear
UPSC and become a corrupt bureaucrat. And here’s hoping I do not have to brush
up my data structures and algorithms for a Google interview.&lt;/p&gt;

&lt;hr /&gt;

&lt;blockquote&gt;
  &lt;p&gt;Since there were some people on whom the sarcasm was lost : No, not being an
engineer is perfectly fine (if not by your parents and Indian society, but by
the world it is). Those who can’t math aren’t lesser human beings. Please do
follow your passion. Don’t be cliched Indian people who figure out what to do in
life after engineering. &lt;strong&gt;Ye bik gyi hai engineering. Kuch ni rakha hai isme. Ye
sab engineering colleges aur parents milke humko pagal bana rahe hai. :)&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;


  
  &lt;p&gt;&lt;a href=&quot;http://blog.championswimmer.in/2017/06/indian-parents-before-and-after-graduating/&quot;&gt;Indian Parents : Before and after graduating&lt;/a&gt; was originally published by Arnav Gupta at &lt;a href=&quot;http://blog.championswimmer.in&quot;&gt;//TODO&lt;/a&gt; on June 29, 2017.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[Don't jump onto the Firebase bandwagon yet]]></title>
  <link rel="alternate" type="text/html" href="http://blog.championswimmer.in/2016/10/don-t-jump-onto-the-firebase-bandwagon-yet/"/>
  <id>http://blog.championswimmer.in/2016/10/don-t-jump-onto-the-firebase-bandwagon-yet</id>
  <published>2016-10-24T00:00:00+05:30</published>
  <updated>T00:00:00-00:00</updated>
  
  <author>
    <name>Arnav Gupta</name>
    <uri>http://blog.championswimmer.in</uri>
    <email>championswimmer@gmail.com</email>
  </author>
  <category scheme="http://blog.championswimmer.in/tags/#Firebase" term="Firebase" /><category scheme="http://blog.championswimmer.in/tags/#realtime" term="realtime" /><category scheme="http://blog.championswimmer.in/tags/#database" term="database" /><category scheme="http://blog.championswimmer.in/tags/#programming" term="programming" />
  <content type="html">
  
    &lt;p&gt;&lt;strong&gt;Firebase&lt;/strong&gt; is the rage. It’s the talk of the town, and every frontend conference, be it &lt;em&gt;Web&lt;/em&gt; or &lt;em&gt;Mobile&lt;/em&gt; can’t stop talking about &lt;a href=&quot;http://firebase.google.com&quot;&gt;Firebase&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;But hold your horses a bit out there. Now I am not saying that do not use Firebase. I use Firebase extensively. At &lt;a href=&quot;http://codingblocks.com&quot;&gt;CodingBlocks&lt;/a&gt; I make it a point to teach using Firebase to the students of the &lt;em&gt;Android&lt;/em&gt; programme. But all said and done, Firebase has a &lt;strong&gt;specific&lt;/strong&gt; use case. And we cannot overlook that.&lt;/p&gt;

&lt;p&gt;Firebase came about to be used as a &lt;em&gt;&lt;strong&gt;realtime, object storage&lt;/strong&gt;&lt;/em&gt; system. Both the terms &lt;em&gt;realtime&lt;/em&gt; and &lt;em&gt;object&lt;/em&gt; storage are important. For one, being realtime is not something we always need. For a chat app yes, for a CRM, probably not needed at all. Secondly the data format of Firebase is very dubious.
It is an object store meaning, it resembles no-SQL databases like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MongoDB&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DocumentStore&lt;/code&gt; more than it does RDBMS like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MySQL&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Oracle&lt;/code&gt;. NoSQL is also something the cool kids have been harping on since 2010, but is again, useful for specific cases.&lt;/p&gt;

&lt;p&gt;Now where my criticism of Firebase stems from are two easily overlooked points -&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;The “object storage” uses a Database that is not transparent. We do not actually know if it used MongoDB on the backend or some other kind of database. And being proprietary, we do not actually know the availability/consistency tradeoffs, have any perf benchmarks etc of the underlying datastore that powers Firebase.&lt;/li&gt;
  &lt;li&gt;The issue with realtime is, it’s too good to be true. And it is. Since more than 7 or 8 cases out of 10, you do not &lt;strong&gt;actually&lt;/strong&gt; need something &lt;em&gt;really&lt;/em&gt; realtime (as in making a WebSocket connection and doing live 2-way updates), just getting realtime for the lulz is not a good idea. It will be resource intensive, expend more internet bandwidth on your client and devices, and &lt;em&gt;most important of all&lt;/em&gt; is a pricey business.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let us expand on these points.&lt;/p&gt;

&lt;h2 id=&quot;the-data-storage-problem&quot;&gt;The data storage problem&lt;/h2&gt;

&lt;p&gt;What the Firebase data model looks like is somewhat this (taking a blog) -&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;root
	- posts  
	    	- K1mn3b4m1n3
	        	- title: &quot;&quot;
	            - content: &quot;&quot;
	            - author
	    	- K2m3n4h2mn3
	        	- title: &quot;&quot;
	            - content: &quot;&quot;
	            - author
	    	- K3mn45b3mm3
	        	- title: &quot;&quot;
	            - content: &quot;&quot;
	            - author
	- comments  
	    	- K2m34nb2m
	        	- post : K1mn3b4m1n3
	            - title: &quot;&quot;
	            - content
	        - K62mn22m
	        	- post : K2m3n4h2mn3
	            - title: &quot;&quot;
	            - author: &quot;&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;There is a single node called &lt;strong&gt;root&lt;/strong&gt; which is the entire DB of your app. Inside that there are &lt;em&gt;&lt;strong&gt;refs&lt;/strong&gt;&lt;/em&gt; like &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;posts&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;comments&lt;/code&gt; which are mostly analogous to &lt;em&gt;Collection&lt;/em&gt; of MongoDB.
Firstly, I just feel uneasy at the sight of the DB that looks like a single huge JSON file. I am extremely skeptical of how well it would scale when you put thousands of entries into each ref, and then create multiple relations between them like - post has auther=userid and comment has post = postid and author = userid and so on.&lt;/p&gt;

&lt;p&gt;And as is the problem with &lt;a href=&quot;http://www.mongodb-is-web-scale.com/&quot;&gt;blindly starting to use noSQL&lt;/a&gt; (please do follow the link, you’ll not regret it), you might be using it completely wrong, and/or in a place where traditional Relational SQL solutions would have fit better.&lt;/p&gt;

&lt;h2 id=&quot;the-realtime-problem&quot;&gt;The realtime problem&lt;/h2&gt;

&lt;p&gt;The second issue is when you are grabbed by your neck and force-herded into a realtime ecosystem, when you did not need it. Now a major portion of Firebase users actually did &lt;strong&gt;not&lt;/strong&gt; need realtime databases. They just started using Firebase because Google made a big pomp and show of it at I/O 2016.&lt;/p&gt;

&lt;p&gt;Thing is, pricing is very awkward. Upto 100 DB connections (simultaneous), you are on the free tier, named as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Spark&lt;/code&gt;. (Trivia: I &lt;a href=&quot;https://twitter.com/championswimmer/status/594294732202774528&quot;&gt;suggested the name&lt;/a&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Spark&lt;/code&gt; to Firebase founder &lt;a href=&quot;https://twitter.com/JamesTamplin&quot;&gt;James Tamplin&lt;/a&gt;, and the cool guy he is, he named the plan, earlier known as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Hacker&lt;/code&gt; to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Spark&lt;/code&gt;).
Beyond this, you do not have a $5 or $10 tier. You need to jump straight to the $25 plan.&lt;/p&gt;

&lt;p&gt;Now take a step back and try to understand. 100 connections is &lt;strong&gt;entirely&lt;/strong&gt; different from non-realtime datastores that provide usually &lt;em&gt;20 req/sec&lt;/em&gt; or &lt;em&gt;30 req/sec&lt;/em&gt; (what AWS, Parse, Azure mBaas limits are) on their free tier.
Firebase considers a user to be a &lt;em&gt;&lt;strong&gt;connection&lt;/strong&gt;&lt;/em&gt; whenever he has his app open and connected to internet. (Side note: on mobile platforms like Android, you can do Firebase.goOnline() and Firebase.goOffline(), recently).&lt;/p&gt;

&lt;p&gt;And trust me, if you’re a chatting app, or a content reading app, getting to 100 simultaneous open connections is a &lt;strong&gt;very easy to achieve target&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The fact that Firebase is waaay too easy to plug in to your mobile apps (as much as single-line codes to make a ListView in Android connected to a Database Ref on Firebase, and having 2-way updates without any other code written), only makes me conclude that Firebase has got it’s priorities straight up -&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Hook in the devs using easy to use libraries&lt;/li&gt;
  &lt;li&gt;Force them to be realtime&lt;/li&gt;
  &lt;li&gt;Wait for them to get 100 online users&lt;/li&gt;
  &lt;li&gt;Make $$$&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;p&gt;And while all this makes good business sense for Google, it probably doesn’t for you. So before you jump into the Firebase bandwagon like crazy, do your bit of math.&lt;/p&gt;

  
  &lt;p&gt;&lt;a href=&quot;http://blog.championswimmer.in/2016/10/don-t-jump-onto-the-firebase-bandwagon-yet/&quot;&gt;Don't jump onto the Firebase bandwagon yet&lt;/a&gt; was originally published by Arnav Gupta at &lt;a href=&quot;http://blog.championswimmer.in&quot;&gt;//TODO&lt;/a&gt; on October 24, 2016.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[Handling File uploads in HTML5 and Express (with Multer)]]></title>
  <link rel="alternate" type="text/html" href="http://blog.championswimmer.in/2016/06/handling-file-uploads-in-html5-and-express-with-multer/"/>
  <id>http://blog.championswimmer.in/2016/06/handling-file-uploads-in-html5-and-express-with-multer</id>
  <published>2016-06-21T00:00:00+05:30</published>
  <updated>2016-06-21T00:00:00+05:30</updated>
  <author>
    <name>Arnav Gupta</name>
    <uri>http://blog.championswimmer.in</uri>
    <email>championswimmer@gmail.com</email>
  </author>
  <category scheme="http://blog.championswimmer.in/tags/#express," term="express," /><category scheme="http://blog.championswimmer.in/tags/#node," term="node," /><category scheme="http://blog.championswimmer.in/tags/#multer," term="multer," /><category scheme="http://blog.championswimmer.in/tags/#web" term="web" /><category scheme="http://blog.championswimmer.in/tags/#development," term="development," /><category scheme="http://blog.championswimmer.in/tags/#html5," term="html5," /><category scheme="http://blog.championswimmer.in/tags/#forms" term="forms" />
  <content type="html">
  
    &lt;p&gt;The &lt;a href=&quot;http://open-event-generator.herokuapp.com/&quot;&gt;Open Event Webapp Generator&lt;/a&gt; has a pure HTML front end form, and Express based backend.&lt;/p&gt;

&lt;p&gt;We needed an option where users can upload their own JSON files to create a schedule page for it.&lt;/p&gt;

&lt;p&gt;On the HTML form that’s easy. As you can see here we simple add input tags with type=”file”&lt;/p&gt;

&lt;div class=&quot;language-html highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;file&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;sponsorfile&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;id=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;sponsorfile&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In our express app, we need to use &lt;a href=&quot;https://www.npmjs.com/package/multer&quot;&gt;multer&lt;/a&gt; to be able to handle file uploads.&lt;/p&gt;

&lt;p&gt;We create a middleware called uploadedFiles, and pass the middleware to the get() block&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;express&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;express&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;multer&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;multer&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;app&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;express&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;upload&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;multer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;dest&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;uploads/&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;uploadedFiles&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;upload&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;fields&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;speakerfile&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;maxCount&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;sessionfile&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;maxCount&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;trackfile&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;maxCount&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;sponsorfile&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;maxCount&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;eventfile&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;maxCount&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;locationfile&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;maxCount&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;]);&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;/live&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;uploadedFiles&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;req&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
         &lt;span class=&quot;c1&quot;&gt;// req.files has the files&lt;/span&gt;
         &lt;span class=&quot;c1&quot;&gt;// req.body has the POST body params&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now we can access the files inside &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;req.files&lt;/code&gt; (that will have a path to the temporary location of the file, you’ll have to use some filesystem module to read the files), and the POST params in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;req.body&lt;/code&gt;&lt;/p&gt;

  
  &lt;p&gt;&lt;a href=&quot;http://blog.championswimmer.in/2016/06/handling-file-uploads-in-html5-and-express-with-multer/&quot;&gt;Handling File uploads in HTML5 and Express (with Multer)&lt;/a&gt; was originally published by Arnav Gupta at &lt;a href=&quot;http://blog.championswimmer.in&quot;&gt;//TODO&lt;/a&gt; on June 21, 2016.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[Sending a streaming zip file in node.js]]></title>
  <link rel="alternate" type="text/html" href="http://blog.championswimmer.in/2016/06/sending-a-streaming-zip-file-in-node-js/"/>
  <id>http://blog.championswimmer.in/2016/06/sending-a-streaming-zip-file-in-node-js</id>
  <published>2016-06-19T00:00:00+05:30</published>
  <updated>2016-06-19T00:00:00+05:30</updated>
  <author>
    <name>Arnav Gupta</name>
    <uri>http://blog.championswimmer.in</uri>
    <email>championswimmer@gmail.com</email>
  </author>
  <category scheme="http://blog.championswimmer.in/tags/#gsoc," term="gsoc," /><category scheme="http://blog.championswimmer.in/tags/#web" term="web" /><category scheme="http://blog.championswimmer.in/tags/#development," term="development," /><category scheme="http://blog.championswimmer.in/tags/#nodejs" term="nodejs" />
  <content type="html">
  
    &lt;p&gt;The webapp generator that &lt;a href=&quot;https://opev.wordpress.com/2016/06/06/webapp-the-generator-for-making-schedule-pages/&quot;&gt;we set up&lt;/a&gt; is now up and running on a &lt;a href=&quot;http://open-event-generator.herokuapp.com/&quot;&gt;heroku instance&lt;/a&gt; and is working to generate zips of generated websites.&lt;/p&gt;

&lt;p&gt;One of the requirements was that when the front-end presses, the “Generate” button, a request is created to the backend node app to start creating the html pages, and pack them into a zip file. Then the said zip file will be made available to download.&lt;/p&gt;

&lt;p&gt;I intended for the zip file to become available to download immediately and the server to continuously pack data into the zip, as the user downloads it – a process known as &lt;strong&gt;streaming zip serving&lt;/strong&gt;. (If you might have noticed, Google Drive uses this too. You do not know the final zip size before the download has completed.)&lt;/p&gt;

&lt;p&gt;If the server takes time in creating the contents of the zip, this method can help, as it will allow the user to start downloading the file, before all the contents are finalised.&lt;/p&gt;

&lt;p&gt;To achieve the mentioned goal, the idea Node.js module to use &lt;strong&gt;&lt;em&gt;archiver&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If you look at the &lt;a href=&quot;https://github.com/fossasia/open-event-webapp/blob/master/src/generator/app.js&quot;&gt;app.js&lt;/a&gt; code you’ll find on the /generate POST endpoint, we take the ‘req’ params and pass to a pipeToRes() function, which is defined in &lt;a href=&quot;https://github.com/fossasia/open-event-webapp/blob/master/src/generator/backend/generator.js&quot;&gt;generator.js&lt;/a&gt;&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nx&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;post&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;/generate&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;uploadedFiles&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;req&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;req&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;files&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;req&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;setHeader&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;Content-Type&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;application/zip&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;generator&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;pipeZipToRes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;req&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;And in the generator, you can find this block of code that pipes the streaming archive to the response.&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;      &lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;zipfile&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;archiver&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;zip&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

      &lt;span class=&quot;nx&quot;&gt;zipfile&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;error&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;err&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;throw&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;err&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;

      &lt;span class=&quot;nx&quot;&gt;zipfile&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;pipe&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;res&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

      &lt;span class=&quot;nx&quot;&gt;zipfile&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;directory&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;distHelper&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;distPath&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;finalize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
      
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We zip the directory defined in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;distPath&lt;/code&gt; and the archiver API has a fluent call to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.finalize()&lt;/code&gt; that finished the download for the user, when the zip is completed.&lt;/p&gt;

  
  &lt;p&gt;&lt;a href=&quot;http://blog.championswimmer.in/2016/06/sending-a-streaming-zip-file-in-node-js/&quot;&gt;Sending a streaming zip file in node.js&lt;/a&gt; was originally published by Arnav Gupta at &lt;a href=&quot;http://blog.championswimmer.in&quot;&gt;//TODO&lt;/a&gt; on June 19, 2016.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[Replication to Github Enterprise with Gerrit]]></title>
  <link rel="alternate" type="text/html" href="http://blog.championswimmer.in/2016/02/replication-to-github-enterprise-with-gerrit/"/>
  <id>http://blog.championswimmer.in/2016/02/replication-to-github-enterprise-with-gerrit</id>
  <published>2016-02-17T00:00:00+05:30</published>
  <updated>2016-02-17 00:06:32 +0530T00:00:00-00:00</updated>
  
  <author>
    <name>Arnav Gupta</name>
    <uri>http://blog.championswimmer.in</uri>
    <email>championswimmer@gmail.com</email>
  </author>
  <category scheme="http://blog.championswimmer.in/tags/#git" term="git" /><category scheme="http://blog.championswimmer.in/tags/#gerrit" term="gerrit" /><category scheme="http://blog.championswimmer.in/tags/#github" term="github" /><category scheme="http://blog.championswimmer.in/tags/#enterprise" term="enterprise" /><category scheme="http://blog.championswimmer.in/tags/#ecdsa" term="ecdsa" />
  <content type="html">
  
    &lt;p&gt;Even if you are a gerrit/git sysadmin having done a dozen code review setups already, you might get stumped with the ‘reject HostKey’ error when trying to replicate from Gerrit to a Github Enterprise instance.&lt;/p&gt;

&lt;p&gt;So this error stems from the following reasons -&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Gerrit used Eclipse’s JGit library to implement Git&lt;/li&gt;
  &lt;li&gt;Github Enterprise enforces ECDSA SSH v2 for SSH connections&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Basically this is an issue about JGit not able to parse hashed known_host file lines
for ECDSA Protocol 2. But we can neigher change the JCh (as we are using compiled)
gerrit, nor can we (or want to) disable ECDSA 2 enforcement in Github Enterprise&lt;/p&gt;

&lt;p&gt;So I’ll keep it short and jump to straight to how to solve this.&lt;/p&gt;

&lt;p&gt;First we need to set an alias of our Github Enterprise server in ssh config.
Edit &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.ssh/config&lt;/code&gt; and add this&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Host mygit git.yourserver.com
HostName mygit.yourserver.com
Protocol 2
HostKeyAlgorithms ssh-rsa,ssh-dss
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Replace git.yourserver.com with your actual server address. &lt;strong&gt;mygit&lt;/strong&gt; is also upto you.
Name it whatever you like&lt;/p&gt;

&lt;p&gt;In your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;$GERRIT_HOME/etc/replication.config&lt;/code&gt; in the url fields change references to
&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git@git.yourserver.com&lt;/code&gt; to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git@mgit&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Here is an example from my setup&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;[remote &quot;internal&quot;]
    url = git@mygit:${name}.git
    projects = yu-aosp-internal/*
    push = +refs/*:refs/*
    timeout = 50
    threads = 4
    replicationDelay = 0
    defaultForceUpdate = true
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Purge your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.ssh/known_host&lt;/code&gt; file. You can just delete the &lt;em&gt;ecdsa&lt;/em&gt; lines.&lt;/p&gt;

&lt;p&gt;Run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ssh -T git@mygit&lt;/code&gt; (run it as the same user that runs gerrit - usually it might be
user &lt;strong&gt;gerrit2&lt;/strong&gt; ) to add the ssh remote again.&lt;/p&gt;

&lt;p&gt;Now restart gerrit.&lt;/p&gt;

&lt;p&gt;Your replications should be working now.&lt;/p&gt;

  
  &lt;p&gt;&lt;a href=&quot;http://blog.championswimmer.in/2016/02/replication-to-github-enterprise-with-gerrit/&quot;&gt;Replication to Github Enterprise with Gerrit&lt;/a&gt; was originally published by Arnav Gupta at &lt;a href=&quot;http://blog.championswimmer.in&quot;&gt;//TODO&lt;/a&gt; on February 17, 2016.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[Multibooting Chrome OS on your Laptop]]></title>
  <link rel="alternate" type="text/html" href="http://blog.championswimmer.in/2016/01/multibooting-chrome-os-on-your-laptop/"/>
  <id>http://blog.championswimmer.in/2016/01/multibooting-chrome-os-on-your-laptop</id>
  <published>2016-01-09T00:00:00+05:30</published>
  <updated>2016-01-09 01:23:02 +0530T00:00:00-00:00</updated>
  
  <author>
    <name>Arnav Gupta</name>
    <uri>http://blog.championswimmer.in</uri>
    <email>championswimmer@gmail.com</email>
  </author>
  <category scheme="http://blog.championswimmer.in/tags/#linux" term="linux" /><category scheme="http://blog.championswimmer.in/tags/#windows" term="windows" /><category scheme="http://blog.championswimmer.in/tags/#multiboot" term="multiboot" /><category scheme="http://blog.championswimmer.in/tags/#dual%20boot" term="dual boot" /><category scheme="http://blog.championswimmer.in/tags/#chrome" term="chrome" /><category scheme="http://blog.championswimmer.in/tags/#chromium" term="chromium" /><category scheme="http://blog.championswimmer.in/tags/#chrome%20os" term="chrome os" />
  <content type="html">
  
    &lt;p&gt;Other than the conventionally popular Windows and Mac OS, (and, among developers and geeks, Linux), one of the most popular operating systems for Netbooks and lightweight convertibles today is - Chrome OS. But if you have landed on this page, I am sure you already know that.&lt;/p&gt;

&lt;p&gt;Now the problem is, Chrome OS was designed to be used only with certain type of hardware - low powered netbooks, so Google took a certain route, in which Chrome OS officially is available only on &lt;strong&gt;Chromebooks&lt;/strong&gt; - certain types of netbooks that come preloaded with Chrome OS - and have to be certified by Google. Kind of like Mac OSX which you cannot use unless you use an iMac or a Macbook.&lt;/p&gt;

&lt;p&gt;But ofcourse, you can use Chrome OS just as well on your own Laptop, if you so wish to, because, Chrome OS is actually based on - Chromium OS - the underlying opensource project.&lt;/p&gt;

&lt;p&gt;There happens to be a kind guy &lt;a href=&quot;http://twitter.com/arnoldthebat&quot;&gt;arnoldthebat&lt;/a&gt;, who makes regular releases of builds of Chromium OS that are pretty much compatible with almost all x86 (i386, or 32 bit) and amd64 (64 bit Intel or AMD) CPU based laptops. Most of your generic hardware like touchpads, speakers should work, and if you’re not too unlucky(read have a Broadcomm card), most probably your WiFi  will work too. You can catch hold of his builds here - http://chromium.arnoldthebat.co.uk/
I’d recommend using the latest &lt;strong&gt;&lt;em&gt;special&lt;/em&gt;&lt;/strong&gt; build as those ones have the widest hardware support.&lt;/p&gt;

&lt;p&gt;After you download the .img file, you can create a bootable USB on Linux using this command (given your USB drive is on /dev/sdb) -&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;dd &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/path/to/downloaded/img &lt;span class=&quot;nv&quot;&gt;of&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/dev/sdb
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;You should boot from your USB drive (you’ll need to enable legacy support if yours is a post-UEFI era BIOS), and play with the OS to make sure everything works, and if you like it, and want to permanently install it to your laptop, read on.&lt;/p&gt;

&lt;p&gt;So, if you want Chromium OS to be the only operating system in your laptop, you can just press &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Ctrl&lt;/code&gt; + &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Alt&lt;/code&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;F2&lt;/code&gt;, login with user:&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;chronos&lt;/code&gt; password:&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;password&lt;/code&gt; and run the command &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo install&lt;/code&gt;
&lt;em&gt;This &lt;strong&gt;will&lt;/strong&gt; format your hard drive&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;But instead if you want to install Chromium OS as an additional OS to your laptop then there is way for that too. Here are some necessary conditions though -&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;You’ll need to make 2 partitions, one 2GB and another at least 4GB in size. Your HDD should have that space, or you should create that by shrinking any existing partitions.&lt;/li&gt;
  &lt;li&gt;You need to be using GRUB as your bootloader. If you are running Linux with Windows/Mac I am assuming you already are running GRUB. If not, then you can still install GRUB - a step that you &lt;a href=&quot;http://google.com/search?q=install+grub+bootloader&quot;&gt;can figure out yourself&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;First take a look at the bootable USB you made out of the Chromium OS disk. It will have two important partitions called - &lt;strong&gt;ROOT_A&lt;/strong&gt; and &lt;strong&gt;STATE&lt;/strong&gt;.
We need to create corresponding partitions on your hard disk (these can be larger size than the ones on the USB, a larger &lt;strong&gt;STATE&lt;/strong&gt; partition gives you more local storage space. A larger &lt;strong&gt;ROOT-A&lt;/strong&gt; partition is mostly of no use, as this partition’s content won’t change in the future).&lt;/p&gt;

&lt;p&gt;Let’s consider we made the following partitions -&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;/dev/sda7  - ext2 - 2.15GB&lt;/li&gt;
  &lt;li&gt;/dev/sda8 - ext4 - 6GB&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now you should copy the corresponding partitions from your USB drive to your own hard disk using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dd&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;#For copying ROOT-A&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;dd &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/dev/sdb3 &lt;span class=&quot;nv&quot;&gt;of&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/dev/sda7
&lt;span class=&quot;c&quot;&gt;#For copying STATE&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;dd &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/dev/sdb1 &lt;span class=&quot;nv&quot;&gt;of&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/dev/sda8
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Next step would be to add a corresponding boot entry for Chromium OS to your GRUB. For that edit &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/grub.d/40_custom&lt;/code&gt; and add the following&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;menuentry &quot;Chrome OS&quot; {
 insmod part_gpt
 insmod ext2
 set root=(hd0,gpt7)
 linux /boot/vmlinuz root=/dev/sda7 init=/sbin/init rootwait rw noresume console=tty2 i915.modeset=1 loglevel=1 quiet noinitrd tpm_tis.force=1
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This is considering your’s is a GPT partitioned HDD. If not, remove the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;insmod part_gpt&lt;/code&gt; line, and change the root to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;(hd0,X)&lt;/code&gt; where X = root partition number.
After this run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo update-grub2&lt;/code&gt; to generate the grub.cfg.&lt;/p&gt;

&lt;p&gt;Now there is tiny problem with Chromium OS - &lt;strong&gt;It expects the STATE partition to be on /dev/sda1&lt;/strong&gt; This is hardcoded into the OS. Usually since your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/dev/sda1&lt;/code&gt; would already be occupied by some OS (Windows or Linux), you cannot install the Chromium STATE partition there. For that we need to make Chromium expect STATE somewhere else.
Mount your ROOT-A partition, and edit the file &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/sbin/chromeos_startup&lt;/code&gt; on it.
Change the following line -&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;STATE_DEV=${ROOTDEV_TYPE}1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Change the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;1&lt;/code&gt; at the end to the whatever partition you have put STATE on. If it was on &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/dev/sda8&lt;/code&gt;, change the &lt;strong&gt;1&lt;/strong&gt; to &lt;strong&gt;8&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Also in the same file find and comment out this line&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mount -n -t ${FS_FORMAT_OEM} -o ${OEM_FLAGS} ${OEM_DEV} /usr/share/oem
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This is because we have not made an OEM partition, so we can’t mount it. We do not need the OEM partition to make Chromium OS work.&lt;/p&gt;

&lt;p&gt;Finally you should be ready to reboot into Chromium OS be selecting it from the GRUB boot menu.&lt;/p&gt;

  
  &lt;p&gt;&lt;a href=&quot;http://blog.championswimmer.in/2016/01/multibooting-chrome-os-on-your-laptop/&quot;&gt;Multibooting Chrome OS on your Laptop&lt;/a&gt; was originally published by Arnav Gupta at &lt;a href=&quot;http://blog.championswimmer.in&quot;&gt;//TODO&lt;/a&gt; on January 09, 2016.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[Doing a table join in Android without using rawQuery]]></title>
  <link rel="alternate" type="text/html" href="http://blog.championswimmer.in/2015/12/doing-a-table-join-in-android-without-using-rawquery/"/>
  <id>http://blog.championswimmer.in/2015/12/doing-a-table-join-in-android-without-using-rawquery</id>
  <published>2015-12-30T00:00:00+05:30</published>
  <updated>2015-12-30 03:01:36 +0530T00:00:00-00:00</updated>
  
  <author>
    <name>Arnav Gupta</name>
    <uri>http://blog.championswimmer.in</uri>
    <email>championswimmer@gmail.com</email>
  </author>
  
  <content type="html">
  
    &lt;p&gt;Android has some really nice SQLite helper classes and methods. And the ones I like the most are the &lt;em&gt;SQLiteDatabase.query&lt;/em&gt;, &lt;em&gt;SQLiteDatabase.update&lt;/em&gt;, &lt;em&gt;SQLiteDatabase.insert&lt;/em&gt; ones, because they take away quite a bit of pain for typing out SQL commands by hand.&lt;/p&gt;

&lt;p&gt;But unfortunately, if you have to use a JOIN, then usually you have to go and use the &lt;em&gt;SQLiteDatabase.rawQuery&lt;/em&gt; method and end up having to type your commands by hand.&lt;/p&gt;

&lt;p&gt;But but but, if the two tables you are joining do not have any common column names (actually it is good design to have them so - by having all column names prefixed by &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;tablename_&lt;/code&gt; maybe), then you can hack the usual &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SQLiteDatabase.query()&lt;/code&gt; method to get a JOINed query.&lt;/p&gt;

&lt;p&gt;See the two tables I have here -&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;A bit of context - this is an app about tracking car expenses and refuels.
Refuels/Services/etc are all various types of expenses.
So the ‘expense’ table has all expenses. The ‘refuel’ table has all refuels
and a reference to corresponding expense entries (one to one).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Expense table&lt;br /&gt;
&lt;img src=&quot;/images/posts/andtbl1.png&quot; alt=&quot;Expense&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Refuels table&lt;br /&gt;
&lt;img src=&quot;/images/posts/andtbl2.png&quot; alt=&quot;Refuel&quot; /&gt;&lt;br /&gt;
Where &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;exp_id&lt;/code&gt; is a foreign key referencing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;expense_id&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now ideally, to get the expense where refuel_id was &lt;strong&gt;1&lt;/strong&gt;, a nice looking SQL query should be like this -&lt;/p&gt;

&lt;div class=&quot;language-sql highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;expense&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;INNER&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;JOIN&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;refuel&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;ON&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;exp_id&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;expense_id&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;WHERE&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;refuel_id&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Which, in android, can be done like this -&lt;/p&gt;

&lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rawQuery&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;SELECT * FROM &quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;RefuelTable&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;TABLE_NAME&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot; INNER JOIN &quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;ExpenseTable&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;TABLE_NAME&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot; ON &quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;RefuelTable&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;EXP_ID&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot; = &quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;ExpenseTable&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;ID&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot; WHERE &quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;RefuelTable&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;ID&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot; = &quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;  &lt;span class=&quot;n&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;Cursor&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;c&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;rawQuery&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;rawQuery&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;But of course, because of SQLite’s backward compatible support of the primitive way of querying, we turn that command into&lt;/p&gt;

&lt;div class=&quot;language-sql highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;expense&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;refuel&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;WHERE&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;exp_id&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;expense_id&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;AND&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;refuel_id&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Now this we can write by hacking the terminology used by the #query() method -&lt;/p&gt;

&lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nc&quot;&gt;Cursor&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;c&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;query&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;
        &lt;span class=&quot;nc&quot;&gt;RefuelTable&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;TABLE_NAME&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot; , &quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;ExpenseTable&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;TABLE_NAME&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;nc&quot;&gt;Utils&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;concat&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;RefuelTable&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;PROJECTION&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;ExpenseTable&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;PROJECTION&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;),&lt;/span&gt;
        &lt;span class=&quot;nc&quot;&gt;RefuelTable&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;EXP_ID&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot; = &quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;ExpenseTable&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;ID&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot; AND &quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;RefuelTable&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;ID&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot; = &quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;  &lt;span class=&quot;n&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;To explain a bit, the first argument &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;String tableName&lt;/code&gt; can take &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;table1, table2&lt;/code&gt; as well safely,
The second argument takes a String array of column names, I concatenated the two projections of the two classes.
and finally, put by WHERE clause into the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;String selection&lt;/code&gt; argument.&lt;/p&gt;

  
  &lt;p&gt;&lt;a href=&quot;http://blog.championswimmer.in/2015/12/doing-a-table-join-in-android-without-using-rawquery/&quot;&gt;Doing a table join in Android without using rawQuery&lt;/a&gt; was originally published by Arnav Gupta at &lt;a href=&quot;http://blog.championswimmer.in&quot;&gt;//TODO&lt;/a&gt; on December 30, 2015.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[Using NVIDIA Optimus switchable graphics with GTX 860M on Ubuntu 15.04]]></title>
  <link rel="alternate" type="text/html" href="http://blog.championswimmer.in/2015/11/using-nvidia-optimus-switchable-graphics-with-gtx-860m-on-ubuntu-15-04/"/>
  <id>http://blog.championswimmer.in/2015/11/using-nvidia-optimus-switchable-graphics-with-gtx-860m-on-ubuntu-15-04</id>
  <published>2015-11-30T00:00:00+05:30</published>
  <updated>2015-11-30 06:05:06 +0530T00:00:00-00:00</updated>
  
  <author>
    <name>Arnav Gupta</name>
    <uri>http://blog.championswimmer.in</uri>
    <email>championswimmer@gmail.com</email>
  </author>
  <category scheme="http://blog.championswimmer.in/tags/#linux" term="linux" /><category scheme="http://blog.championswimmer.in/tags/#ubuntu" term="ubuntu" /><category scheme="http://blog.championswimmer.in/tags/#nvidia" term="nvidia" /><category scheme="http://blog.championswimmer.in/tags/#bumblebee" term="bumblebee" /><category scheme="http://blog.championswimmer.in/tags/#primus" term="primus" /><category scheme="http://blog.championswimmer.in/tags/#optimus" term="optimus" />
  <content type="html">
  
    &lt;p&gt;Right since NVIDIA named their switchable graphics solution as &lt;em&gt;Optimus&lt;/em&gt;
the whole graphics scene on Linux has been a veritable bedlam of Transformer names.&lt;/p&gt;

&lt;p&gt;I have been a fan of Bumblebee from the early stages of it’s development,
and on my earlier Lenovo Z580 having a GT 740M, it was my goto solution
and worked seamlessly right from Ubuntu 12.04 to 14.04.&lt;/p&gt;

&lt;p&gt;Times have changed. I have a new laptop now - A Lenovo Y50-70 that has the
GTX 860M. And now another project has gained momentum called ‘NVIDIA Prime’.&lt;/p&gt;

&lt;strike&gt;After wrestling with Bumblebee and Primus for over a week, I finally
gave up because there was no stable solution in sight, and the closest I had
come to was to manually unload and load the nvidia and bbswitch modules every
time I wanted to use the NVIDIA GPU. Without the ease of having `optirun glxgears`
available on my shell, without having to do multiple modprobe-fu, I considered
there was little benefit of using Bumblebee.&lt;/strike&gt;
&lt;p&gt;So I have been able to get
this work with Bumblebee too, and I will mention how to use both Prime and Bumblebee.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Jump to
    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#prime&quot;&gt;Using NVIDIA Prime&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#bumblebee&quot;&gt;Using Bumblebee&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At the outset let’s discuss a few basic differences.&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Bumblebee&lt;/th&gt;
      &lt;th&gt;NVIDIA Prime&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;A long running older project&lt;/td&gt;
      &lt;td&gt;A relatively newer project&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Needs command-line invocation&lt;/td&gt;
      &lt;td&gt;Is a GUI solution (CLI method available too)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;A per-process implementation&lt;/td&gt;
      &lt;td&gt;A session-wide implementation&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Focus on power saving&lt;/td&gt;
      &lt;td&gt;Focus on high performance from discrete GPU&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Have to explicitly run each process&lt;br /&gt;with bb to benefit from NVIDIA GPU&lt;/td&gt;
      &lt;td&gt;All processes in current session &lt;br /&gt;run either on NVIDIA or all on Intel&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: Before installing any kernel level drivers (either prime or bumblebee), always make sure you have updated &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;linux-headers-generic&lt;/code&gt;&lt;/p&gt;

&lt;h3 id=&quot;using-nvidia-prime-nvidia-prime&quot;&gt;&lt;a name=&quot;prime&quot;&gt;Using NVIDIA Prime (nvidia-prime)&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;So I set off on  path to use NVIDIA Prime.
Using &lt;strong&gt;nvidia-340-updates&lt;/strong&gt; driver from the xorg-edgers ppa, as of 30th Nov, 2015,
this works perfectly. So let’s go through the steps to make it work.&lt;br /&gt;
&lt;strong&gt;UPDATE&lt;/strong&gt;: The latest drivers for 860M is 352.63, and you can hence use &lt;em&gt;&lt;strong&gt;nvidia-352-updates&lt;/strong&gt;&lt;/em&gt; instead of &lt;em&gt;&lt;strong&gt;nvidia-340-updates&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;First let’s do away with bumblebee if you’ve installed it&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get remove &lt;span class=&quot;nt&quot;&gt;--purge&lt;/span&gt; bumblebee&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt; primus nvidia&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Perform a reboot here, so your system safely configures itself to run on Intel/mesa.&lt;/p&gt;

&lt;p&gt;Let’s add edgers’ repo and install nvidia-340.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;add-apt-repository ppa:xorg-edgers/ppa
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get update
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;nvidia-340-updates
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Again, it is safe to perform a reboot here.&lt;/p&gt;

&lt;p&gt;Let’s get the prime and settings packages now.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;nvidia-settings nvidia-prime
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now before we reboot, we need to make sure of one thing,
that is nvidia is loaded before bbswitch always.
For that, edit &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/modules&lt;/code&gt; and add these two lines&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;nvidia-304-updates
bbswitch
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now reboot your system. If all has gone right, you can switch between NVIDIA and Intel using the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nvidia-settings&lt;/code&gt; configuration utility. &lt;strong&gt;You have to logout and login every time you switch graphics cards. Also unlike optirun/primusrun, when you have enabled NVIDIA, everything in your current sessoin works with NVIDIA and similarly for Intel. To switch graphics, you have to open the &lt;em&gt;nvidia-settings&lt;/em&gt; panel and switch graphics card, and logout and login back again.&lt;/strong&gt;.&lt;/p&gt;

&lt;h3 id=&quot;-using-bumblebee-bumblebee-nvidia-&quot;&gt;&lt;a name=&quot;bumblebee&quot;&gt; Using Bumblebee (bumblebee-nvidia) &lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;After sorely missing bumblebee for some days, I took another hit at it. And was able to make it work with NVIDIA’s 352.63 drivers. The reason was that, I mainly prefer to run on Intel HD Gfx, and for certain cases (like the OBS broadcaster, Lightworks, Android emulators) need NVIDIA, as an on-demand solution (and not a login/logout solution).&lt;/p&gt;

&lt;p&gt;Here were the steps to get it to work. First need to purge away &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nvidia-prime&lt;/code&gt; as they both don’t work together&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get remove &lt;span class=&quot;nt&quot;&gt;--purge&lt;/span&gt; nvidia-prime
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now install &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nvidia-352-updates&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get remove &lt;span class=&quot;nt&quot;&gt;--purge&lt;/span&gt; nvidia&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;#optional, not really needed as any nvidia driver uninstalls the previous&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;add-apt-repository ppa:graphics-drivers/ppa
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get update
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;nvidia-352-updates
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Let us go forward and now install bumblebee&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;bumblebee bumblebee-nvidia bbswitch-dkms primus
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;systemctl &lt;span class=&quot;nb&quot;&gt;enable &lt;/span&gt;bumblebeed &lt;span class=&quot;c&quot;&gt;#Enable bumblebee daemon in systemd&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;gpasswd &lt;span class=&quot;nt&quot;&gt;-a&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$USER&lt;/span&gt; bumblebee &lt;span class=&quot;c&quot;&gt;#add yourself to bumblebee group&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We need to make sure the i915 and bbswitch drivers get loaded to the kernel, so edit the file &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/modules&lt;/code&gt; and the following&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;i915
bbswitch
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now is the important part where we need to make sure that Bumblebee handles loading/unloading of Gfx modules. So it has to be made sure that all installed graphics drivers including &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nouveau&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nvidia-352-updates&lt;/code&gt; is blacklisted. Check the file &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/modprobe.d/bumblebee.conf&lt;/code&gt; and ensure the following lines present&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;blacklist nouveau
blacklist nvidia-352
blacklist nvidia-352-updates
blacklist nvidia
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;em&gt;If these lines are not present, the kernel will automatically load the modules and bumblebee won’t be able to handle the load/unload of modules.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now as a final step we need to inform Bumblebee which version of Nvidia drivers are we using, for doing that check the contents of the file &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/bumblebee/bumblebee.conf&lt;/code&gt;&lt;/p&gt;

&lt;pre class=&quot;highlight&quot;&gt;
# Configuration file for Bumblebee. Values should **not** be put between quotes

## Server options. Any change made in this section will need a server restart
# to take effect.
[bumblebeed]
# The secondary Xorg server DISPLAY number
VirtualDisplay=:8
# Should the unused Xorg server be kept running? Set this to true if waiting
# for X to be ready is too long and don't need power management at all.
KeepUnusedXServer=false
# The name of the Bumbleblee server group name (GID name)
ServerGroup=bumblebee
# Card power state at exit. Set to false if the card shoud be ON when Bumblebee
# server exits.
TurnCardOffAtExit=false
# The default behavior of '-f' option on optirun. If set to &quot;true&quot;, '-f' will
# be ignored.
NoEcoModeOverride=false
# The Driver used by Bumblebee server. If this value is not set (or empty),
# auto-detection is performed. The available drivers are nvidia and nouveau
# (See also the driver-specific sections below)
&lt;b style=&quot;color: crimson&quot;&gt;Driver=nvidia&lt;/b&gt;
# Directory with a dummy config file to pass as a -configdir to secondary X
XorgConfDir=/etc/bumblebee/xorg.conf.d

## Client options. Will take effect on the next optirun executed.
[optirun]
# Acceleration/ rendering bridge, possible values are auto, virtualgl and
# primus.
Bridge=auto
# The method used for VirtualGL to transport frames between X servers.
# Possible values are proxy, jpeg, rgb, xv and yuv.
VGLTransport=proxy
# List of paths which are searched for the primus libGL.so.1 when using
# the primus bridge
PrimusLibraryPath=/usr/lib/x86_64-linux-gnu/primus:/usr/lib/i386-linux-gnu/primus
# Should the program run under optirun even if Bumblebee server or nvidia card
# is not available?
AllowFallbackToIGC=false


# Driver-specific settings are grouped under [driver-NAME]. The sections are
# parsed if the Driver setting in [bumblebeed] is set to NAME (or if auto-
# detection resolves to NAME).
# PMMethod: method to use for saving power by disabling the nvidia card, valid
# values are: auto - automatically detect which PM method to use
#         bbswitch - new in BB 3, recommended if available
#       switcheroo - vga_switcheroo method, use at your own risk
#             none - disable PM completely
# https://github.com/Bumblebee-Project/Bumblebee/wiki/Comparison-of-PM-methods

## Section with nvidia driver specific options, only parsed if Driver=nvidia
[driver-nvidia]
# Module name to load, defaults to Driver if empty or unset
&lt;b style=&quot;color: crimson&quot;&gt;KernelDriver=nvidia-352-updates&lt;/b&gt;
PMMethod=auto
# colon-separated path to the nvidia libraries
&lt;b style=&quot;color: crimson&quot;&gt;LibraryPath=/usr/lib/nvidia-352-updates:/usr/lib32/nvidia-352-updates&lt;/b&gt;
# comma-separated path of the directory containing nvidia_drv.so and the
# default Xorg modules path
&lt;b style=&quot;color: crimson&quot;&gt;XorgModulePath=/usr/lib/nvidia-352-updates/xorg,/usr/lib/xorg/modules&lt;/b&gt;
XorgConfFile=/etc/bumblebee/xorg.conf.nvidia

## Section with nouveau driver specific options, only parsed if Driver=nouveau
[driver-nouveau]
KernelDriver=nouveau
PMMethod=auto
XorgConfFile=/etc/bumblebee/xorg.conf.nouveau

&lt;/pre&gt;

&lt;p&gt;You need to change the lines highlighted in red accordingly.
And finaaaaaaly, reboot, and enjoy bumblebee.&lt;/p&gt;

&lt;p&gt;To run any program with NVIDIA use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;primusrun &amp;lt;program name&amp;gt;&lt;/code&gt;. By default everything runs with Intel
HD Graphics, and NVIDIA card stays off.&lt;/p&gt;

  
  &lt;p&gt;&lt;a href=&quot;http://blog.championswimmer.in/2015/11/using-nvidia-optimus-switchable-graphics-with-gtx-860m-on-ubuntu-15-04/&quot;&gt;Using NVIDIA Optimus switchable graphics with GTX 860M on Ubuntu 15.04&lt;/a&gt; was originally published by Arnav Gupta at &lt;a href=&quot;http://blog.championswimmer.in&quot;&gt;//TODO&lt;/a&gt; on November 30, 2015.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[Reimagining the PTO : A messenger and a friend]]></title>
  <link rel="alternate" type="text/html" href="http://blog.championswimmer.in/2015/11/reimagining-the-pto-a-messenger-and-a-friend/"/>
  <id>http://blog.championswimmer.in/2015/11/reimagining-the-pto--a-messenger-and-a-friend</id>
  <published>2015-11-23T00:00:00+05:30</published>
  <updated>2015-11-23 15:01:01 +0530T00:00:00-00:00</updated>
  
  <author>
    <name>Arnav Gupta</name>
    <uri>http://blog.championswimmer.in</uri>
    <email>championswimmer@gmail.com</email>
  </author>
  <category scheme="http://blog.championswimmer.in/tags/#helpchat" term="helpchat" /><category scheme="http://blog.championswimmer.in/tags/#magic" term="magic" /><category scheme="http://blog.championswimmer.in/tags/#goodservice" term="goodservice" /><category scheme="http://blog.championswimmer.in/tags/#haptik" term="haptik" /><category scheme="http://blog.championswimmer.in/tags/#personal%20assistant" term="personal assistant" /><category scheme="http://blog.championswimmer.in/tags/#post" term="post" /><category scheme="http://blog.championswimmer.in/tags/#postman" term="postman" />
  <content type="html">
  
    &lt;p&gt;The acronym &lt;strong&gt;PTO&lt;/strong&gt;, to most people from a generation, would mean the Post and Telegraph Office. The &lt;em&gt;“messenger”&lt;/em&gt; of the nation (talking about India here) during the 80’s and 90’s when the modern India was being built. From Bollywood films to R K Narayan novels, the postman was an integral part of life and culture, and I might go so far as to say, part of the life and soul of Indian lifesytle.&lt;/p&gt;

&lt;p&gt;Not many of my generation can identify with the term PTO, but due to the developments in the mobile internet technology field for the last couple of years, I’ll coin a new expansion of the acronym - &lt;em&gt;&lt;strong&gt;Personal Task Outsourcing.&lt;/strong&gt;&lt;/em&gt; (Oh yes, taking a cue from BPO).&lt;/p&gt;

&lt;p&gt;But I am not just talking a superficial cue from BPO. In its essence the booming BPO business in India, the coinage of the term &lt;em&gt;‘bangalor-ed’&lt;/em&gt; in American industries, all were stemming from the fact that human labour is cheap (way too cheap) in India. There were and are millions of unemployed Indians happy to accept the job of sitting with headphones on their head and silently listening to complaints of disgruntled customers.&lt;/p&gt;

&lt;p&gt;By what I mean by Personal Task Outsourcing, has a lot to with the same. Though idea did not take root in India (as it never unfortunately does in most cases). What started with companies like &lt;strong&gt;Magic&lt;/strong&gt; (getmagicnow) and &lt;strong&gt;Butler&lt;/strong&gt; was soon copied by three players in the Indian startup space , namely — &lt;strong&gt;Akosha&lt;/strong&gt; (who renamed themselves to &lt;strong&gt;Helpchat&lt;/strong&gt;), &lt;strong&gt;GoodService&lt;/strong&gt;, and &lt;strong&gt;Haptik&lt;/strong&gt;. It was helped largely by the boom in India’s hyperlocal and food tech domains. There were multiple startups delivering products like food, cosmetics, electronics to your home, and providing doorstep services like cabs, cleaning, repairing, language/art classes, yoga, massage and what not.&lt;/p&gt;

&lt;p&gt;And while the tech savvy, early adopting, Generation Y or Z (or whatever is latest) is okay with using apps like &lt;em&gt;Uber&lt;/em&gt; or &lt;em&gt;Foodpanda&lt;/em&gt; or &lt;em&gt;UrbanClap&lt;/em&gt;, the less mobile savvy people could do with services like Helpchat where they would only have to mention what they want over a messaging interface (which thanks to Facebook and Whatsapp, everyone is well versed with).&lt;/p&gt;

&lt;p&gt;And thus was born the concept of Personal Task Outsourcing. With countless players like &lt;strong&gt;TextmyPA&lt;/strong&gt;, &lt;strong&gt;Jaadu&lt;/strong&gt; (jeez they even copied Magic’s name) quickly jumping into the bandwagon, and all getting funded lavishly.&lt;/p&gt;

&lt;p&gt;For now, I can only see them succeed. Because India always had a surplus of people ready to work at dirt cheap rates to sit across a terminal and the do the job of a computer. The last few decades it was attending calls, now it is fulfilling people’s personal needs over chat. Also there is a crop of people in tier 1 cities in India who are addicted to online services, and they are lazy. So if chatting with someone fulfills your need, instead of downloading an app and going through sign up, discovery, ordering, then why not.&lt;/p&gt;

&lt;p&gt;So there, ladies and gents, we have a new PTO. Once again a messenger by function. But far more in its impact in our lives. And if the bets of Helpchat, Haptik or GoodService is right, maybe this PTO will also become the life and soul of a modern Indian’s life.&lt;/p&gt;

&lt;p&gt;P.S. A word of advice to Mark Zuckerberg. You really should start M’s services in India soon. You’ll get both customers and people ready to work behind the desk …err chatscreen, in large numbers&lt;/p&gt;

  
  &lt;p&gt;&lt;a href=&quot;http://blog.championswimmer.in/2015/11/reimagining-the-pto-a-messenger-and-a-friend/&quot;&gt;Reimagining the PTO : A messenger and a friend&lt;/a&gt; was originally published by Arnav Gupta at &lt;a href=&quot;http://blog.championswimmer.in&quot;&gt;//TODO&lt;/a&gt; on November 23, 2015.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[Sublime Code Snippets : Autogenerate Java key constants - an example]]></title>
  <link rel="alternate" type="text/html" href="http://blog.championswimmer.in/2015/10/sublime-code-snippets-autogenerate-java-key-constants-an-example/"/>
  <id>http://blog.championswimmer.in/2015/10/sublime-code-snippets--autogenerate-java-key-constants---an-example</id>
  <published>2015-10-31T00:00:00+05:30</published>
  <updated>2015-10-31 18:07:43 +0530T00:00:00-00:00</updated>
  
  <author>
    <name>Arnav Gupta</name>
    <uri>http://blog.championswimmer.in</uri>
    <email>championswimmer@gmail.com</email>
  </author>
  <category scheme="http://blog.championswimmer.in/tags/#sublime" term="sublime" /><category scheme="http://blog.championswimmer.in/tags/#java" term="java" /><category scheme="http://blog.championswimmer.in/tags/#autogenerate" term="autogenerate" /><category scheme="http://blog.championswimmer.in/tags/#code%20template" term="code template" />
  <content type="html">
  
    &lt;p&gt;I largely use &lt;a href=&quot;http://jetbrains.com&quot;&gt;Jetbrains&lt;/a&gt; products for my day to day development work (which is mostly Android). I really love the &lt;em&gt;Live Template&lt;/em&gt; feature that is available on IntelliJ, for example if I type &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;psfs&lt;/code&gt; and press &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Tab&lt;/code&gt; I get the following on the screen&lt;/p&gt;
&lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;These days, sometimes I use Sublime Text 3 as well, because unless I need all the features of an IDE, it’s too heavy to open up, especially if other stuff is running on the laptop. One of those days when I was using Sublime, I needed to create a lot of Database key constants - i.e. in the form of&lt;/p&gt;
&lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;KEY_ONE&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;key_one&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So it so happens that there exists functionality like live templates on Sublime as well, in form of &lt;strong&gt;Snippets&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To create a new Snippet, go to Tools -&amp;gt; New Snippet. 
Ideally you save your snippets in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.config/sublime-text-3/Packages/User/MySnippet.sublime-snippet&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Here is an example config for the Snippet that creates Java key constants&lt;/p&gt;

&lt;div class=&quot;language-xml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;snippet&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;content&amp;gt;&lt;/span&gt;public static final String ${1/(.+)/(\U\1)/g} = &quot;${1}&quot;;&lt;span class=&quot;nt&quot;&gt;&amp;lt;/content&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;tabTrigger&amp;gt;&lt;/span&gt;jkey&lt;span class=&quot;nt&quot;&gt;&amp;lt;/tabTrigger&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;scope&amp;gt;&lt;/span&gt;source.java&lt;span class=&quot;nt&quot;&gt;&amp;lt;/scope&amp;gt;&lt;/span&gt;
	&lt;span class=&quot;nt&quot;&gt;&amp;lt;description&amp;gt;&lt;/span&gt;public static final String KEY = &quot;key&quot;&lt;span class=&quot;nt&quot;&gt;&amp;lt;/description&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/snippet&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now when you type &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;jkey&lt;/code&gt; and press tab, it creates&lt;/p&gt;
&lt;div class=&quot;language-java highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;|&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;table&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;The pipes ‘&lt;/td&gt;
      &lt;td&gt;’ represent the cursor position. When you start typing in lowercase for example &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;my_key_one&lt;/code&gt;, automatically the variable name updates in uppercase &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MY_KEY_ONE&lt;/code&gt;.&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

  
  &lt;p&gt;&lt;a href=&quot;http://blog.championswimmer.in/2015/10/sublime-code-snippets-autogenerate-java-key-constants-an-example/&quot;&gt;Sublime Code Snippets : Autogenerate Java key constants - an example&lt;/a&gt; was originally published by Arnav Gupta at &lt;a href=&quot;http://blog.championswimmer.in&quot;&gt;//TODO&lt;/a&gt; on October 31, 2015.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[Jekyll:Syntax Highlighting in Github Favoured Markdown codeblocks]]></title>
  <link rel="alternate" type="text/html" href="http://blog.championswimmer.in/2015/10/jekyllsyntax-highlighting-in-github-favoured-markdown-codeblocks/"/>
  <id>http://blog.championswimmer.in/2015/10/jekyllsyntax-highlighting-in-github-favoured-markdown-codeblocks</id>
  <published>2015-10-25T00:00:00+05:30</published>
  <updated>2015-10-25 03:27:34 +0530T00:00:00-00:00</updated>
  
  <author>
    <name>Arnav Gupta</name>
    <uri>http://blog.championswimmer.in</uri>
    <email>championswimmer@gmail.com</email>
  </author>
  <category scheme="http://blog.championswimmer.in/tags/#Jekyll" term="Jekyll" /><category scheme="http://blog.championswimmer.in/tags/#Github%20Pages" term="Github Pages" /><category scheme="http://blog.championswimmer.in/tags/#Markdown" term="Markdown" /><category scheme="http://blog.championswimmer.in/tags/#Syntax%20Highlighting" term="Syntax Highlighting" />
  <content type="html">
  
    &lt;p&gt;You are using Jekyll to host a blog on Github pages. And you need to add Syntax Highlighting to your code. And you want to mark your code blocks using the triple backtick format of Github flavored markdown.&lt;/p&gt;

&lt;p&gt;Now that’s a very unique set of circumstances to be in, and if you are in those shoes, you might have figured out that it seems almost impossible to get this to work. Here are the basic blockers -&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;Github doesn’t allow user plugins. So you cannot just put coderay.rb inside _plugins&lt;/li&gt;
  &lt;li&gt;Github by default uses &lt;em&gt;redcarpet&lt;/em&gt; as the markdown interpreter. But, &lt;em&gt;kramdown&lt;/em&gt; has inbuilt syntax highlighting support, redcarpet doesn’t&lt;/li&gt;
  &lt;li&gt;Since `` kind of code block demarcaters work, no one in the Jekyll/Redcarpet/Kramdown community wants to help fix this issue.&lt;/li&gt;
  &lt;li&gt;Redcarpet can interpret GFM, while Kramdown cannot. Although the documentation says it can.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;But that aside, lets quickly take a look at how this can be solved. 
So Github uses &lt;em&gt;redcarpet&lt;/em&gt; internally to parse markdown, and we should stick with it, because that’s the only bet to successfully interpret GFM code blocks. 
Also, Github Pages has pygments installed already, so for syntax highlighting we &lt;strong&gt;have to&lt;/strong&gt; use pygments only. 
So put the following lines in your _config.yml&lt;/p&gt;

&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;# Conversion&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;markdown&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;redcarpet&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;highlighter&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;pygments&lt;/span&gt;
&lt;span class=&quot;na&quot;&gt;redcarpet&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;na&quot;&gt;extensions&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;pi&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;no_intra_emphasis&quot;&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;fenced_code_blocks&quot;&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;autolink&quot;&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;strikethrough&quot;&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;superscript&quot;&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now here is a very important step. Having a pgments css file and having it included is &lt;strong&gt;very&lt;/strong&gt; important. Even if all the other configs are ok, but the css not included, the Jekyll site wont build on Github’s server.&lt;/p&gt;

&lt;p&gt;You can save the following as assets/css/pygments/solarized-dark.css&lt;/p&gt;

&lt;div class=&quot;language-css highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;/* Solarized Dark 

For use with Jekyll and Pygments

http://ethanschoonover.com/solarized

SOLARIZED HEX      ROLE
--------- -------- ------------------------------------------
base03    #002b36  background
base01    #586e75  comments / secondary content
base1     #93a1a1  body text / default code / primary content
orange    #cb4b16  constants
red       #dc322f  regex, special keywords
blue      #268bd2  reserved keywords
cyan      #2aa198  strings, numbers
green     #859900  operators, other keywords
*/&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#002b36&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#93a1a1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;max-width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;56.25rem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1rem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1rem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;auto&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;2em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.lineno&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#586e75&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Line Numbers */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.c&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#586e75&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Comment */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.err&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#93a1a1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Error */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.g&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#93a1a1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Generic */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.k&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#859900&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Keyword */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.l&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#93a1a1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.n&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#93a1a1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.o&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#859900&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Operator */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.x&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#cb4b16&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Other */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.p&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#93a1a1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Punctuation */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.cm&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#586e75&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Comment.Multiline */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.cp&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#859900&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Comment.Preproc */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.c1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#586e75&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Comment.Single */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.cs&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#859900&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Comment.Special */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.gd&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#2aa198&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Generic.Deleted */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.ge&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#93a1a1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;font-style&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;italic&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Generic.Emph */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.gr&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#dc322f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Generic.Error */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.gh&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#cb4b16&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Generic.Heading */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.gi&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#859900&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Generic.Inserted */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.go&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#93a1a1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Generic.Output */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.gp&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#93a1a1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Generic.Prompt */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.gs&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#93a1a1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;font-weight&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;bold&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Generic.Strong */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.gu&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#cb4b16&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Generic.Subheading */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.gt&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#93a1a1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Generic.Traceback */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.kc&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#cb4b16&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Keyword.Constant */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.kd&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#268bd2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Keyword.Declaration */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.kn&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#859900&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Keyword.Namespace */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.kp&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#859900&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Keyword.Pseudo */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.kr&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#268bd2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Keyword.Reserved */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.kt&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#dc322f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Keyword.Type */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.ld&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#93a1a1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.Date */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.m&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#2aa198&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.Number */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.s&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#2aa198&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.String */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.na&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#93a1a1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Attribute */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.nb&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#B58900&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Builtin */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.nc&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#268bd2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Class */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.no&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#cb4b16&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Constant */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.nd&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#268bd2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Decorator */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.ni&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#cb4b16&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Entity */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.ne&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#cb4b16&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Exception */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.nf&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#268bd2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Function */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.nl&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#93a1a1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Label */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.nn&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#93a1a1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Namespace */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.nx&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#93a1a1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Other */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.py&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#93a1a1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Property */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.nt&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#268bd2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Tag */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.nv&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#268bd2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Variable */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.ow&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#859900&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Operator.Word */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.w&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#93a1a1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Text.Whitespace */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.mf&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#2aa198&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.Number.Float */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.mh&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#2aa198&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.Number.Hex */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.mi&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#2aa198&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.Number.Integer */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.mo&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#2aa198&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.Number.Oct */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.sb&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#586e75&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.String.Backtick */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.sc&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#2aa198&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.String.Char */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.sd&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#93a1a1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.String.Doc */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.s2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#2aa198&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.String.Double */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.se&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#cb4b16&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.String.Escape */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.sh&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#93a1a1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.String.Heredoc */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.si&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#2aa198&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.String.Interpol */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.sx&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#2aa198&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.String.Other */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.sr&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#dc322f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.String.Regex */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.s1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#2aa198&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.String.Single */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.ss&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#2aa198&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.String.Symbol */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.bp&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#268bd2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Builtin.Pseudo */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.vc&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#268bd2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Variable.Class */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.vg&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#268bd2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Variable.Global */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.vi&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#268bd2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Variable.Instance */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.il&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#2aa198&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.Number.Integer.Long */&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Or if you prefer light, please use this one instead&lt;/p&gt;

&lt;div class=&quot;language-css highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;/* Solarized Light 

For use with Jekyll and Pygments

http://ethanschoonover.com/solarized

SOLARIZED HEX      ROLE
--------- -------- ------------------------------------------
base01    #586e75  body text / default code / primary content
base1     #93a1a1  comments / secondary content
base3     #fdf6e3  background
orange    #cb4b16  constants
red       #dc322f  regex, special keywords
blue      #268bd2  reserved keywords
cyan      #2aa198  strings, numbers
green     #859900  operators, other keywords
*/&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#fdf6e3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#586e75&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;max-width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;56.25rem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1rem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1rem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;auto&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;2em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.lineno&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#93a1a1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Line Numbers */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.c&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#93a1a1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Comment */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.err&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#586e75&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Error */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.g&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#586e75&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Generic */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.k&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#859900&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Keyword */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.l&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#586e75&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.n&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#586e75&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.o&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#859900&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Operator */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.x&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#cb4b16&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Other */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.p&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#586e75&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Punctuation */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.cm&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#93a1a1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Comment.Multiline */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.cp&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#859900&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Comment.Preproc */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.c1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#93a1a1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Comment.Single */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.cs&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#859900&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Comment.Special */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.gd&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#2aa198&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Generic.Deleted */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.ge&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#586e75&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;font-style&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;italic&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Generic.Emph */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.gr&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#dc322f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Generic.Error */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.gh&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#cb4b16&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Generic.Heading */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.gi&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#859900&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Generic.Inserted */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.go&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#586e75&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Generic.Output */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.gp&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#586e75&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Generic.Prompt */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.gs&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#586e75&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;font-weight&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;bold&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Generic.Strong */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.gu&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#cb4b16&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Generic.Subheading */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.gt&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#586e75&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Generic.Traceback */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.kc&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#cb4b16&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Keyword.Constant */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.kd&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#268bd2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Keyword.Declaration */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.kn&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#859900&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Keyword.Namespace */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.kp&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#859900&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Keyword.Pseudo */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.kr&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#268bd2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Keyword.Reserved */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.kt&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#dc322f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Keyword.Type */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.ld&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#586e75&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.Date */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.m&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#2aa198&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.Number */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.s&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#2aa198&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.String */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.na&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#586e75&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Attribute */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.nb&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#B58900&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Builtin */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.nc&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#268bd2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Class */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.no&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#cb4b16&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Constant */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.nd&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#268bd2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Decorator */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.ni&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#cb4b16&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Entity */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.ne&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#cb4b16&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Exception */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.nf&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#268bd2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Function */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.nl&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#586e75&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Label */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.nn&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#586e75&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Namespace */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.nx&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#586e75&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Other */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.py&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#586e75&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Property */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.nt&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#268bd2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Tag */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.nv&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#268bd2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Variable */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.ow&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#859900&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Operator.Word */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.w&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#586e75&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Text.Whitespace */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.mf&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#2aa198&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.Number.Float */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.mh&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#2aa198&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.Number.Hex */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.mi&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#2aa198&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.Number.Integer */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.mo&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#2aa198&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.Number.Oct */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.sb&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#93a1a1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.String.Backtick */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.sc&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#2aa198&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.String.Char */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.sd&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#586e75&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.String.Doc */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.s2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#2aa198&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.String.Double */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.se&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#cb4b16&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.String.Escape */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.sh&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#586e75&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.String.Heredoc */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.si&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#2aa198&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.String.Interpol */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.sx&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#2aa198&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.String.Other */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.sr&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#dc322f&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.String.Regex */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.s1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#2aa198&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.String.Single */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.ss&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#2aa198&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.String.Symbol */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.bp&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#268bd2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Builtin.Pseudo */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.vc&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#268bd2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Variable.Class */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.vg&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#268bd2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Variable.Global */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.vi&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#268bd2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Name.Variable.Instance */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.highlight&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.il&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#2aa198&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Literal.Number.Integer.Long */&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Make sure to add &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;link rel=&quot;stylesheet&quot; href=&quot;http://blog.championswimmer.in/assets/css/pygments/solarized-light.css&quot;&amp;gt;&lt;/code&gt; to the layout of your posts. Most probably might be in _includes/head.html or specifically in _layouts/post.html&lt;/p&gt;

&lt;p&gt;That should be it. Your Jekyll blog posts, with GFM code blocks should now be highlighted in Solarized, if all went well. 
As a proof, I am using the same method in this very block. Feel free to check out the sources.&lt;/p&gt;

  
  &lt;p&gt;&lt;a href=&quot;http://blog.championswimmer.in/2015/10/jekyllsyntax-highlighting-in-github-favoured-markdown-codeblocks/&quot;&gt;Jekyll:Syntax Highlighting in Github Favoured Markdown codeblocks&lt;/a&gt; was originally published by Arnav Gupta at &lt;a href=&quot;http://blog.championswimmer.in&quot;&gt;//TODO&lt;/a&gt; on October 25, 2015.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[Linux refugee in Windows aylum: A scoop of chocolatey nuget]]></title>
  <link rel="alternate" type="text/html" href="http://blog.championswimmer.in/2015/10/linux-refugee-in-windows-aylum-a-scoop-of-chocolatey-nuget/"/>
  <id>http://blog.championswimmer.in/2015/10/linux-refugee-in-windows-aylum-a-scoop-of-chocolatey-nuget</id>
  <published>2015-10-20T00:00:00+05:30</published>
  <updated>2015-10-20 04:56:29 +0530T00:00:00-00:00</updated>
  
  <author>
    <name>Arnav Gupta</name>
    <uri>http://blog.championswimmer.in</uri>
    <email>championswimmer@gmail.com</email>
  </author>
  
  <content type="html">
  
    &lt;p&gt;I &lt;em&gt;forgot&lt;/em&gt; my laptop’s charger at my dorm when I came home this weekend, but I had to work on my GSoC project as my contributions were lagging. I had to borrow my Dad’s XPS running Windows 8. Fuck. Windows. Without any development tools installed.&lt;/p&gt;

&lt;p&gt;So it’s not like I don’t ever use Windows at all. I have a Windows 7 dual boot set up running on my laptop for the times when I need to twilight as the &lt;a href=&quot;http://google.com/search?q=Batman+Arkham+video+games&quot;&gt;Knight of Arkham City&lt;/a&gt; or don &lt;a href=&quot;http://chelseafc.com&quot;&gt;the blues&lt;/a&gt; to give Ferguson’s boys a drubbing or &lt;a href=&quot;http://google.com/search?q=Assassins+Creed&quot;&gt;kill some Templars&lt;/a&gt; in the French/American Revolution. But that’s pretty much all that I do on Windows - play games. I do not even have PDF Reader or an Office Suite or any browser other than Internet Explorer on Windows - which should suffice to say how much of anything else I do on Windows.&lt;/p&gt;

&lt;p&gt;And here I was supposed to work on my GSoC project which involved&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Git&lt;/strong&gt;; to get the source and commit back&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Nodejs&lt;/strong&gt;; to get bower and gulp to serve the project to localhost to test it out&lt;/li&gt;
  &lt;li&gt;A half decent text editor because Notepad is total jackshit&lt;/li&gt;
  &lt;li&gt;A commandline that doesnt want arguments with ‘/’ and dir trees with ‘' and shows files with ‘ls’ and  . . you get what I mean ? I want fucking &lt;strong&gt;bash&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;package-manager&quot;&gt;Package Manager&lt;/h2&gt;
&lt;p&gt;For a Linux refugee, the first pain point is the obvious absence of a package manager. (I hear Windows 10 &lt;strong&gt;FINALLY&lt;/strong&gt; has one). 
It is really such a PITA if you cannot simply get ruby or node or python via &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;apt-get install nodejs python ruby&lt;/code&gt; 
And as it happens, there are three options in front of you -&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://www.nuget.org/&quot;&gt;NuGet&lt;/a&gt;&lt;/strong&gt; - The package manager that is now default in Visual Studio as well.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;scoop.sh/&quot;&gt;Scoop&lt;/a&gt;&lt;/strong&gt; - My personal favourite and the closest you get to a Linux package manager, and has a repository of almost all known development related packages.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://chocolatey.org/&quot;&gt;Chocolatey&lt;/a&gt;&lt;/strong&gt; - One of the earliest attempts to get a apt-get like interface on windows.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href=&quot;https://outcoldman.com/en/archive/2014/07/20/scoop/&quot;&gt;Here is a brilliant blog&lt;/a&gt; describing how to get Scoop installed on your Windows machine, plus some tips on how to enable execution policy on Windows Powershell.&lt;/p&gt;

&lt;h2 id=&quot;git-support&quot;&gt;Git support&lt;/h2&gt;
&lt;p&gt;I cannot ever stop singing praises for &lt;a href=&quot;http://github.com&quot;&gt;Github&lt;/a&gt; for all the cool work they do, and one of them is bringing Windows and Git as close to each other as possible. 
The thing is Git was developed by, well none other than &lt;strong&gt;Linus Torvalds&lt;/strong&gt;, &lt;em&gt;the&lt;/em&gt; guy who made Linux, and so historically, Git (which is possibly the best distributed VCS in the world) has primarily been a relic of the Linux realm.
Github for Windows is great way to bring not just Git to Windows, but via the &lt;em&gt;&lt;strong&gt;Git Shell&lt;/strong&gt;&lt;/em&gt; that comes with the package, you get a decent &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bash&lt;/code&gt;/&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;zsh&lt;/code&gt; like command line interface too.&lt;/p&gt;

&lt;h2 id=&quot;a-more-linux-ey-cli&quot;&gt;A more linux-ey CLI&lt;/h2&gt;
&lt;p&gt;While what Git Shell provides is really nice, if you are weeping silently because you really really want a proper Linux CLI inside Windows (oh dear you, I can feel you man), then there are few tweaks that you can do.&lt;/p&gt;

&lt;p&gt;You can get powershell, and install the Solarized theme, that makes stuff really awesome&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;gt; scoop install concfg
&amp;gt; concfg import solarized small
&amp;gt; scoop install pshazz
&amp;gt; pshazz init #Run this everytime you open your shell
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;best-text-editors-available&quot;&gt;Best text editors available&lt;/h2&gt;
&lt;p&gt;I do not want to make it an opinionated advice here, so I’ll just list all the options that you have&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Sublime Text&lt;/strong&gt; - The most widely used, and has maximum extensions. Pretty fast.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Atom&lt;/strong&gt; - A new javascript-based text editor by Github. Runs in it’s own Chromium runtime, so can be slow and bloaty. Might not be suitable for large files. The UI is brilliant, and overall design and experience was the best for me.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Brackets&lt;/strong&gt; - Adobe’s hat in the growing ring of Chromium-runtime based editors. Has got robust live-preview support. And the colors and themes are soothing.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Visual Studio Code&lt;/strong&gt; - And finally how could Microsoft stay behind. They took &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Electron&lt;/code&gt; the runtime used by Atom, and made their own code editor too. If you ask me, they should make VS Code default instead of Notepad/Wordpad on Windows 10.&lt;/li&gt;
&lt;/ol&gt;

  
  &lt;p&gt;&lt;a href=&quot;http://blog.championswimmer.in/2015/10/linux-refugee-in-windows-aylum-a-scoop-of-chocolatey-nuget/&quot;&gt;Linux refugee in Windows aylum: A scoop of chocolatey nuget&lt;/a&gt; was originally published by Arnav Gupta at &lt;a href=&quot;http://blog.championswimmer.in&quot;&gt;//TODO&lt;/a&gt; on October 20, 2015.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[Android Protip: Show selected value of ListPreference]]></title>
  <link rel="alternate" type="text/html" href="http://blog.championswimmer.in/2015/10/android-protip-show-selected-value-of-listpreference/"/>
  <id>http://blog.championswimmer.in/2015/10/android-protip-show-selected-value-of-listpreference</id>
  <published>2015-10-18T00:00:00+05:30</published>
  <updated>2015-10-18 06:26:49 +0530T00:00:00-00:00</updated>
  
  <author>
    <name>Arnav Gupta</name>
    <uri>http://blog.championswimmer.in</uri>
    <email>championswimmer@gmail.com</email>
  </author>
  <category scheme="http://blog.championswimmer.in/tags/#android" term="android" /><category scheme="http://blog.championswimmer.in/tags/#ListPreference" term="ListPreference" /><category scheme="http://blog.championswimmer.in/tags/#protip" term="protip" />
  <content type="html">
  
    &lt;p&gt;Here’s a quick Protip for people who are still writing complex &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;onPreferenceChanged&lt;/code&gt; code to show the selected value of a &lt;em&gt;ListPreference&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Just add &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;android:summary=&quot;%s&quot;&lt;/code&gt; and Android will automatically do it for you ;)&lt;/p&gt;

&lt;p&gt;For example, your code might look like : -&lt;/p&gt;

&lt;div class=&quot;language-xml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;    &lt;span class=&quot;nt&quot;&gt;&amp;lt;ListPreference&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;android:summary=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;%s&quot;&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;android:defaultValue=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;km&quot;&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;android:entries=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;@array/distance_unit_names&quot;&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;android:entryValues=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;@array/distance_unit_values&quot;&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;android:key=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;distance_unit&quot;&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;android:title=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Distance Unit&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Android will even put the currently selected value when you enter the preference screen.&lt;/p&gt;

  
  &lt;p&gt;&lt;a href=&quot;http://blog.championswimmer.in/2015/10/android-protip-show-selected-value-of-listpreference/&quot;&gt;Android Protip: Show selected value of ListPreference&lt;/a&gt; was originally published by Arnav Gupta at &lt;a href=&quot;http://blog.championswimmer.in&quot;&gt;//TODO&lt;/a&gt; on October 18, 2015.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[Autoconnect Ubuntu Server to a Wifi network]]></title>
  <link rel="alternate" type="text/html" href="http://blog.championswimmer.in/2015/09/autoconnect-ubuntu-server-to-a-wifi-network/"/>
  <id>http://blog.championswimmer.in/2015/09/autoconnect-ubuntu-server-to-a-wifi-network</id>
  <published>2015-09-28T00:00:00+05:30</published>
  <updated>2015-09-28 07:23:18 +0530T00:00:00-00:00</updated>
  
  <author>
    <name>Arnav Gupta</name>
    <uri>http://blog.championswimmer.in</uri>
    <email>championswimmer@gmail.com</email>
  </author>
  <category scheme="http://blog.championswimmer.in/tags/#Linux" term="Linux" /><category scheme="http://blog.championswimmer.in/tags/#Networking" term="Networking" /><category scheme="http://blog.championswimmer.in/tags/#Ubuntu" term="Ubuntu" /><category scheme="http://blog.championswimmer.in/tags/#Server" term="Server" /><category scheme="http://blog.championswimmer.in/tags/#Wifi" term="Wifi" />
  <content type="html">
  
    &lt;p&gt;So I just turned my old Lenovo Z580 into a Android Build Server. And the first problem I faced was that of making it auto connect to the home Wifi everytime I turn it on.&lt;/p&gt;

&lt;p&gt;Basically we have to edit the file &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/network/interfaces&lt;/code&gt; and make the contents somewhat like this -&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;auto wlan0
iface wlan0 inet dhcp 
                wpa-ssid YOUR_WIFI_SSID
                wpa-psk  YOUR_WIFI_PASSWORD
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This is assuming you are on a WPA/WPA2 PSK encryption. If you are on WEP, why dear why ? Move to WPA. 
If you want to affix a permanent static ip address to your server, the contents should rather be like this&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;auto wlan0
iface wlan0 inet static
				address 192.168.1.111
				netmask 255.255.255.0
				gateway 192.168.1.1
                wpa-ssid YOUR_WIFI_SSID
                wpa-psk  YOUR_WIFI_PASSWORD
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This is assuming your router’s ip is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;192.168.1.1&lt;/code&gt;, and the ip you want to affix the server is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;192.168.1.111&lt;/code&gt;. Change them to suit your needs.&lt;/p&gt;


  
  &lt;p&gt;&lt;a href=&quot;http://blog.championswimmer.in/2015/09/autoconnect-ubuntu-server-to-a-wifi-network/&quot;&gt;Autoconnect Ubuntu Server to a Wifi network&lt;/a&gt; was originally published by Arnav Gupta at &lt;a href=&quot;http://blog.championswimmer.in&quot;&gt;//TODO&lt;/a&gt; on September 28, 2015.&lt;/p&gt;</content>
</entry>

</feed>
