Skip to content

Maintaining JS Libs: Changing bower path

javascript · snippets · By Madhurendra Sachan ·

If you are web developer it becomes hard to manage all js libraries if you aren’t using any package manager.
Few folks created bower to make the job easier. (As far as functionality is concerned, it works same as npm, if you have used.)

Steps for installations are just for linux guys – windows people – DIY.

First you need to install npm `sudo apt-get install npm`
You can install it by `sudo npm install -g bower`

Once you have installed bower, You can install a web package, just by executing following command in the directory of project –

`bower install jquery`

You can even use your own git repository as source or any other url

`bower install https://github.com/jquery/jquery.git#2.0.3\`

Above command will install jquery for your project.

Once you have installed it successfully things will be kept in
`bower_components/jquery`
you can refer it by
`bower_components/jquery/dist/jquery.js`. Simple. That’t it ?

No.

if you are like me – possessive about your directory structure – You want everything inside something like `assets/lib/jquery/dist/jquery.js`, or simply want it inside `assets/lib` directory instead of too many file/directory in root.

You can create a file in root of project `.bowerrc`, put following content inside the file
`{
“directory” : “assets/lib”
}
`

Since filename begins with `.` it will be hidden in file browsers, clean.

Again – do you find these long assets path annoying ? – `Grunt` to rescue – check http://bower.io/docs/tools/#grunt

#bower#grunt#web

IOT Push Button (Like Amazon Dash)

Amazon Dash button is an incredible piece of hardware and another example of “applied engineering” in Amazon, just like Kindle. The inspiration for this project isn’t directly derived from amazon dash, I wasn’t aware of it until I started digging the internet but at end, I had to set the performance goal to Amazon dash, because

arduino · linux · server · snippets ·

Adding a display over network !

You are doomed if your laptop has only one HDMI Port & you are running Linux in that box. Unlike windows – where there are tons of easy to run solution, & there are still tons of solutions if you have big numbers in your pocket. Certainly – I neither wish to spend money on external VGA/HDMI

linux · server · snippets ·

Kindle Universal Dashboard

Kindle is Super awesome ! Because of its e-ink display. I wanted a display to present data which has – Least power consumption, Not painful to eyes & obviously one which doesn’t emit blue light. E-Ink displays fit perfectly to my requirement – acquiring a display which can be driven using Raspberry Pi or Arduino is hard,

javascript · linux · server · snippets ·