Lodash defines two functions,
_.merge, for combining properties of multiple objects. Which one should be used for merging settings objects?
Lodash defines two functions,
I recently implemented a sticky header within a
UICollectionView that scrolls both horizontally and vertically. Here's how.
Angular 2 will be built on TypeScript, and the AtScript and TypeScript languages have been converged. Here's my take on this development.
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.
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.
Bundling and minifying a website's scripts and stylesheets reduces page load time and asset size. Here's my project setup for bundling and minifying scripts of an AngularJS application hosted within an ASP.NET MVC site.
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.
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.
This is a list of some of my favorite tech-related books. I've enjoyed reading all of them, and maybe you will, too.
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.
Here are my top 5 blog posts by views in 2014.
I use the Sublime Text editor to write Markdown fairly often. Read about my Sublime setup which includes two excellent packages for additional syntax highlighting.
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.
Learn how to keep your browser console organized by grouping related log messages using modern browsers' debugging tools.
Read on for a description of how I work with Sass files in my ASP.NET MVC applications. This run-down is mainly about organizing, bundling, and minifying stylesheets.
Read my thoughts on Microsoft's big announcement of open-sourcing .NET and officially supporting true cross-platform development on Windows, Linux, and Mac.
Read about why you should use a favicon generator and nest the generated files using a Visual Studio extension to keep your Solution Explorer clean.
The IndentedTextWriter class allows you to output hierarchically structured data while preserving the nesting through indentation. Here's how.
Learn how you can manually bootstrap AngularJS applications and initialize them with asynchronously loaded JSON data.
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.
This post summarizes my experience with switching from a German keyboard layout to an American one for programming and software development tasks.
An operator function in Swift can be passed to a higher-order function like any other. Here are some examples where that comes in handy.
This post summarizes various language features of Swift that allow you to concisely define closure expressions, namely type inference, shorthand argument names, trailing closure syntax, and operator functions.
Swift allows you to define custom operators to extend the language. Read about how to implement a forward pipe operator that passes values through a chain of transformation functions.
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.
Get started with F# by solving math problems from Project Euler. You'll learn about functional programming concepts along the way.
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.
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.
C# defines plenty of modifiers for type and type member declarations, some of which can be combined. Learn about how "protected internal" and "override sealed" work.
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.
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.
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.
.* in a regular expression doesn't yield the results you want. Read about how overly greedy quantifiers account for poor performance and even lead to incorrect matches.
When you're resizing images in .NET, you might get artifacts along the edges of the resized image, which are called ghost borders. Here's how you get rid of them.
Read about a little exception helper class I've written which encapsulates parameter null checking and other validation functionality. By providing a concise and easily readable interface, it helps shorten and declutter your methods.
Starting with the recently released version 4.5.2 of the .NET Framework, ASP.NET now supports the
HostingEnvironment.QueueBackgroundWorkItem method which lets you schedule small background work items. Here's a short write up how you can use it.
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.
The behavior of the .NET regular expression engine can be configured in a variety of ways. Here's a detailed look at all the different regex options.
Many AngularJS applications require initial data on startup. Here's how you can pass server-side C# data from ASP.NET to HTML.
The Enumerable class contains some lesser-known static members. Here's an overview over the Empty, Range, and Repeat methods.
If a database has a different name in production than on development machines, you can configure an alias to use the same name everywhere. Here's how to create such an alias for a SQL Server database instance.
Here's how I use Feedly and Pocket to create a curated reading list from my RSS feed subscriptions and interesting links found while browsing.
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.
The Newtonsoft.Json library allows you to conditionally serialize object properties by looking for a method following a certain naming convention. Here's how that works.
Here is how to synchronize your Visual Studio and ReSharper settings across multiple development machines using Dropbox.
Practice makes perfect, and writing regular expressions is no exception to this. Check out Regex Tuesday for weekly challenges to improve your regex skills.
The FluentSecurity library can resolve its policy violation handlers through a dependency injector such as Ninject, as this example shows.
Pluralsight offers a great course on building ASP.NET MVC applications using EntityFramework and a bunch of modern front-end technologies, such as HTML5, Modernizr, and jQuery.
Check out the free "30 Days to Learn jQuery" course on Tuts+ if you want to take your jQuery skills to the next level.
Let's take a look at how we can use the FluentSecurity library to secure ASP.NET MVC applications in a centralized place.
I've created a NuGet package for my ExtraLINQ project. Go grab it!
When I used the Enumerable.Except extension method, its behavior startled me. It creates a set difference, which might not be what you expected. We'll take a look at how Enumerable.Except is implemented in the .NET Framework.
I've written a library called ExtraLINQ, which provides additional extension methods for working with .NET collections.
ASP.NET MVC ships with the UrlHelper class that makes route URL generation very easy. Read about how to generate absolute URLs instead of relative ones.
If you're running multiple ASP.NET applications on the same the host, their forms authentication cookies need to be uniquely named. Here's how you can set those names.