Quick pro tip - Open File in Sublime from Visual Studio
Tuesday, April 17, 2012 4:58:45 PM (GMT Daylight Time, UTC+01:00)
This is one of those really simple little gems that helps productivity ten-fold. Firstly, regardless of whether you're running a PC, Mac or Linux, if you've not already come across Sublime Text 2 you should go download it right now.
There are a ton of amazing features in Sublime (enough to warrant an talk by Dan Kendall no less), some of them are available in Visual Studio but none are quite as rich. Things like the multi-selection/multi-cursor feature are just awesome for quickly making the same changes in multiple places, not to mention the "select this word throughout the document" shortcut which has saved me hours already.
So what's my quick tip?
Rather than copying/pasting the path in the open dialog each time you want to edit the file, Dan pointed out to me the other day that you can easily wire it up as an external tool and then add a shortcut so you can open the current file in a flash.
Here's a step-by-step guide:
Optional Additional Enhancement
You can wire up a keyboard shortcut for extra speed, again under the "Tools" menu, go to "Options" and then "Keyboard" (under "Environment"):
Thanks Dan for the heads up on this one.
How to generate customer purchase cohorts from uCommerce data
Friday, April 06, 2012 10:02:29 AM (GMT Daylight Time, UTC+01:00)
I've had a couple of people ask how they can create customer purchase cohorts from their uCommerce data since my last post so here's a quick script.
Depending on how you've setup your uCommerce store, the customer ids might be different so instead of using customer id. I would use the email address of the customer personally as the identifier as this means you'll be able to analyse those customers who have chosen to check out anonymously
Here's the SQL to output the data in a format suitable for www.quickcohort.com.
WITH Actions (FirstAction, LastAction, UniqueId)
SELECT min(dateadd(dd, datediff(dd, 0, o.CompletedDate), 0))
, max(dateadd(dd, datediff(dd, 0, o.CompletedDate), 0))
FROM [uCommerce_PurchaseOrder] o LEFT JOIN uCommerce_Customer cc ON cc.CustomerId = o.CustomerId
GROUP BY ltrim(rtrim(LOWER(cc.EmailAddress)))
, count(a.[UniqueId]) AS [CountOfCustomers]
GROUP BY a.[FirstAction]
min(dateadd(dd, datediff(dd, 0, a.[FirstAction]), 0)) IS NOT NULL
ORDER BY a.[FirstAction]
Not using uCommerce as your e-commerce provider? Let me know and I'll knock up a script for you.