Search Results for “”

5 Mac OS X Shortcuts You Need to Know

I love my MacBook, and I'm always looking for new shortcuts to make my everyday experience even more pleasant and productive. Here are five shortcuts you should know.

A Little HtmlHelper for Implementing Adaptive HTML Images in ASP.NET MVC

As part of HTML5, the srcset attribute for img tags has been specified by W3C to provide an HTML extension for adaptive images. Because responsive images are a feature we all should start using today, I want to show you my approach for emitting adaptive img tags in ASP.NET MVC.

Angular 2 and TypeScript

Angular 2 will be built on TypeScript, and the AtScript and TypeScript languages have been converged. Here's my take on this development.

Announcing TypeScript Weekly

I'm excited to announce TypeScript Weekly, a weekly e-mail round-up of news and articles from the TypeScript community.

Better tabindex Handling with Razor

Instead of manually incrementing the tabindex value of several input fields, use a variable in your Razor views to make your life a little easier.

Build 2015: My Favorite Sessions

Here's a compilation of my favorite session recordings from Build 2015. They're all about ASP.NET 5, C# 6, and TypeScript.

Bundling and Minification: an Introduction

This is an introduction to bundling and minification, two techniques which help improve a website's performance by reducing page load time and asset size.

Death to Confusing ECMAScript Version Names

A new version of the ECMAScript standard is being released every year. Let's use the official names to refer to these JavaScript versions and not make up our own.

Design Your Code for Composition

By designing your code for functional composition, you can keep it simple and targeted, making it easier to implement, understand, and test it. More sophisticated logic can be modeled by composing various building blocks of basic functionality — extension methods for collections, in the case of this post.

Detecting Unminifiable Angular Code

Learn how to use theng-strict-di attribute to detect unminifiable Angular code. It puts the dependency injector into strict mode to fail fast and fail early.

Disassembling JavaScript's IIFE Syntax

This post inspects the syntax of an immediately invoked function expression (or IIFE) in JavaScript and presents some variations of it.

ES2015 Destructuring for Assignments

The destructuring syntax introduced by ECMAScript 2015 doesn't have to be used to declare new local variables. Plain assignments are supported, too.

Fun with Custom C# Collection Initializers

The collection initializer syntax of C# is a clean way to initialize a collection with values. The compiler will insert appropriate method calls which actually add those items. We can leverage the convention-based nature of this process to provide our custom collection initializers.

Function Definitions in JavaScript

JavaScript has multiple kinds of function definitions: function declarations, function expressions, and arrow functions. Here's how they differ.

Function Overloads in TypeScript

TypeScript allows us to specify multiple types for the same function. That way, we can accurately describe all possible overloads to the type system.

Implicit Function Chaining in Lodash

Lodash implements implicit function chaining, which allows you to write function chains without calls to _.chain or _.value. This allows for a concise and readable expression of typical map/reduce transformations.

Inline Route Constraints in ASP.NET Core MVC

ASP.NET Core MVC allows developers to specify inline route constraints directly within route templates. Finally, inline route constraints are no longer restricted to attribute routing!

Inlining CSS and JavaScript Bundles with ASP.NET MVC

By inlining small CSS and JavaScript files into the HTML response, you can improve the critical render path of a page. This post shows how to inline bundles created by the System.Web.Optimization framework using ASP.NET MVC.

Introducing the gulp-iife Plugin

The gulp-iife plugin wraps JavaScript code within an anonymous function. It also renders a directive to opt into strict mode.

Let's Talk About JavaScript

This post is an homage to Gary Bernhardt's famous "Wat" talk and explains why the JavaScript engine evaluates the pieces of code shown the way it does.

Lodash and ECMAScript 2015

The popular Lodash library will be even more natural to use with ECMAScript 2015. New language features like pattern matching, array destructuring, and arrow functions allow for writing terse yet readable code.

Matching Digits in .NET Regex

The regular expression pattern \d matches more than just the ten digits commonly used in programming. Here's a list of matches you might not have expected.

Merging Two Gulp Streams

You can use the merge-stream package to combine multiple gulp streams into a single stream that can be returned from a gulp task.

My 8 Favorite ReSharper Shortcuts

ReSharper offers a vast suite of refactoring methods, all of which have their own shortcut. Here's a list of 8 shortcuts I've found to be indispensable.

My Favorite Tech-Related Books

This is a list of some of my favorite tech-related books. I've enjoyed reading all of them, and maybe you will, too.

Numbers and Numeric Types in Swift

The Swift language designers made some interesting choices regarding static typing and numeric types. Read about how working with numbers in Swift differs from other languages.

Open Loops Cause You to Be a Worse Programmer

Trying to hold unfinished tasks and unprocessed thoughts in your head impairs your ability to focus when programming. Instead, you should build your own trusted system.

Parametrized Localization in ASP.NET

ResX files allow you to easily localize an ASP.NET application. I'll show you how I manage resource strings containing placeholders with confidence at compile-time.

Parsing Markdown in .NET

CommonMark.NET is a Markdown parser for .NET that efficiently transforms Markdown written in CommonMark dialect into HTML.

Partially Applying Functions in JavaScript Using Underscore.js

The popular Underscore.js library recently enhanced its capabilities to deal with partially applied functions. Starting with version 1.6.0 which was released in February 2014, the _.partial function is now a lot more flexible and allows for some interesting use cases.

Sharing Line Highlights in GitHub Files

When you share a highlighted range of lines in a GitHub file, those line numbers might be incorrect once the file changes. Here's how to obtain a permalink to the file blob.

Simulating Latency in ASP.NET Core

A simple piece of ASP.NET Core middleware lets you simulate network latency to get a much better feeling for your web application's performance in production.

Stop Cheating the Type System

