Sunday, August 04, 2013

I, Revolution: OAuth is awesome, OAuth is horrible. [feedly]

OAuth is horrible in terms of being a consumer and a provider.
 
 
Shared via feedly // published on John Sheehan // visit site
I, Revolution: OAuth is awesome, OAuth is horrible.
I, Revolution: OAuth is awesome, OAuth is horrible.:

From my co-founder Frank Stratton:

Photo: Micro Ecosystem by Pierre Pocs

Introduction

After writing the Runscope API, and several OAuth API clients to other services. I've finally had some time to figure out how I feel about OAuth 2.0… OAuth is awesome, OAuth is horrible.

My co-founder John has already written a lot…


Tuesday, July 30, 2013

The Most Popular Pub Names [feedly]

This is what mongodb and big data is perfect for. especially if you are a Brit. Genius.

Cheers!
 
 
Shared via feedly // published on The MongoDB NoSQL Database Blog // visit site
The Most Popular Pub Names

By Ross Lawley, MongoEngine maintainer and Scala Engineer at 10gen

Earlier in the year I gave a talk at MongoDB London about the different aggregation options with MongoDB. The topic recently came up again in conversation at a user group, so I thought it deserved a blog post.

Gathering ideas for the talk

I wanted to give a more interesting aggregation talk than the standard "counting words in text", and as the aggregation framework gained shiny 2dsphere geo support in 2.4, I figured I'd use that. I just needed a topic…

What is top of mind for us Brits?

Two things immediately sprang to mind: weather and beer.

I opted to focus on something close to my heart: beer :) But what to aggregate about beer? Then I remembered an old pub quiz favourite…

What is the most popular pub name in the UK?

I know there is some great open data, including a wealth of information on pubs available from the awesome open street map project. I just need to get at it and happily the Overpass-api provides a simple "xapi" interface for OSM data. All I needed was anything tagged with amenity=pub within in the bounds of the UK and with their xapi interface this is as simple as a wget:

http://www.overpass-api.de/api/xapi?*[amenity=pub][bbox=-10.5,49.78,1.78,59]

Once I had an osm file I used the imposm python library to parse the xml and then convert it to following GeoJSON format:

{    "_id" : 451152,    "amenity" : "pub",    "name" : "The Dignity",    "addr:housenumber" : "363",    "addr:street" : "Regents Park Road",    "addr:city" : "London",    "addr:postcode" : "N3 1DH",    "toilets" : "yes",    "toilets:access" : "customers",    "location" : {        "type" : "Point",        "coordinates" : [-0.1945732, 51.6008172]    }  }

Then it was a case of simply inserting it as a document into MongoDB. I quickly noticed that the data needed a little cleaning, as I was seeing duplicate pub names, for example: "The Red Lion" and "Red Lion". Because I wanted to make a wordle I normalised all the pub names.

If you want to know more about the importing process, the full loading code is available on github: osm2mongo.py

Top pub names

It turns out finding the most popular pub names is very simple with the aggregation framework. Just group by the name and then sum up all the occurrences. To get the top five most popular pub names we sort by the summed value and then limit to 5:

db.pubs.aggregate([    {"$group":       {"_id": "$name",        "value": {"$sum": 1}       }    },    {"$sort": {"value": -1}},    {"$limit": 5}  ]);  
For the whole of the UK this returns:
  1. The Red Lion
  2. The Royal Oak
  3. The Crown
  4. The White Hart
  5. The White Horse

image

Top pub names near you

At MongoDB London I thought that was too easy, so filtered to find the top pub names near the conference and showing off some of the geo functionality that became available in MongoDB 2.4. To limit the result set match and ensure the location is within a 2 mile radius by using $centreSphere. Just provide the coordinates [ , ] and a radius of roughly 2 miles (3959 is approximately the radius of the earth, so divide it by 2):

db.pubs.aggregate([      { "$match" : { "location":                   { "$within":                     { "$centerSphere": [[-0.12, 51.516], 2 / 3959] }}}      },      { "$group" :         { "_id" : "$name",           "value" : { "$sum" : 1 } }      },      { "$sort" : { "value" : -1 } },      { "$limit" : 5 }    ]);  

