Business, Code, and Problem Solving in 14 articles

I recently upgraded this website and turned it into a CMS.

You can find it on github

It has page management, an admin panel where you can change all site settings, and of course -- blog posting.

I wrote the code during the recent AngelHack Hackathon in Seattle.

I've also hosted a working demo you can try yourself.

If you have suggestions for features, tell me in the comments. You can track my progress in the project document I've posted online


If you've been following the JavaScript community during the past few years, you probably noticed a cornucopia of new libraries and frameworks.

There's an NPM package for almost everything you can imagine. Growth is awesome, but if you've examined generations of bacteria evolving over the course of hours then you know the down side.


For every amazing library on NPM there are many more abandoned, half finished, or poorly documented projects. Thus is the nature of growth.

I built this website with a content management system using sails.js in 2014. I used sails.js because it resonated with my development philosophy, but it was still unclear where the framework is going -- if it's going to succeed or fizzle.


Recently I saw Sails.js pop up again. Not once, but twice!

The first time, I was discussing JavaScript frameworks with a friend online. He mentioned that he was actually learning about Sails.js.

My friend didn't have any prior experience with Ruby on Rails, unlike many of the early Sails.js adopters. I never promoted it or discussed it with them either. My friend found the framework organically.

More recently, I noticed Sails.js on Hacker News via a link to a lesson on Platzi.

The public reaction was predictably critical, but in a positive way. When the critics commented, instead of listing reasons to avoid sails.js, they listed what sails needs to do to fill the gap to becoming a production tier framework.

Coming this far in the eye of the public is a great success for the sails.js framework.

Ultimately, that persistence distinguishes a "fly by night" JavaScript framework from a production.

Sails.js isn't there yet, but it's well on the way.


There are many new TOP level domain names being released to the public every month.

I have compiled a spreadsheet of TLD prices on google docs

Why should you care about the new TLDs? For example, lets say you have a new business idea and you want to buy the domain name for the business. Instead of using you might use a clearer, and shorter or among hundreds of generic top level domains.

How do you pick the Best TLD for you?

Conveniently, has categorized the new names based on your company's industry.

Imagine you're a limousine company, among thousands in a given city. What domain name would you choose for you website?

Many limo companies use something like CITY_NAME + "" because when they registered their website in the mid 2000s that's all that was left of the most obvious dot com names.

In 2015, you might still find the lucky or as available options on or various other registrars.

Compared to 2005, you have many more options in 2015.

ICAAN is the organization responsible for permitting new .names -- technically known as generic top level domains. In the past few years they have released an increasing number of new names like .limo, .club, and .website among others.

There are so many new names, that if you try and search for a new TLD domain name on your browser window will slow down after loading all of them.

How do you sort through it all? Beyond topic or category, price is also very important when you chose a new domain.

Some top level domains like .luxury cost around $500 per year from most registrars ($488.88/yr on namecheap when I checked). Others like .best might cost $90 per year ($88.88/yr on namecheap).

Here are a few more expensive TLDs:

name -- price on namecheap

  • .engineer - 129.88

  • .creditcard - 118.88

  • .ceo - 88.88
  • .credit - 78.88

For reference, the average .com name is 10 dollars per year from most domain name registrars -- and that's before using any coupon codes.

Under $10 - Cheapest new gTLDs (generic top level domains)

  • .work 4.88
  • .website 4.88
  • .uk 7.58
  • .rocks 7.88
  • .club 7.88
  • .click 8.88
  • .link 8.88
  • .fr 9.05
  • .audio 9.88
  • .juegos 9.88
  • .pictures 9.88

If you want to see the full list, I made a list of cheapest TLDs on google docs.

Now that you're informed, I wish you Good Luck with your next domain purchase.

Finally, Let me leave you with a parting question: have you recently bought a domain name with one of these new gTLDs? If you have, you ccan share the domain in the comments. If you haven't, then i'd like to know why not.


I have a chrome app that's up to ~1000 weekly users, and i'm not sure if or how to monetize it.


The app is called Extemp Engine, and it's a specially designed news search engine for students participating in one kind of speech competition in the USA.

It's a very niche app that i built originally both as a favor to my high school speech team, and as a vehicle to learning to develop javascript apps. I also used it as a chance to practice some simple SEO techniques and copywriting.

The simple description: it loads a large archive of news articles locally, offline, and makes them easy to search through.

The main pain problem that i saw in the 'industry' was that there were not any usable apps that catered to the pain point of my audience -- in the Extemp speech competition, you are not allowed any form of internet access, all your files must be locally loaded, or in the form of paper.

I built most of the app 3 years ago, and since then i've only done a few bug fixes and scaling fixes since then. (I also used the opportunity to refresh my android app development skills, and i built and Android client for it).

My biggest problem is that I'm not sure how to monetize it without alienating the small following that it already has.

