-
Extension Methods in .NET
Extending the functionality of existing types and classes in .NET is very straightforward with extension methods in .NET. These methods allow you to modify the functionality of a type without modifying the existing type, and are called as if they were a method on the original type. This functionality allows you to add a wide range of comparisons or operations to a method instead of creating functions or externalising methods inside a model or class library.
read more... -
EC2 Instance Metadata
As a user of Amazon Web Services, I am still constantly finding new tools, APIs and features to use within their mammoth system. Because of the huge amount of documentation available, it is difficult to find useful information until I need it for a specific reason. I was looking for a way to make sure that an .exe that I was building could only be run on an EC2 instance, and that’s when I came across EC2 Instance Metadata.
read more... -
Auto-Generate Property In VB.NET
At work back when I was using Visual Studio 2010, I had a macro for VB.NET that would generate properties in VB.NET from a list of private methods with a click of a button, because the VB.NET class property syntax is extremely tedious to write even for classes with a small number of properties. With Visual Studio 2012 macros have been removed so I had to find an alternative or otherwise suffer with copy/pasting or writing the whole thing out!
Luckily I came across an answer on StackOverflow that utilizes code snippets to generate a property in VB.NET including the private variable. You can see the answer here: VB.Net Keyboard Shortcut to auto-generate a Property on StackOverflow. All you need to do is write the word
Property
and hit tab twice, and it will generate something like this:Private _PropName As String Public Property PropName() As String Get Return _PropName End Get Set(ByVal value As String) _PropName = value End Set End Property
-
moment.js
I’m back after a very long hiatus to talk to you about an excellent JavaScript date and time library that I have recently found called momentjs. Messing around with dates and times in JavaScript can be a huge pain with the default functionality of the
read more...Date
object, especially when it comes to parsing and formatting dates in various formats. I used to use the horribly-outdated-and-with-bad-docs-and-consistency date.js, after which moment.js is a breath of fresh air. Moment.js seeks to simplify that entire process by being extremely simple to use; it only has about 10 basic functions in total, which nevertheless are very useful and powerful, especially when developing applications or plugins driven by dates such as calendars. -
Getting It Done
I’ve been a bit lost lately at home. Where I used to be constantly working on personal projects, I’ve found myself more frequently looking aimlessly at huge time sinks like forums and tumblr. I’ve been finding myself lacking the drive to work on personal programming projects even though I know I’ll enjoy it a lot once I get started and I’ll most likely learn some cool stuff from it. I’ve been suffering from a distinct lack of “Getting It Done”, in that I haven’t even done anything on any of my projects, or so much as looked at them in the past month or so. The slump may be from my work life; I’ve recently started to hit my stride as supervisor after being promoted near the end of last year but that has come with tradeoffs.
read more... -
Callback Hell
With the advent of ES6, Promises and the upcoming async/await, callback hell is nowhere near the big deal that it used to be.If you’ve ever written any Javascript that contacts or lives on the server, you’ve probably experienced Callback Hell by now. It is a horrible affliction that Javascript can suffer from as a result of many nested callback functions that are triggered once a request has been completed. Often times, this results in a whole bunch of anonymous functions that make your Javascript nested 2^84 levels deep which causes a lot of messiness and unreadability. There are a few simple ways you can avoid callback hell; you can read about them more in-depth with code examples by following the link but here is a good gist
read more... -
Custom VisualSVN Post-Commit Hook Using Visual Studio
At work we use VisualSVN for our source control needs, which is great. Their SVN server software is really simple and reliable, and the Visual Studio integration is awesome and works like a charm. VisualSVN comes with several predefined scripts that you can attach to your pre- and post-commit and other SVN hooks, but they are quite narrow in scope and not easily customisable. I decided to start searching for a way to make a customisable VisualSVN post-commit hook that I could code myself, and I found that it was much easier than I first anticipated.
read more... -
Using Reserved Words as Identifiers in VB.NET by Theo Gray
I came across a problem at work the other day when the plugin that I was using, jQuery file uploader, required specific properties to be returned to it from the VB.NET object deserialisation when an error occurred. One of these properties was
Error
, which is a reserved language keyword in VB.NET. Ordinarily I would never be using reserved words as identifiers in VB.NET, since you can’t anyway because the compiler doesn’t allow it and it’s usually a very bad idea. But in this case it was either use a reserved keyword or have to modify the plugin source which I wasn’t too keen on doing.I came across this article by Theo Gray that outlined that it was as simple as surrounding the property in square brackets
[]
, much in the same way you can use reserved keywords as column names in MSSQL. This worked great and it was a perfectly simple solution to my problem, but I certainly won’t be making a habit of it! -
Blog Redesign
I've redesigned again since this article, though you may find some of the links helpful.For the past week and a bit I’ve been redesigning martin-brennan.com for a fresh look and feel, and today I’m launching the new design! Let me know what you think on twitter @mjrbrennan or in the comments, or take a bit more time to bask in my new design and read about my process in the article!
read more... -
A Baseline For Frontend Developers by Rebecca Murphey
This article has been around for some time now, but I only recently discovered it. In A Baseline For Frontend Developers, Rebecca outlines some essential skills that one requires to be successful as a frontend web developer in the current climate. What’s particularly interesting is how Rebecca highlights how much things have changed for frontend developers in recent years.
read more...
<< Previous | 9 // 11 | Next >> |
Want to read regular updates? Subscribe via RSS!