Monday, 26 May 2014

Add Reindent keyboard shortcut to Sublime-Text 3

I like my code to be always properly formatted, which makes it easier to read and understand. I use Sublime-text for coding and it has Reindent feature which can be found at Edit>>Line>>Reindent ,but everybody wants a keyboard shortcut.

Here is how you can add this shortcut in sublime

Go to Preferences>>Key Bindings - User>>

Now add below key value pair to existing json array (mostly it would be empty previously)

{ "keys": ["ctrl+shift+r"], "command": "reindent"} 

My file contents looks like this

[
    { "keys": ["ctrl+shift+r"], "command": "reindent"} 
]

Instead of ctrl+shift+r you can have any other shortcut you like eg. f12, ctrl+r ...

And remember, To make this shortcut work , you need to have syntax highlighter plugin already installed for the programming language you are using.

Thats it guys. Enjoy the beautiful code.

Monday, 24 February 2014

Accessing Guest (VirtualBox) Node.js Application from Windows/Ubuntu Host

If you are running a Node.js Application inside a Ubuntu VirtualBox machine and want to test the same application in any browser inside your Windows/Ubuntu Host OS, then follow this small tutorial. You can even test the application on any other device in same wifi or lan network as your Host/Guest Machine.
The main reasons I wanted this kind of hack is
  • The Guest machine becomes slow and laggy if you start any browser in it to test your applications.
  • Sometime you just want to use CLI 1.
  • Test the Web Application in mobile or tablet device.
I am explaining here the steps to make it work.

Thursday, 20 February 2014

Test WCF Service with WCF Test Client without installing Visual Studio

There are various tools to test WCF services. Visual studio installation comes with default tool called WCF Test Client, which can be run from Visual Studio Command Prompt by typing wcftestclient. Alternatively for VS 2010 you can navigate to C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\ where you can find and open WcfTestClient.exe



Convert Ember.js online guide using Gimli for PDF generation

There are numerous online sources for learning Ember.js but the best one is their guide on official site. Recently I was learning this framework and headed to the guide page. I just wanted to read it first on my mobile or tablet, But the guide is neither mobile friendly nor any PDFs available. But they have full source of their website on github in Markdown.
 

Sunday, 2 February 2014

Pipo Max M8 Pro: Buying Branded Chinese Android Tablet PC from India

Few months ago I bought a branded Chineese Android Tablet PC from India. The tablet model is Pipo Max M8 Pro. It is a 9.4 inch Android 4.2 device priced very reasonably. I bought it for around ₹18000.

Pipo Max M8 Pro
Pipo Max M8 Pro

Friday, 31 January 2014

Setup for Firefox OS Application Development

HTML5 has been in buzz for last few years. Basically It’s the latest version of HTML. It uses a standard code to create online content. But here I’m not going to describe about HTML5.

Firefox OS Introduction:
This post is about setting up environment for one of the emerging mobile Operating system Firefox OS which uses HTML5 for developing Applications. It was started by Mozilla Foundation and earlier named as Boot to Gecko(B2G).

http://upload.wikimedia.org/wikipedia/commons/4/42/Firefox_OS.png

Firefox is based on linux and over that it uses a layout engine called Gecko. Gecko is the application runtime of Firefox OS. Gecko implements open standards for HTML, CSS, and JavaScript. Firefox OS, powered by Gecko engine, runs only websites in the form of apps, known as web apps.

Tuesday, 28 January 2014

Converting CSV to XML and then to C# Object List

Recently I was working on a project where I had to convert a CSV file to XML.
CSV was generated from a database table. Later that XML has to be converted to C# list and used in the project as setting values.

I'll use a sample csv data here that contains information about few students like their roll number, name and marks in various subjects

Create a C# Console application and add csv file in Resources folder. I'm naming it StudentMarks.csv.