Author: Alex
-
Quickly add GSuite (Google Apps) MX Records to CloudFlare DNS
As some people know, I run a web development agency called Cohoda LTD. As part of our service, like most development agencies, we offer web hosting. To keep things as lean as possible, we deliberately don’t try to host email servers ourselves, instead we set up clients with email on Google GSuite (or Office 365…
-
South Western Railway rip off customers by charging premium for First Class tube travel
I travel from Farnborugh main to Waterloo reasonably regularly, and it works out cheaper for me to buy monthly season tickets, with a Travel Card (allowing travel on the underground and busses) I was recently looking at how much extra a First Class season ticket would be than Standard Class. Turns out, South Western Railway…
-
Phishing with internationalised domains
While on a train this morning, one of my close friends sent me this WhatsApp message: The person who sent it to me is not usually someone to send out scams or spam, but, to me at least, this message, did not look legit. It smelled strongly of a phishing scam. However, it was a…
-
Search git branch names using command line
Looking for a particular branch, and `git branch -a` returns a LOT of branches? If on Windows, you could use the Search feature in cmder (you’re using cmder, right?) Or on mac, cmd+f and then search the outputted text… OR you could use one of these two approaches: 1) git branch takes a `–list` argument , which in…
-
VS Code “deletes 3 months” of guys work
Recently, someone with the GitHub username eliecerthoms reported an incredibly unfortunate issue with VS Code. It actually stems from his complete misunderstanding of git. A classic case of RTFM
-
Adding additional colour themes to Jetbrains Rider
color-themes.com according to it’s description, offers “Color themes for IntelliJ IDEA, Webstorm, PyCharm, RubyMine, PhpStorm and AppCode” However, it turns out that these themes also work with Rider. After downloading it (it’s a .jar file) go to File > Import Settings Choose the downloaded .jar file, and it will import the colour theme. Once Rider…
-
An Introduction to the LEDS Stack
Full blog post is coming soon. For now, please see GitHub repository for demo project: https://github.com/alexjamesbrown/LEDS_Stack Talk slides at: http://bit.ly/leds_stack_slides
-
Azure function not receiving json messages using Topic Service Bus Trigger
While developing an Azure Function application, using this tutorial, I encountered a problem. Ultimately, using `func new` generated my function (the run.csx file) which looked like this: public static void Run(string mySbMsg, TraceWriter log) { log.Info($”C# ServiceBus topic trigger function processed message: {mySbMsg}”); } Side note: the `mySbMsg` is important – it’s defined in the…
-
Asserting multiple properties of argument with FakeItEasy
More often than not, I want to assert that my dependency has been called with a parameter that matches more than one condition. Let’s say we have a method that calls ICustomerService.Add method. We want to assert the Add method was called with a Customer that matches a few conditions. The way we’d typically achieve…
-
Physical 419 Letter Received
Last night I opened an innocuous looking letter delivered to my home address. It had a ‘commercial’ postage stamp on it (not one that you’d pick up in the post office) and it wasn’t addressed to anybody on the envelope. The content of the letter was what I’d expect to get via email – a…
-
Microsoft SQL Server on a Ubuntu Linux VM
As part of a blog post on the LEDS stack (Linux Nginx Dotnet, SQL Server) I’m putting together, I wanted to see how easy it is to install SQL Server on a Ubuntu VM, running on Digital Ocean. Turns out, very easy. I went with a Ubuntu 16.04.2 x64 box, with 4GB of RAM The…
-
Using different themes across Visual Studio versions
I’m currently working on a couple of solutions – one that is Visual Studio 2017 specific, one 2015. Primarily because the 2017 specific one is full of .net standard projects, and the support is better (or at least, built in) I wanted to have 2015 use a different theme – I’m only doing small bits…
-
Lack of Godaddy email support prompts me to move
I’ve been a customer of GoDaddy for several years. Recently, I’ve required to use their support service. Unusually, they don’t offer email support – just phone, or live-chat On more than one occasion, live-chat has been unavailable, and making a call hasn’t been convenient. Secondly, live-chat only works with a persistent connection. Working on a…
-
Clearing Chrome Internal DNS cache
Visiting a url, but getting the (old dns) version of a page? I was too. Turns out that Chrome keeps an internal DNS cache. You can view it by visiting the following ‘url’ (enter this in your address bar in Chrome) chrome://net-internals/#dns
-
Out Of Memory exception when deserializing with JSON.net – Use Streams instead
Calling an api and deserializing the returned json into a type is something I have to do quite often. I used to use the following: //assume client is an instance of HttpClient – this part isn’t important var response = await client.PostAsync(url, content); //read the response as a string var responseString = await response.Content.ReadAsStringAsync(); //use…
-
Search for a branch with git
Got a load of branches? Need to find a specific one? Try this git branch –all | grep <query> for example git branch –all | grep notifications Will return all branches (remote or local) that contain “notifications” in the name of the branch
-
PleaseDoNotNameYourTestCasesLikeThis
I’ve delivered this as a lightening talk a couple of times at companies I’ve consulted at, but thought I’d knock out a suitably short blog post. A lot of test cases I come across are named like this WhenSomethingHappensThenSomethingShouldOccur While the writing of a test in the first place should be applauded, naming them like…
-
Mocking calls to ApplicationContext.Current.Services
My current contract involves working on a project based on Umbraco. Unit testing Umbraco, can be a bit tricky, especially given the existence of the static ApplicationContext.Current.Services class, which contains handy references to the Umbraco services – provided by a static type! We can’t mock this. So, I created a little wrapper around this that…
-
Launching cohoda.com – the commercial website to our Camberley based web design and software development consultancy
Today I launched our commercial website – https://www.cohoda.com Cohoda is a Camberley based web design agency and software consultancy. I’ve been contracting through Cohoda LTD since I made the leap into being self employed in 2012, but have only just got round to creating our own website. It’s a bit sparse at the moment but I’ll…
-
TempData not cleared between requests when using ContainsKey
Recently I was trying to add a simple message to the top of the screen if the user had been logged out. This message, should appear only once. If the user navigates away from the page, it shouldn’t show again. So, it made sense to use TempData In my controller, I had something like this:…
-
Entity Framework migrations – names are case sensitive
In a rush, I’d called my migration “vendorServiceKEy” Which had resulted in my migration being named 201512102031458_vendorServiceKEy I then ran migrations with update-database. Now, when I renamed the class manually, to sort out my OCD, the next time my application ran, I got There is already an object named xxx in the database My _MigrationHistory table contained…
-
Could not load file or assemebly ‘ceTe.DynamicPDF.Rasterizer.40.x86.dll’
I ran into this issue when deploying an application that uses the DynamicPDF Rasterizer. After emailing support, who got back to me within the promised 24 hours, they offered some good suggestions. The solution for me was to use the installer provided on their download page, which in turn installs the pre-requisites (Visual C++ distributable)…
-
Dynamic routes with ASP.net MVC – Category/Location mapping to controller
I’ve recently been looking in to building a directory type application with Asp.Net MVC One of the requirements would be to have SEO friendly URLs such as: http://www.mysite.com/restaurants/Camberley—Surrey /restaurants being the “Category” /Camberley—Surrey being the “Location” So, I created a ‘CategoryController’ like this public class CategoryController : Controller { public ActionResult Index(string category, string location)…
-
Google Only authentication with ASP.net Identity
Recently I was working on a project where by I needed to authenticate out users against their Google apps login. That is to say, the on authentication method would be Google. And only ever Google. If they were signed in to their Google account, they would be signed into our app. Most of the examples…
-
My Invisalign Before / After expected results from clinical check
After re-doing my impressions due to my wide arch, the results of my clinical check are in. Here’s the expected before/after Before: After I’ll have the trays for approximately 7 months (14 trays in total) As expected, will need attachnemtns, or ‘buttons’ on a few of my teeth – unavoidable really given the crookedness…