Do you think there is a concept of smart cities? Well there is. Sort of. Engagement Platforms with Web 2.0 With the internet and all the social media buzz in the air, we have truly beein in the grip of a global phenomena. It does not need to affect us globally but rather can have local implications as well. Civic Engagement platforms are the means to realize that and although there are kickstarters for Civic Projects, why not put the responsibility in the hands of the citizens themselves.
Most of the stuff is still under production, more details later Don’t know why but these days I am hooked to Javascript. Perhaps that’s coz I write way too much Javascript these days or maybe the world is really moving to the client side of things. Now I don’t want to go into the details of the holy war of server side vs client side of things. However, I do find that client side stuff is very exciting not to mention that completely open.
The Problem Sometimes we find ourselves wanting to be able to host a webserver to test out some HTML or javascript functionality. For example when Cross Origin Resource Policy (CORS) does not allow running of scripts from outside the domain of the webserver. The Solution The solution is a simple piece of node js script living in the directory. Surprisingly it is way way small javascript Sample NodeJS Script to run server var connect = require('connect'); connect.createServer( connect.static(__dirname) ).listen(8080); This would start listening for a request on port 8080 and then serve the files from the current directory.
Admit it. There are so many times you wish that the localhost-ed version of the application that you are developing in BacboneJS just works. But it doesn’t. And there is only one reason why it doesn’t work. Cross Origin Resource Sharing Yeah, the big culprit is CORS. And here is how you circumvent it. This snippet assumes you are using Sinatra for deploying your Rails API. The Solution options '/*' do response["Access-Control-Allow-Headers"] = "origin, x-requested-with, content-type" end This snippet will add a header to the response that will allow cross-origin javascript coming specifically from localhost to be able to call the server and get a response.
One of the things that new app developers do especially mobile ones, is that they give a step like flow to their users to enter data in a much more streamlined process by breaking it down into a number of steps and then load each one at a different time.
The Problem
Sometimes having different pages of content causes us to think about loading them in a page like fashion. Thus there needs to be a mediator that can take care of the loading based on a few configuration variables.
Hi -
Every post starts with a Hello World. Every code you write starts with Hello World. Then perhaps this should also. I have moved my blog to Github now with the intention of using more and more of Git and ruby for use in my daily life. I can’t comment how much I am going to miss in this or how much I am going to gain, it is just a start and hopefully a start of something really new and tidy.