In C#, every variable of a reference type can hold a null value. Some types like collections and delegates, however, allow for much better default values. Reduce your bug surface area by following reasonable conventions when dealing with null.

String Literal Types in TypeScript

TypeScript 1.8 introduced string literal types, which allow for describing a set of possible string values for a given variable. Here's how to use them.

Switching To the en-US Keyboard Layout

This post summarizes my experience with switching from a German keyboard layout to an American one for programming and software development tasks.

Tag Helpers in ASP.NET Core MVC

Tag helpers are a new feature of ASP.NET MVC 6 which allow for server-side manipulation of HTML elements in Razor views. An introduction.

Tame Your Wild CSS with CSScomb

Sorting CSS properties by name is like sorting books in a library by size. Use a tool like CSScomb to sort the properties by function rather than name and to beautify your stylesheets.

Taming Whitespace with Editorconfig

Editorconfig helps enforce a consistent usage of whitespace within a project. You can specify how to deal with indentation, line endings, trailing whitespace, and more.

Tasty Links #1

This is the first issue of Tasty Links, a list of articles and videos I came across that I found fascinating, helpful, or otherwise interesting.

Tasty Links #2

This is the second issue of Tasty Links, a list of articles and videos I came across that I found fascinating, helpful, or otherwise interesting.

Tasty Links #3

This is the third issue of Tasty Links, a list of articles and videos I came across that I found fascinating, helpful, or otherwise interesting.

Tasty Links #4

This is the 4th issue of Tasty Links, a list of articles and videos I came across that I found fascinating, helpful, or otherwise interesting.

Tasty Links #5

This is the 5th issue of Tasty Links, a list of articles and videos I came across that I found fascinating, helpful, or otherwise interesting.

The && and || Operator in JavaScript

The logical operators && and || have different semantics in JavaScript than in many other programming languages. They don't always return a boolean value!

The Comma Operator in JavaScript

JavaScript defines the comma operator, which evaluates multiple expressions and returns the value of the last one. Here's a real-world usage example for this operator.

The Era of Transpilers

During the next couple of years, we're going to see a growing usage of JavaScript transpilers due to more frequent language updates. It all starts with ECMAScript 2015.

The State of Modern Web Development

Read about how HTML 5, CSS 3, CSS preprocessors, ECMAScript 6, various JavaScript frameworks, and task runners have influenced modern web development.

TypeScript 1.5 Is Released

TypeScript 1.5 has been released and ships with excellent ECMAScript 2015 support. Check out this new version and start using ECMAScript 2015 language features today.

TypeScript 2.0: More Literal Types

TypeScript 2.0 introduces more literal types. In addition to string literal types, we can now declare boolean, numeric, and enum literal types.

TypeScript 2.0: Non-Nullable Types

TypeScript 2.0 adds support for non-nullable types, which help prevent an entire category of nullability errors at compile-time.

TypeScript 2.0: Read-Only Properties

In TypeScript 2.0, the readonly modifier was added to the language. It provides compile-time checking for unintended property assignments.

TypeScript 2.0: Tagged Union Types

TypeScript 2.0 implements tagged union types, a special kind of union types that share a common property. Here's how you can use them in practice.

TypeScript 2.0: The "never" Type

TypeScript 2.0 introduces a new primitive type called "never", the type of values that never occur. It helps model the completion behavior of functions more accurately.

TypeScript 2.1: async/await for ES3/ES5

TypeScript 2.1 adds support for downleveling asynchronous functions to ES3/ES5. That way, you can run your async/await code in every JavaScript engine.

TypeScript 2.1: External Helpers Library

TypeScript 2.1 adds a compiler option for importing helper functions from an external library. The helpers aren't injected into every file, resulting in smaller bundle sizes.

TypeScript 2.1: keyof and Lookup Types

TypeScript 2.1 introduces the keyof operator and lookup types, which help capture even more of JavaScript's dynamic nature in a static type system.

TypeScript 2.1: Mapped Types

TypeScript 2.1 introduced mapped types, a powerful type system feature which allows you to create new types from existing ones by transforming properties.

TypeScript 2.1: Object Rest and Spread

TypeScript 2.1 adds support for object rest and spread. You can work with rest/spread properties in a type-safe manner and downlevel both features to ES3.

TypeScript 2.1: Untyped Imports

TypeScript 2.1 makes it a lot easier to work with untyped imports. Previously an error, these imports are now typed as any and can be consumed painlessly.

TypeScript 2.2: Mixin Classes

TypeScript 2.2 introduced support for statically typed mixin classes. This post briefly explains mixins and shows how to use them in TypeScript.

TypeScript 2.2: The object Type

TypeScript 2.2 introduces a new type called object which represents any non-primitive type. Don't confuse it with the existing Object or {} types!

TypeScript vs. Flow

TypeScript and Flow are similar yet different. Both provide gradual static typing capabilities and other non-standard JavaScript features.

Typing Functions in TypeScript

In TypeScript, there are multiple syntaxes for typing a function: method signatures, function type literals, and object type literals with call or construct signatures.

Use Cases for JavaScript's IIFEs

IIFEs can be used all over the place in typical JavaScript applications. Despite block-scoped variables, the IIFE pattern is not obsolete at all!

Using Integer Document IDs in RavenDB Indexes

If you want to use integers rather than strings for document IDs in RavenDB, you need a little hack in order to get indexes working correctly. Here's what you have to do.

View Components in ASP.NET Core MVC

ASP.NET MVC 6 introduces view components, a powerful mixture of child actions and partial views for building reusable components.

Welcome .NET to the Open Source Space!

Read my thoughts on Microsoft's big announcement of open-sourcing .NET and officially supporting true cross-platform development on Windows, Linux, and Mac.