Well i missed this announcement from Cloudant

Well i noticed this on my account page with Cloudant:

Cloudant DBaaS price change—the free tier just got free-er!

Big news! We’ve raised the limit of the Cloudant DBaaS multi-tenant free tier from $5 per month to $50 per month. This permanent change begins on January 1, 2015, and will automatically be applied to the accounts of all multi-tenant users.

There will still be no extra charges for secondary index reads and updates, and bulk reads and writes will continue to count as one request.

You can see the details in their changed pricing page.

This is an awesome way to start the 2015. $50 is a lot of http and json flying back and forth. For me it means more room to play.

i <3 Cloudant…

Cloud 9 IDE and hiding secrets

I’ve using Cloud 9 IDE and one thing that has cropped up is the need to hide sensitive information in public work spaces.

If you are unsure of what Cloud 9 IDE is, it’s a browser based Integrated Development Environment. It’s great for things like node apps and it has a few templates for things like Ruby on Rails, Node C/C++, etc… Head over to http://c9.io for more details.

The other great thing is that all projects have a terminal that adds a great deal of flexibility when coding.

I was trying to hide the API key and secret to the data store in one of my Node projects and because the projects on C9 are public workspaces other people can potentially see what you have written in your code.node

The first thing I tried was to add an environment variable from the shell. This did add the variable but for some reason it wasn’t exposed in node through ‘process.env’ and the more i searched the less i found.

Not to be disappointed I looked through my C9 project and I found an area called Run & Debug and in there I was able to create different run profiles. Each of these profiles had an option to add command line arguments. After a bit of reading i found that these arguments are exposed in Node through the ‘process.argv’ array. Not ideal but it works.

C9 Cmd Line Arg

demo image

In this example environment the argument was at index 2 in the array but this may vary in other environments. I did get a friend to log into their Cloud 9 account and see if they could see the run profiles and she couldn’t see it.

I’m not sure if this is the best way to do this and I would love to know if anyone else has found a better way to hide sensitive information in Cloud 9 IDE public work spaces.

Enjoy

Edit – Try to be an optimist

After a bit more reading I found a popular node module called optimist. It hashes the options you pass in the command line. So now you can just pass in whatever key & value into the Cmd Line Args.

Have a look at the examples

Playing with mustache.js

I’ve been playing with CouchApp lately and I like the idea of making single page apps the rely a lot on Ajax and a chatty rather than chunky. I saw mustache.js the other day and decided to use it in my CouchApp.

Mustache.js is the JavaScript implementation of the templating engine Mustache. Its basically logic-less templates, you define a template and as long as the object parsed through the template contains a field in the template then it’s value will get pushed into the result. It’s a little more than that but I try to keep things succinct.

I was rather surprised with it and I really like it. There is this simplicity to it that I really like. You have a model, you define a template, parse both into a function and bam you have yourself an output for data (almost).

I come from an asp.net background and data binding was a staple for me. I would define these data sources and then i would define a grid and then bind the data to the grid columns. Most of the time the standard controls would get you out of trouble but occasionally you would define a custom template the would automagically display what you wanted.

It wasn’t bad but it doesn’t feel as natural as mustache does. I picked this up very quickly and enjoy playing with it. Defining how a list was displayed was just as easy as displaying a single object. In .net land this was 2 separate data bound controls and some server side logic, in mustache it’s much more lean.

What I really like is how you just parse a template and a model through the mustache object. For me this is where you can separate logic, your views are objects that are platform agnostic and your mustache templates are browser specific (Mikito Takada’s single page app put this idea in my head).

I work in an environment where IE6 (don’t hate) is still the standard browser and we often run into the issues towards the end where a simple layout in standards land just looks crap on IE6. I intend to play with this some more and I believe this is going to save us time in the long haul.

If we just push things to the client as models and then have templates that are specific to a client then we should be a lot sweeter… In theory, all things work well in my head. I will test this out and post more on how things go later.

PS
I would say that my organisation is responsible for Australia still being 0.8% on ie6countdown :)

Recording your progress – Evernote

One thing that is becoming more and more clear to me as a developer is planing and reviewing your progress through all the things you find important.

In my spare time I would often just dabble with different toolkits or apps to see what they could do for me. I would configure them a bit more and see what would happen and have some success or failure.

Then I would leave what ever I was doing for a few days or a week or even longer. Coming back to that project would often be a nightmare because you would never if you did or didn’t do something.

It probably doesn’t matter what you are doing, just write it down.

I started to write down everything in docs on my laptop or notes on my ipad. After a while these notes felt disconnected. I would read what I had on my laptop and then need to pry the ipad from my wife to read the rest of what I had recorded.

Then I discovered Evernote. Since then all my notes feel connected. Every little thing I think I need I write down in Evernote and read it later. Ideas, blog posts, shopping lists, webpages, documents, project notes, it all goes in there and then.

When I’m away from a computer and want to share some information then I can share those notes with them. It has really made recording and sharing my progress in anything easier.

I would recommend you try out Evernote and see what you think.

Even if you don’t like the idea behind it, I still think you need to write everything down. No matter how small it is, it will benefit you to write it down and record your progress.