This worked for me; it might not work for you. Remember I’m just same random guy on the internet so I take no responsibility for anything that happens to your machine. Okay? The Problem As yet (5th Aug 2015) there’s no official support from Apple for Windows 10 running through Boot Camp. So, when I […]
Mushroom, Whisky & Mustard Steak Sauce
Ingredients 6 button mushrooms, sliced 1 clove garlic, crushed 1tbsp olive oil 2tbsp whisky 2tsp wholegrain mustard 120ml/8tbsp double cream salt and pepper Method Heat the oil over a high heat then fry the sliced mushrooms for about 5 minutes or until golden. Reduce the heat and add the crushed garlic, stirring all the time. […]
Mock out Google Maps Geocoder with Jasmine Spies
The Google Maps Geocoder is a handy utility that lets you do this: var geocoder = new google.maps.Geocoder(); geocoder.geocode({ ‘address’: ‘1600 Amphitheatre Parkway, Mountain View, CA 94043′ }, function(results) { // address results of Google HQ }); When writing unit tests though, we don’t really want to be hitting the Google API each time. So […]
Use Script Blackboxing to Skip Third Party Libraries When Debugging JavaScript in Chrome
Sometimes you’ll be debugging some click handler in your code, happily stepping through, only to find yourself suddenly lost in the middle of JQuery’s minified code. From there, it can be a struggle to step back out and resume debugging at the entry point to the library. Wouldn’t it be great if we could just […]
Use PowerShell to Add Some Logic to Your Build Numbers in TeamCity
TeamCity has a bunch of parameters that you can use to change-up your build number if you want to. Want to add the build count? 1.0.%build.counter% How about adding the branch name as well? 1.0.%build.counter%-%teamcity.build.branch% How about truncating the branch name at 20 characters to support Semantic Versioning and excluding the branch name completely if […]
Deploy a Database Project DacPac using OctopusDeploy and PowerShell
In the past, I’ve had to write numerous collections of PowerShell scripts to deploy websites to various development servers. Octopus Deploy takes the pain out of that by providing a slick interface that lets you easily set up environments and get your code out to them. One thing that it doesn’t handle out of the […]
Use PowerShell to Create a Folder in Octopus Deploy
Octopus Deploy has a small but good selection of tasks that you can run as part of a deployment process. If you find yourself wanting to create a folder as part of a deployment (it could be a target for uploaded files, logs etc.) then you can do that quite easily through PowerShell. In this […]
Getting Your Macro on with DOSKEY
I’m a big fan of the command line (much to the mirth of some of my co-workers). I do a lot of stuff through Git, Grunt and the like so I’ve usually got a Cmder window open somewhere. When using Git, there are a bunch of commands that I use frequently so it’s handy to […]
Mocking Angular’s $http Promise return type using only Mocks
Last week, we had a look at Mocking Angular’s $http Promise return type using the $q library. This gives you a great deal of control over when your mock promises are resolved. But, it comes at the cost of requiring both the $q library and manually calling $rootscope.$apply(). If you want to avoid those (and […]
Mocking Angular’s $http Promise return type
The Angular $http service provides an easy way to interact with an API endpoint. If you want to query some data, you can simply do this: var request = $http.get(“/api/items”); request.success(function(data) { console.log(“I have data”, data); }); The request object above is an Angular HTTP promise (ng.IHttpPromise if you’re using TypeScript). While easy enough to […]