Category Archives: Technology
Installing EditorConfig on Sublime Text
- Go the Preferences tab -> Package Control.
- Select Install Package from the drop down menu.
- Wait for the list to load, once it loads it will show you a list of packages.
- Now, type in EditorConfig and select the highlighted option.
To confirm that Editor Config is installed correctly on your Sublime Text instance you can go to Preferences -> Browse Packages. If installed correctly you should be able to see an EditorConfig directory present in the Packages directory.
That’s it! Enjoy! 🙂
Installing Sublime Text 3 on RHEL / Fedora
Here’s another three step guide to installing Sublime Text 3 on RHEL 6,7 / Fedora 18, 19, 20:-
- Download the installation script from the following gist.
https://gist.github.com/sayak-sarkar/11b039f398ddcae88139
- Extract it to your home directory [or anywhere you like].
$tar -xvf gist11b039f398ddcae88139-e339084ef22e956ea6ef8d04f8279ca70772f534.tar.gz
- Open your terminal (preferably as super user), navigate to your home directory and execute the shell script.
#./sublime-text-3.sh
Voila!! You now have Sublime Text 3 installed on your machine. You may run it from the terminal or via the alt+f2 shortcut by simply typing in “sublime”.
Based upon my previous post on How to install Sublime Text 3 on Fedora. 😉
Enjoy!! 🙂
Creating scrollable Charts using Angular-Kendo
Creating Scrollable Charts:
Horizontal scrolling of Charts is not supported out of the box in Kendo UI, however it can be achieved using a bit of custom styling.
Basic steps:
- Set
overflow: auto
of the<div class="chart-wrapper">;
- Set width of the aforementioned div;
- Set width of the
<div id="chart">
to a value higher than it’s parent div width size.
Example piece of code:
Template:
<div class="parent-container">
<div kendo-chart k-options="line" class="chart-container">
</div>
</div>
CSS:
.parent-container {
overflow-y: scroll;
width: 1000px;
}
.chart-container {
overflow: auto;
width: 2000px;
}
FOSDEM 2014
Ever since the time I first got involved in the Free and Open Source community I would hear about people’s experiences about FOSDEM [Free and Open Source Developers’ European Meeting]. If you are into Open Source communities, then apparently FOSDEM was the place to be. A few years back when I was nothing more than a wide eyed geek attending events out of curiosity to know what the hoopla was all about, I would at times meet people who would talk about someone that they know off, who had been to FOSDEM and I could not help but wonder about how big a tech event can be so big that people would would compare it to the holy grail of FOSS events.
Fast forward a few years, and I got to have a first hand experience of it and that too from the driver’s seat. Not only did I attend FOSDEM this year, but I was also one of the speakers at the Mozilla Dev-Room. I had a joint talk on “Developing Webapps for Firefox OS – The Efficient & Simplistic Approach” with Robert Kaiser (KaiRo).

Me and KaiRo During Our Talk!
In all, this year, four of us [Me, Priyanka, Soumya and Srikar] were invited as speakers at the Mozilla Dev-Room at FOSDEM from India, and it was also the first one for all of us. Even though all four of us are pretty much veteran FOSS evangelists, yet FOSDEM was something that was pretty new to us. Needless to say, we were excited! It was like we were back to being the curious geeky newbie souls that we were just a few years back. And I must say, we enjoyed every moment of the experience to the fullest.
One of the most striking things for me was the fact that for the first time, in the last couple of years I felt nervous while getting on the stage [which, I’m pretty sure was quite evident in my talk]. However, I’m quite sure that it wasn’t peer pressure, or the number of people looking at me in the room [the room was packed with 350+ of the geekiest people from around the world], I’d guess it was more because of the fact that it was something right out of an adolescent day dream for me. Somehow, however, I enjoyed this feeling all over again. I felt like the ever too curious techie geek from a few years back again.
What I do want mention here is after quite a long time [a couple of years maybe?] I went berserk with swag again. I guess being surrounded by the choicest of official goodies representing all the things that you use in your everyday life does have that effect on one. And, I’m pretty sure I wasn’t alone as well. There were people all around me jumping from one booth to the other with the curious glean in their eyes which can easily compete with that of a bookworm left free in the world’s best library without a care in the world. Knowledge flow was the mantra here, and then of course there were the swags.

