Posts

today

Filter By:

folder

TypeScript - Interpolated Strings

today

Coming from the .NET world String.Format() was by far my most used function for generating user readable error / log messages. After jumping over to TypeScript, I was bummed to learn that no similar function existed. However, it wasn't so bad, after all console.log() allows us to pass multiple parameters and has no trouble logging them. let foo = { bar: 1 }; console.log("Foo is ", foo); //Prints: Foo is Object { bar : 1 } But this only covers one of the many use cases I used String. Read more...

HTTP Status Codes For a RESTful API

today

Intro Hyper Text Transfer Protocol (HTTP) powers the web. It's the silent work horse used to carry data between servers and clients, and is the reason why all URLs start with HTTP, or HTTPS. For those new to HTTP, it can be though of as clients (users) making requests that are sent to servers which then reply back with responses. Only servers can make responses, and only clients can make requests. Read more...

Cherokee Build - 01/26/19

today
folder Car Builds

I've honestly been very lucky with my Jeep. My previous daily driver was a 2009 Subaru Legacy, and while it may have been excellent in the snow it had a very high cost of ownership. I figured out that it was costing me on average $100 in maintenance per 1000 miles travelled. It may sound silly to have sold the Subaru and bought a Jeep that was 9 years older but I have zero regrets doing so. Read more...

HTTP Cookies

today

What Are They? HTTP cookies are small bits of text that are included with each HTTP request made from a user's web browser to web servers. HTTP is a stateless protocol which means each requests is treated as a unique command, and no state data is maintained. Cookies were designed to fill this gap, and allow servers to associate data with user's as they traverse sites. Cookies are commonly used by sites to hold authentication tokens, tracking ids, or save user preferences. Read more...

TypeScript - Events

today

Intro If you were expecting a phone call from a friend, you (hopefully) wouldn't sit by the phone and continuously pick it up to see if your friend was on the other end. Instead, you'd wait to be notified of an incoming call when the phone started ringing or vibrating. Sitting by the phone and picking it up over and over again is a form of what's known as polling. Read more...

TypeScript - Taking The Magic Out of Magic Strings

today

What's so Magical About Magic Strings? Magic strings are string literals strewn about a code base that apply some kind of limitation to the code. They can be used to filter valid input, constrain parameters, or control the behavior of code. They are often considered an anti-pattern due to how to they introduce the potential for bugs when typos occur, or by the difficulty they create when the need to change a magic string occurs. Read more...

TypeScript - How To Set Up A New Project

today

Summary For beginners TypeScript is like the carrot on the end of the stick, always just out of reach no matter how hard you try. Everyone touts how it's “JavaScript that scales”, and once you use it you'll never go back. But finding a decent tutorial on how to set up a new TypeScript project is quite the challenge. Many tutorials are out-dated and want you to install other packages such as gulp, jump through hoops, or even sacrifice your first born child (okay maybe not but still). Read more...

Software Design - Marker Interfaces

today

What Are They? A marker interface is an empty interface (no methods or properties) that is used to identify classes that implement it belong to a special group. Some might argue that this is a code smell, but in certain situations they can be the best solution for constraining types. It should be noted that the purpose of marker interfaces is a perfect job for the decorator pattern. However, in some languages (C# for example) attributes lack the support we need to implement a quick solution. Read more...

Software Design - Magic Numbers

today

What Are They? Magic numbers are numbers in code that appear to be arbitrary, but actually serve a purpose. They are commonly described as an anti-pattern as they diminish code quality, and are “referred to as breaking one of the oldest rules of programming, dating back to the COBOL, FORTRAN and PL/1 manuals of the 1960s”. [1] However, this does not mean that all constants should be blindly replaced with pre-defined constants. Read more...

Cherokee Build - 10/26/18

today
folder Car Builds

Finishing Up With winter approaching fast, and my Civic only having summer tires I needed to hurry up and finish the Cherokee. The Civic was also suffering from a stuck open thermostat that ensured the engine temperature never reached operating temp, and my heat was always cold. The funny thing is, when I was preparing to drop the B20B engine into the Civic I clearly remember thinking how pointless it would be to replace the thermostat. Read more...