Elastic Search Bounding Box format as Well-Known Text

There are numerous formats available to pass a geo bounding box to the elastic search API. One of those methods in the bounding box as well-know text or WKT for short. For what ever reason I find string easier to pass and manage in redux state, so I’m using the well-know text. Now I couldn’t find the ordering of the polygon in the string, so here it is:

"filter": {
"geo_bounding_box": {
"pin.location": {
"wkt": "BBOX (-74.1, -71.12, 40.73, 40.01)"
the order of the coordinates is:
right, left, top, bottom (assuming you're looking at a standard map, north at the top, east on the left)
min longitude, max longitude, max latitude, min latitude
west bound, east bound, north bound, south bound

If you find this documented somewhere else please let me know. There are some edge cases I haven’t tested like when a bounding box overlaps the prime meridian and equator. I’ve saved this mostly for my memory and reference, I hope someone else finds it useful. I’ll try to update if I find anything different.

Ted Talks – Beware online “filter bubbles”

An older but interesting Ted talk from Eli Pariser about “filter bubbles” created by customization of things like the Facebook news feed and google search results.

As web companies strive to tailor their services (including news and search results) to our personal tastes, there’s a dangerous unintended consequence: We get trapped in a “filter bubble” and don’t get exposed to information that could challenge or broaden our worldview. Eli Pariser argues powerfully that this will ultimately prove to be bad for us and bad for democracy.

Relevant and food for thought as I’m working on sorting algorithms in my new app.

Adult Networks – A great alternative for Advertising

There is no denying that adult content has been and still is one of the driving forces behind the internet. Porn Hub shows up #38 on the Alexa top 500 sites, pretty impressive when you consider how many competitors there are. With in the past year, some big brands have had great success with campaigns running on Porn Hub, including Diesel Jeans, and Zomato who have a great blog post on it here.

The good news about advertising on porn is there is one main ad network for the big guys, since they are mostly owned by one company, Traffic Junky. Traffic Junky serves 1.8 billion web and mobile ad impressions to 70 million visitors daily. The offer from Traffic Junky is impressive, with excellent targeting, mobile and desktop, video and display, great stats and analytics, and an API for those integrating into existing solutions. That’s impressive, and costs are good, so it’s worth checking out!

Signup for an account with Traffic Junky

Facebook Hashtags – An Introduction

Facebook hashtags started about two weeks ago, but have seen a slow adoption at least among my Likes and Friends, but I think it will just be a matter of time.  I assume you already know how to use hastags from Twitter and other social Media sites so lets make this quick.  Marketers and brands rejoice!  #Hastags are will be the greatest benefit to you, allowing you to connect with fans outside of your page likes!   Sorry users, privacy settings still override your hashtags.

How the Hashtag Works on Facebook

Hashtags turn topics and phrases into clickable links in posts on your timeline or Page.  This helps people find posts about topics they’re interested in.  Making a hashtag is super easy just write # along with a topic or phareas and add it to your post (ex: Awesome Surfing Today! #Tofino).

When your hashtag is clicked, people will see a feed of posts that have been shared with them also using that hashtag.

Good News for Brands

You know all the TV Shows and sporting events were hosts and celebrities are promoting hashtag this and hashtag that?  Well now those campaigns are cross social network and adding the big guy is always a good thing! and this is a big thing .  “Between 88 and 100 million Americans log in to Facebook every night during prime time TV hours, which represents a significant opportunity for broadcasters, advertisers and our other partners,” said Justin Osofsky, director, platform partnerships and operations at Facebook. A recent episode of the Game of Thrones series on HBO generated 1.5 million mentions on Facebook Facebook no doubt saw brands levering the hashtag across different forms of media, flashing on TV shows, in billboard advertising and more.  Facebook has adopted the method in which consumers now communicate with brands.

The hashtag will continue to be a handy system for social networking users to join online conversations as events unfold in real-time, well providing advertisers a way to reach targeted audiences.

Subdomain vs. New Domain or use a subfolder?

When clients want to start a new website or add a blgo/shop to there existing site they often ask if they should use a subdomain or set a new primary domain.  Well there are actually a few options to choose from, a new primary domain, a subfolder,  a subdomain, and a combination of these through the use of redirects.  Let’s me walk you through some of the advantages and disadvantage of each as well as a quick look at the use of redirects.

New Domains / Separate Primary Domains

A new domain can be a powerful thing, and is great for new opportunities and reaching new audiences.  A new domain would be a good option when the credibility can be affected for either the new domain (ie a blog) or the main company domain.  It is also a good choice if there is a different tone or style on the new site.  Value can also be found in smartly linking between the two domains.

We see this used in small to medium sized blogging companies, or publishing companies coming over from the magazine industry. It’s clear why the publish company used this method, it magazines where run different and had different subscribers, so different domains were setup. This is a trend we see disappear with some of the larger online publishers, like msn.com and yahoo.com. Although I think the trend of individual domains for digital publishing will continue due to smaller companies being targeted to a particular niche market. Even when these companies grow and are acquired they maintain the some domains to not loose users.

You might want to use if:

  • Your new website is significantly different
  • Your website needs to be tailored for different countries, for example youtube.ca, youttube.co.uk, etc.
  • You want different branding from your primary domain

Good:  Freedom!  Linking between the two domains.

Bad:  Can take a long time to page rank, can be a confusing message to user.

Popular Examples:

  • youtube.com – the video sharing service from google.
  • gmail.com & hotmail.com – These used to be separate domains but now are redirected to the mail.google/accounts.google.com and login.live.com accordingly. This I believe was done for the reason of branding, and the inclusion of services into the account, like social networking, videos, and other services offered by google and microsoft.com. However microsoft is still a great example, on Microsoft.com they feature the products and software they offer, bing is there search engine, msn.com is there news portal but features a search bar, and live.com is there webmail platform.
  • Ebayinc.com – the corporate site is kept separate from ebay.com, because it has a different look and feel, serves a different purpose and targets a different audience.


A subfolder is almost the complete opposite of using a new domain.  It is integrated into the site, and will be perceived as part of the site.  It is common opinion that the style and layout should remain the same in subfolders.  Search engines will recognize subfolders as part of the site, and will inherent the parents domain page rank relatively quickly.

You might want to use if:

  • It is a section of your website, such as a blog, or shop
  • The layout will remain the same
  • It is often used for categories in news and blogging websites

Never use a subfolder if you want the branding or server side technology to change!

Good: Integrated on the site, one channel, quicker recognition for page rank.

Bad: Hard to use a different layout or tone.  Can be tricky to use a different CMS or server side technology

Popular examples

  • Intel and Jobs at Intel – the primary domain is intel.com while the jobs reside at intle.com/jobs/, the Jobs site offers a different layout and feel from the rest of the Intel site. This is common among large companies job sites and corporate blogs, although they often have the same look and feel, why Intel has a different look and feel i’m not sure, it could be an oversight, or yet to come.


Using a subdomain can be seen as using a mix of both a new domain and a subfolder.  It creates separation from the primary domain, well still carrying some of it branding.  The use of a strong primary domain may make it easier for people to recognize.

You might want to use if:

  • You want keep brand recognition from the primary domain.
  • You are going to use a separate style from the rest of your web site.

Good:  Can use a different layout and technical setup than the primary domain and is somewhat easier to rank.

Bad:  Not as integrated as a subfolder, not as free as a new domain.

Popular Examples:

  • autos.msn.com & weather.msn.comMSN.com uses subdomains for different news areas, autos, to weather and travel. The topics covered are so expansive a subdomain makes it easy for someone who is only wants to find the weather information easy and convenient.
  • Craigslist.org – Craiglist uses subdomains for different regions, like toronto.craigslist.com, boston.craigslist.org etc. this keeps the branding and user interface identical but gives users separation and an easy to remember domain to browse ads for there city or country.

The use of redirects

Lets say you have mycompany.com, but you want to provide a site for customers to buy your products directly from you, you might want to use shop.mycomapny.com or buy-mycompany.com. buy-companyname.com might be easier for users to remember but you want to keep branding consistent, and not have users taken to a new site when they click on a shop menu item on mycompany.com.  So what’s the solution here? Redirects!

you can set up a redirect for buy-mycompany.com to include in marketing materials such as emails, brochures, or on posters, when he users enter the domain in there browser they are taken to shop.mycomany.com. This can also work in the reverse where a subdomain redirect you to a primary domain, but is much less common, and I wouldn’t use it unless you are switching over from subdomain to primary domain, or you’re using a blogging platform like WordPress MultiSite.
Some great examples of this are gmail.com and hotmail.com as previously discussed.


So which method is better?  A new domain, a subfolder or a subdomain?

Well it entirely depends, on the particulars of the project.  If the it is an integral part of your website and has the same tone and layout, use a subfolder.    You’re launching a store, and using a new server side technology like ecommerce software?  My recommendation would be use a subdomain, because the layout would be difficult to match, or you might want a slightly different layout.   Do you want to start blogging about a new topic that wouldn’t interest readers, or launch a site for just corporate clients?  A new primary domain might be the way to go, as it creates a clear distinction, and can have its own look and feel.

Popular Media Queries for Responsive Web Design


I’ve been working on a new design for a personal project (WindsurfPress.com) over the last few weeks and of course the design has to be responsive.  So what solutions do I have?  I could use one of the popular frameworks, or grid layouts.  Alternatively I could build my own responsive design from scratch.

There are a lot of great responsive boiler plates around, and my personal favorite is Bootstrap on GetHub.  It’s even highly customizable  with close to hundred (I didn’t count) components you can select or modify in the download package.  Even with this I still prefer to do things myself, because I find frameworks and boilerplates often bloated with functionality I don’t need, or they can’t quite meet the requirements of my design except with lots of tweaking that usually ends in a headache.

I do feel these frameworks and boilerplates are great things to hack apart, learn from, and use portions of in your designs and code.

The first question you need to ask is what are the common screen sizes to design for?  Well here’s my list and what most of the boilerplates and frameworks are using, and in my opinion the best media queries to use for responsive design.  And there’s only 4 of Them!

Large Display – 1200px and up

/* Large desktop */
@media (min-width: 1200px) { ... }

These are the new standards for desktop browsing, witht he most common resolution 1366×768 23.2% of the global resolution.  With over 60% of total screen resolutions using a display larger than 1200px, some stat counters have this number even higher, W3Schools reports it at over 90% above at 1024 resolution.  This is clearly the new standard, and what I design my default designs in now, and work down from there.

Dated Display – 980px and up

/* Landscape tablet and dated desktop */
@media (min-width: 980px) and (max-width: 1199px) { ... }

Displays with resolution of 1024, the old standard is only 14.7% and steadily falling.  Any smaller than that in desktops and laptops are slim, and a mobile version will be served up for those few, yielding them an excellent viewing experience anyways.

Portrait Tablets – 768px and up

/* Portrait tablet to landscape and desktop */
@media (min-width: 768px) and (max-width: 979px) { ... }

This media query will be what most tablets server up to viewers.  Stats where a bit unclear in this area, but it is a growing segment, and will be served up on older desktops and laptops.

Phone to Tablets – 767px and down

/* Landscape phone to portrait tablet */
@media (max-width: 767px) { ... }

This makes up a market of about 10% of mobile traffic, many small tablets will also use this media query.

Phones – 480px and down

/* Landscape phones and down */
@media (max-width: 480px) { ... }

By far the most popular resolution for smart phones.   About 30% of mobile traffic is below 480px, and a total of 14.5% of total web traffic is mobile.

These statistics are estimates only using data from Gs.Statcounter.com.  I’m not a statistics expert either and some of these numbers have been rounded and approximated by myself.

How to add a Widgetised area in a WordPress theme

In this tutorial I will show you how to add a widget to a theme template file.

Most WordPress themes have widget-ready sidebars, but you may want to display a widget somewhere else in your theme.  For example a home page with three columns of widgets.  If your theme does not have widget areas already set up or you need more then you need to create a new one in your theme files.

Continue reading “How to add a Widgetised area in a WordPress theme”

How 2: Installing WordPress on XAMPP Lite for portable development

Yesterday I wrote a tutorial on Installing XAMPP Lite on USB Flash Drive.  Today I’m going to teach you how to install the popular blogging and CMS platform WordPress.  This is possible because XAMPP Lite already includes MySql and PHP.  If you already installed XAMPP Lite, just follow the procedures below and it should be up and running in no time!




Continue reading “How 2: Installing WordPress on XAMPP Lite for portable development”

How 2: Installing XAMPP Lite on a USB Flash Drive

To really be able to develop for WordPress or another CMS it’s best to have a local web server.  This will save you time in FTPing and editing remote files on your final server.   I used to use WAMP server, although very good, it had some limitations.  I found I was switching between my desktop and laptop, making things unnecessarily complicated.  Than I discovered XAMPP Lite, which I installed on a USB stick, and it works great.  Another simple option is Instant WordPress, I haven`t played around to much, but I think you are much more limited.

Continue reading “How 2: Installing XAMPP Lite on a USB Flash Drive”