Posts

Yo! - I'm a Lambda.

I've just been reading up on the new JavaScript/ECMAScript 6 features and in particular the new fat-arrow syntax for lambdas. It's funny, but whenever I see this syntax () => { } in C# code, my mind always shouts to me "Yo!! - I'm a Lambda". - Okay, I understand that might sound weird... It is weird and I don't know how to stop it! Let me explain! What I mean is, as programmers, when we read code our brain automatically identifies the cryptic string of characters and converts them to a mental model of what the code will do on the fly. For example, when scanning code, if you come across a for or while keyword your brain automatically tells you: "oh... there's a loop coming". If you see an if you automatically know there is a condition and a branch coming. This happens instantaneously without fore-thought. It's like words on a poster. Your mind reads the words even if you're not interested in what the poster is advertising. In fact...

Windows Command Line Goodies

Image
With the news that Microsoft is bringing Bash to Windows (what a crazy world we live in!), it looks like I'm going to add "bash" to my "one more thing to learn" list. In the meantime, I thought it would be good to list the common daily windows cmd.exe tools that I use and find useful. You can't beat the command line for performing fast, repeatable, scriptable actions that you might need to schedule or run ad-hoc. Let's start the list: Get the hostname of the computer you are on If you are like me and can be logged into many remote desktop sessions, then it can be useful to find out the hostname of the computer you are on. To do that, the command is: hostname . This means you will never get caught deleting files from the wrong server again! :) Another simple command is the whoami command which will tell you the user you are logged on as for this session Change the title of the command prompt window Okay, you might laugh, but this is more usefu...

Observations on Software Package Managers

It’s interesting to watch the landscape of software development evolve over time. One of those evolution's is the advent of package managers. As an application developer, having access to a global library of code packages which can be pulled down in an automated way, is such a valuable addition to the development experience. They are everywhere! For example: JavaScript has the NPM C# has got Nuget Python has got Pip Ruby has got RubyGems and Bundler Swift has one built into the build system Go has the "go get" command Java has Maven PHP has Composer Rust has got Cargo built right into the language Package managers are here and they definitely increase productivity by making common code easier to include in your project. When I first uploaded my projects to Github, I mistakenly included all my third party Nuget packages and forgot that one of the other jobs of a package manager is to install/restore missing packages when required. Beautiful… That, is ...

Quick and Easy Analysis of Website AJAX calls using Chrome Net Events

There are times when you need to find out what background "ajax/web endpoint calls" a webpage is making under the covers. As it happens, the other day was one of those times! - I needed to find out which Web Endpoints an internal website was calling over an HTTPS connection. Now, we all know we could use Fiddler or the fantastic Wireshark for analysing network traffic but I didn't have either of these installed on the box I was using. I was just about to install Fiddler when I remembered chrome's internal net events page. Simply open chrome.exe and navigate to: chrome://net-internals/#events . It's like having Fiddler built into the browser. Now, go pack to your web page and perform your action (in my case it was clicking a button). The great thing about this is that it works over SSL/TLS connections which means you don't need to install a SSL certificate to decrypt your traffic. Okay, it's not as powerful as Fiddler or Wireshark , but, if a...

Setting up my Dev Environment for Modern JavaScript Development

Welcome to Client-Side tales from a Server-Side Developer. If your background is server-side development like me, then visiting the land of JavaScript can be quite daunting. Don't get me wrong, I'm not talking about the JavaScript language itself. Whilst the language has recently been updated to ES6 , I'm talking about everything else that comes along with it. Honestly, as an outsider looking in it's like the Cambrian Explosion out there. A soup of different language extensions, frameworks, plug-ins, package managers, task runners, et cetera, et cetera. Where do you start? So Many Questions As I dip my toe into today's JavaScript ecosystem, I want to make sure I'm as forward-leaning as possible. I don't want to be writing JavaScript from 1995! But after spending time reading the interwebs you come away with lots of questions. Questions such as: Do I really need to install Node.js , just to write JavaScript? What's the difference between ...

Coarse Grained CPU-Profiling for Applications using Process Explorer

Image
Today I wanted to quickly graph an applications CPU performance and compare how different start-up flags affected the CPU performance of the application. I didn't want to open perfmon.exe and go through the rigmarole of selecting the correct perf counters yadda-yadda.. I just wanted something quick and dirty.. As we all know, Process Explorer is the swiss-army knife for all things process based. If you need to do any diagnostics on a process then chances are Process Explorer will be able to help in some way. Enter Process Explorer with its "Performance Graph" tab and this quick little tip! With Process Explorer running, go to the process in question and select the "Performance Graph" tab. You will see something like this: This tab displays the "CPU usage" for the process, the "memory usage" and the "disk I/O". All useful information. As an aside, watching to see if the memory usage increases is a basic way to see if your...

To-do or Not-to-do?.. That is the question.

Image
"Note to Self: Remember to write a to-do list" As a full-stack, dev-ops software developer we have to juggle a lot of moving parts. We work on multiple projects with multiple time-frames in addition to looking after servers, performing system-administration and keeping up with the constant changes in the tech landscape. In short, we can have a lot going on at any one time. Who doesn’t love a good to-do list? Over the years I have used everything from pen-and-paper to test driving the latest tools of the moment to try and keep up-to-date and on top of what I need to do. Everyone out there might have their own system, but if there is one thing we can all agree on, its the importance of keeping some kind of to-do list. Choosing what to-do from your to-do list But writing the to-do list is only half the battle. We’ve all been there. You finish collating everything you need to do, and then, inevitably you sit back and think "Gee. Which one of these should I be doing f...