The primary user of the app is a high school student. So if I charged for it, the person paying for it would be either the student, their parents, or the school.

  • Student: does not have a lot of money. might not have a credit card.

  • Parent: not the primary user, so value proposition isn't as obvious to them.

  • School: cash strapped already. requires more involved sales process

The other issue with the app is legality. Google gets around the issue since they primarily serve to link people to content. My Rails app stores all articles in a database in order to make them available to all the chrome clients apps.

If i tried to monetize it, then i'm using other people's news articles for commercial purposes, which doesn't get any better.

I have an list of 114 email addresses of people who have incidentally (un prompted) clicked the 'sign up' link on the website, and I have a google plus group (for alpha testers of the android app) of 10-20 people (i have not checked recently). My website gets about 30 users per day, mostly (90%+) new, and most (75%) from search.

I still have connections to my local school district, so i could promote it via those channels too.

There might be other details i've failed to mention, so if there's some data you'd need to know to give me advice, please ask and i'll post it.

I want to monetize it because i'm hitting hard limits on my mongodb databases (I'm using mongolab). And it's causing API failures. The chrome client itself is also failing to scale with large numbers of articles. (377,000~ articles consume approximately 50GB of my mongo database). It's getting hard for me to justify spending time to fix these issues for an app that isn't generating revenue.

Given the situation, how should i monetize this app?

Thank you for reading


Wufoo is a great tool for easily building forms, but in many cases it's more restrictive than managing your own websites and forms.

On Wufoo, you can't embed any of your own javascript.

Why is this important?

  • No google analytics
  • No visual web optimizer or optimizely
  • No anything that depends on javascript

You need to know which dollars are multiplying fastest; which ad campaigns are driving the most results.

If you use paid advertising, you know that conversion tracking is very important.

Why is this a problem on wufoo (and many sites like it)? Well most advertising systems give you a bunch of javascript to add to your site as a "conversion tracking pixel"

If you want the full simplicity of Wufoo, now you're faced with a challenge.

What's the solution? Noscript and img tags!

If you look closely at the tracking pixel code that Facebook provides, you'll notice a noscript tag at the very end. Inside of that noscript tag is an img tag.

They include it for browsers that block or forbid all javascript, so that your conversions can still be counted.

If you're thinking that you can simply copy and paste their code to your thank you page on wufoo, you're actually partially wrong and partially right.

How To make Facebook Conversion Tracking work on

Remove all the other code in their snippet except for that one img tag.


  • Copy ONLY that code into your Wufoo form's text description.
  • Navigate to your thank you page (to trigger the pixel)
  • Verify your pixel on

Why does this work?

Wufoo forbids script tags, but they DO allow img tags. Facebook's "backup" to their normal javascript system is literally a pixel that tracks conversions. If you look at the src attribute, you can see that it includes all the normal information that's also represented in the javascript code.


If you're writing blog articles with, you might have noticed that images don't look quite-right sometimes.

The solution is to use the "img-responsive" class of twitter bootstrap (included in CMS on Sails by default).

responsive design is a way of designing websites that fit themselves to the screen they're viewed on

For example:


<img src="hello.jpg" class="img-responsive">

instead of

<img src="hello.jpg" width="100">

this will adjust the image automatically to fit the width of the blog's text.

*subscribe at the top to learn how to get the most out of CMS on Sails


If you pull the latest version of CMS on Sails you might notice two prominent new features:

  • Comment Threads
  • Hidden Pages

Both are essential to a great content management system.

Comment Threads

Now you can "reply" to other user's comments. Your new comments are indented below their original comment. Comment threads help authors to have a clearer conversation with their readership.

While linear comments and threaded comments both have merits. Stephanie Booth makes good points against them in her article: "Against Threaded Conversations in Blogs". Linear comments are harder to "off road" with flame wars and encourage conversations focused on the original post. On the other hand, threaded comments encourage more meaningful conversations between your community. Thus, they improve engagement amongst your community.

I personally prefer threaded comments. I'm considering turning this decision, between threaded and linear comments, into a website setting. This way, website owners can decide for themselves. (Let me know in the comments, which you prefer: threaded or linear).

Hidden Pages

In the previous version, every 'page' (not article) you made showed up in the side navigation. There are some cases where this is undesirable, for example: legal pages, squeeze pages, and so on. Ultimately every page is not relevant in every context of your website.

You can hide pages simply by editing and hiding them from the navigation.


Altogether, I'm happy with the progress of this project. It's gotten quite a ways from whence I started.

If you have any other ideas for future features, just let me know in the comments below.


I recently added page management capabilities to this site, making it a fledgeling CMS. I used the same editor that is used by the Ghost blogging platform. You can find the source code on github.

Part of my quest to write a Sails.js based CMS was to find a web based markdown or html editor that would best serve my purposes. I had a few simple criteria in making my decision:

  • Popularity / Community support

Using a popular library means you'll find many other developers in the same boat. If you run into bugs or issues, you're more likely to find help in their issue tracker or on IRC.

  • Simplicity

