Pages

Tuesday 19 April 2016

php sqlite3 driver for PDO!

                                             This one is quite easy. Just run the following command in terminal



Monday 18 April 2016

New way to do php development

                              Guys, on windows we all use WAMP(Windows, Apache, Mysql, PHP) software stack, while linux users use LAMP stack. But if you're familiar with python or ruby on rails development. They provide inbuilt server for development.. Like python provides SimpleHTTPServer and ROR provide Webrick .... but we use the old school way of development in php. There is a inbuilt server in php which we can use to increase our productivity.

Just move to the directory via terminal and run the following command


That's it, enjoy!

Saturday 16 April 2016

Python SimpleHTTPServer does not serve SVG! [Solved]

                                                                          I was testing one of my web projects in mobile devices and i encountered this problem that it's not serving svg i generated using adobe illustrator! There is problem in mime types in current SimpleHTTPServer. So i'm posting code for a modified version of python SimpleHTTPServer that serve's SVG images :D



That's it. Enjoy!

EDIT => 26 October 2016

hey guys i was learning nginx webserver and i learned about mime-types there so i thought to add some more information here. MIME basically is shortform of Multi-Purpose Internet Mail Extensions. This is basically a file in nginx which has a list of two column values which contains extensions(pdf, svg, jpeg, png, mp3, mp4) and content-type(application/pdf, image/svg+xml etc ..) so if in the servers mime-types file there is no mentioned extention with content-type then its defaults to content-type: application/octet-stream. So in the above case python SimpleHTTPServer does not has extension svg and corresponding content-type: application/svg+xml in its mime-types file that's why its defaults to content-type: application/octet-stream and instead of rendering in browser it downloads.