Swag galore from FOSDEM
I have to confess, I ended up with a pretty good stockpile of stickers and other similar goodies, thanks to my sudden bout of childishness. But again, who can resist the temptation of picking up a few of the most sought after swags in the Free and Open source communities.
I won’t write much about how my talk went though, I would rather leave it for you to see and understand. For the sake of simplicity, I’m embedding the video recording of my talk along with the slides from FOSDEM here. Do check it out and leave me a note, about what you think of it. [Just remember, I was a bit nervous ;)].
Slides: Developing Webapps for Firefox OS – The Efficient & Simplistic Approach
Video: Developing Webapps for Firefox OS – The Efficient & Simplistic Approach
A special note here for Benoit Leseul: You are one of the nicest and wonderful person that I have ever met. Thanks a lot for taking care of us during FOSDEM! 🙂
Coding Best Practices – With a tinge of CSS!
For the curious: What made me write this post:
A very good friend of mine called me up today and asked me to go through a web portal that their company is developing to gather some feedback about it. When I opened the page I was quite impressed at first site and everything about the visual styling to the page layout frankly looked quite awesome.
Being a web developer myself, I somehow couldn’t resist the urge of opening up the browser’s developer tools to check out code behind it, and this is where the problems started showing up. As soon as the developer tools window pane opened up eating up half of my screen estate, I noticed the page layout completely fall apart. There was a mess of overlapping texts, visual elements, and what not all over the page rendering the site completely useless.
By instinct I ended up opening the style editor of developer tools to check the CSS to find out where things where breaking, however what I saw was nothing but plain horror for any front-end developer . It had to be one of the most messed up style-sheets I have ever seen! Basically it was nothing but a garbled up mess of style definitions for classes, ids, media queries, etc. What made it even more insane was that there was no homogeneity to the way the document was written, no indentations and to top it all the whole site had the most generically confusing class names that one could ever have nightmares of.
So, I called up my friend to congratulate him about having such a gem of a front end guy work on his team, when I came to know about the most sorry part of the whole story. The person who wrote this code was apparently a man who had quite a large number of years worth of “industry experience” and has been doing front end work since before even I knew what HTML/CSS was!
This is what convinced me to go ahead and post a few simple things about things that one should keep in mind while writing code with a bit of an inclination towards CSS.
For the Restless, Here’s what I want to say:
Here are a few best practices that I personally follow that I’d like to share with everyone:-
- Always remember that any code that you write has a high probability of being extended or needing maintenance in the long term. 70% of most maintenance woes can be avoided by keeping this simple fact in mind while writing code.
- As a direct consequence of this, make sure that whatever code that you write is readable even to the most novice coders out there.
- Adopt good variable naming practices [eg. a variable name “count” is always more desirable than a variable name “i” for a counter variable since it’s name gives a good idea about it’s functionality.]
- Try and write self documenting code, with enough [read: not too less, yet not too much] comments describing what a certain block of code does, and how it does that. The best way to make sure that the comments are of the perfect length would be to make sure that the comments for a block of around 5-10 lines of code is never longer than 2 lines [of 80 characters each].
- One of the places which very often make the biggest mistakes in documenting stuff are the CSS files. A CSS file with a spaghetti mixture of ids, classes, etc. is never a good idea.
- Always try to have a proper document structure for the CSS with logical grouping of style definitions, preferably with an index comment at the very beginning. This helps make the code more readable and thus much more easy to maintain and extend in the long run.
- Indentation is your biggest friend – It helps make the code more easily readable as well as create a well-structured document format. Indentation makes it dead simple to understand the flow of logic within the program and separated different logical groups from each other by creating well nested content for the document.
- Lastly, and more importantly before signing off a piece of code as ready for production, be honest to yourself and ask yourself: “Is this the kind of code that I would like to read through and work upon in a few years time when I have forgotten the minutes of the implimentation?”
I sincerely this helps atleast a few people to understand what it is like to write beautiful code and give them a brief idea about how to do so themselves.