Easy to set up, easy to maintain, easy to use for the end user. Clean and simple === good.

  • Personal preferences

At the end of the day, I'm going on a gut call. I didn't prepare a fancy report or comparative analysis to decide what I'll use. You should rely on my suggestions either -- try out some editors and choose based on your own experience.

TinyMCE is a WYSYWIG (What you see is what you get) style HTML editor. It's very popular, and used by multiple well known corporations. I found it because it was the first result on Google. There are many plugins and extensions available for TinyMCE which you can easily find online. It's also easy to set up.

Epic Editor

On the downside, it might be too much for your needs. Users on stack overflow complain that it's slow and heavy. It offers many extra features you might not need.

I personally avoided it because it doesn't offer live preview -- meaning you can't see the rendered markup as you type. You have to click a button to see the output every time.

Easiest - EpicEditor

EpicEditor is a markdown based editor. The interface clean and concise, with only two buttons that appear on hover -- a preview button and a full screen mode. The setup process was also easy. You download a JavaScript file and a stylesheet. Note: be attentive as to where you place the dependencies. You may need to configure the editor to point it to their exact locations.

EpicEditor is also customizable. There are several themes written by the community, and the JavaScript comes with a wide variety of different config choices. For myself, I really appreciate good defaults. EpicEditor has good defaults, so its easy on the eyes and works well -- right out of the box.

EpicEditor in Action

At time of writing, I'm still using EpicEditor for the blog post side of the CMS. For simplicity and easier dependency management, I'm going to switch everything to the ghost editor soon.

Personal Favorite - Ghost Editor

Ghost Markdown Editor is a stand-alone version of the editor used by the Ghost Project. Luckily, Ghost is open source, and the code base is released under a very permissive license.

They have a beautiful website and blogging platform. If all I needed was a blog, I'd just run the self hosted version of their system (free). To anybody wanting to run their own blog, I recommend the hosted version of Ghost (5$/month) over anything else. it's very sleek and easy to use.

Ghost Editor

Ghost Editor is my favorite because of the live preview feature. You can see your markup rendered live, right next to where you type. The repository comes with a good example implementation, so getting set up is quite easy. Visually, the editor is definitely above average compared to most WYSIWIG editors).


Nowadays there's a free, JavaScript base editor for every need. TinyMCE, EpicEditor, and Ghost Markdown Editor are three of my favorites.

If there's an editor you prefer over the ones I discussed, let me know in the comments, or contact me about it.


When I began learning Ruby on Rails two years ago, I actively avoided tests, and the topic of testing altogether.

I was eager to see my code "do stuff", and skipped tests, contrary to the suggestions proposed in the holy grail of rails books -- Michael Hartl's Rails Tutorial. Writing extra code that didn't seem to do anything was a very unattractive proposal.

Only after running several production systems, did I truly understand the value of testing. Let me explain that in practical terms:

  • If you find yourself repeatedly running the same commands in rails console, to check if something works ... write a test.

  • If your users discover bugs in systems that used to work fine in the past ... write a test.

  • If your code base is relatively stable, and your features are well defined ... write a test.

Most Rails developers will probably throw a bunch of acronyms and jargon at you to convince you to write tests, but those three reasons I mentioned are all real circumstances that convinced me to write tests.

As far as testings frameworks go, it doesn't matter. You don't need rspec or cucumber, or whatever's fancy right now. Ruby itself ships with tests of the box, and they work fine. (Test::Unit for your reference)

short version: Write tests when it's obvious you need them.


I've just published my first sails.js production app -- this blog!

It has the very basics:

There are still a few things I need to implement in order to make it a real CMS content management system:

  • RSS Feeds / automatic aggregation
  • social buttons
  • page management and creation
  • custom layouts
  • admin pages

Keep a lookout for more posts, daily!


I recently ran in circles trying to figure out why my .sort call wasn't behaving correctly.

Remember, "Sails.js is still in beta", so it's expected to have problems

The specific issue that bit me has to do with how the local disk database adaptor maintains timestamps. "createdAt and updatedAt are not instances of Date"

You'll have a problem when you try to sort a collection by createdAt. You would expect it to sort articles new to old or vice versa. In reality, because the dates are stored as strings, they're sorted as strings -- not dates.

Eventually these kinds of issues will get sorted out, but for now tread carefully when you use new frameworks like Sails.js


I've been tweaking the buttons, shapes and styles of these static pages.

However at that point you're following the trail down a rabbit hole.

Set small, concrete, specific goals for your UI changes.


After a few videos and a couple of tries, I've gotten user authentication working with this blog.

For a brand new framework, it was much easier than I would have thought.

Compared to Rails, the process was only slightly more difficult.

The nice thing about sails.js is that the framework leverages the entire NPM repository of libraries and packages.


I started trying out a fledgeling node.js based MVC framework -- sails.js

It's going well so far, and I've got some basics working, as you can tell.

Once i've finished a decent MVP, i'll post it on github and write a step by step tutorial.