What about where I live?

At the conference I looked the most popular pub name near the conference. Thats great if you happen to live in the centre of London but what about everyone else in the UK? So for this blog post I decided to update the demo code and make it dynamic based on where you live.

See: pubnames.rosslawley.co.uk

Apologies for those outside the UK - the demo app doesn't have data for the whole world - its surely possible to do.

Cheers

All the code is available in my repo on github including the bson file of the pubs and the wordle code - so fork it and start playing with MongoDB's great geo features!


How to Extend Your Wi-Fi Network With an Old Router [feedly]

Aha. I now know what to do with an old Belkin that's kicking around now
 
 
Shared via feedly // published on Lifehacker // visit site
How to Extend Your Wi-Fi Network With an Old Router

How to Extend Your Wi-Fi Network With an Old Router

When you upgrade to a faster, better router, don't toss your old one. Whether through stock or custom firmware, you can likely turn it into a repeater that can carry your Wi-Fi's signal to the dark corners of your home.

Read more...

    



Make the Most Bacon-y Burger with the Bacon Weave and Other Tricks [feedly]

I'm starving.
 
 
Shared via feedly // published on Lifehacker // visit site
Make the Most Bacon-y Burger with the Bacon Weave and Other Tricks

Make the Most Bacon-y Burger with the Bacon Weave and Other Tricks

If you're going to indulge in a bacon cheeseburger, you might as well go whole hog (sorry for the pun) and get the most bacon flavor out of it. Serious Eats shows us how to do that.

Read more...

    



Lazy loading social buttons and other performance tweaks at work today.

The end result means things are a little faster although I still have lots of optimizations to do. Getting there though!

This is what sharing it out on twitter looks like with opengraph tags etc.:


Monday, July 29, 2013

Only way to leave LinkedIn is to destroy LinkedIn HQ [feedly]

They are keen on sending emails....
 
 
Shared via feedly // published on The Daily Mash // visit site
Only way to leave LinkedIn is to destroy LinkedIn HQ
MEMBERSHIP of networking website LinkedIn can only be terminated by destroying its corporate headquarters, it has emerged. A LinkedIn spokesman said: "People have been emailing us, saying they lost interest in the site immediately after joining and have since attempted to delete their profile several dozen times. "Actually leaving the site is quite simple – [...]

How to Turn Mac Mail Into a Fantastic Email Client [feedly]

I still use sparrow but it's no longer supported and have tried postbox as its cross platform, but the default client isn't too bad and here are some tips to make it better.
 
 
Shared via feedly // published on Lifehacker // visit site
How to Turn Mac Mail Into a Fantastic Email Client

How to Turn Mac Mail Into a Fantastic Email Client

By default, every Mac is loaded up with a copy of Apple's email client, Mail. It's a fine little app, but it lacks a lot of features and settings of other apps. Thankfully, with a few tweaks to the settings and some plugins, you can turn Mail into a pretty powerful little email client—and it's free.

Read more...

    



ImageOptim — make websites and apps load faster (Mac app)

ImageOptim — make websites and apps load faster (Mac app):

"ImageOptim optimizes images — so they take up less disk space and load faster — by finding best compression parameters and by removing unnecessary comments and color profiles. It handles PNG, JPEG and GIF animations. ImageOptim seamlessly integrates best optimisation tools: PNGOUT, Zopfli, Pngcrush, AdvPNG, extended OptiPNG, JpegOptim, jpegrescan, jpegtran, and Gifsicle.

It's excellent for publishing images on the web (easily shrinks images “Saved for Web” in Photoshop) and also useful for making Mac and iPhone/iPad applications smaller (if you configure Xcode)."

'via Blog this'

Getting started · Bootstrap

Bootstrap 3 RC1 has been released and is no longer a twitter project I believe and its focus has moved to mobile first rather than the other way round.

Getting started · Bootstrap:

'via Blog this'

Sunday, July 28, 2013

jehna/VerbalExpressions · GitHub [feedly]

I hate RegEx. Anything to reduce the pain is a plus for me. And there is a C# port too. Great stuff. 
 
Navigated from jehna/VerbalExpressions · GitHub | shared via feedly mobile