pragmatic-tips

VSCode: Editor Settings and Shortcuts

17 Jul 2019

VSCode Editor

Pragmatic Tip 22: The editor should be an extension of your hand; make sure your editor is configurable, extensible, and programmable.

cheat-sheet tutorial pragmatic-tips

Pragmatic Tip #22 : Use A Single Editor Well A Sublime Goodbye

17 Jul 2019

VSCode Editor

Pragmatic Tip 22: The editor should be an extension of your hand; make sure your editor is configurable, extensible, and programmable.

As a long time Sublime user, the infrequent updates and missing support for new-ish stuff started to become quite apparent. Like all plugin maintainers have turned to Visual Studio Code.

And so I finally decided to leave Sublime Text 3 behind. Welcome Visual Studio Code, the new goto editor.

cheat-sheet tutorial pragmatic-tips

The itenium Bliki

20 Jun 2019

This is what usually is the very first blog post. With links to some new-old posts, migrated from my 2012 blog.

Personal Reference Bliki

Everyone who has worked with me for a while knows I’m really hyped about the Pragmatic Programmers. My original idea back in 2012 was to blog about their pragmatic tips, but this blog has instead turned into more of a “personal reference bliki”.

pragmatic-tips

Pragmatic Tip 2: Think! About Your Work

2 Dec 2012

Turn off the autopilot and take control. Constantly critique and appraise your work.
— The Pragmatic Programmers

pragmatic-tips

Pragmatic Tip 1: Care About Your Craft

1 Dec 2012

“Why spend your life developing software unless you care about doing it well?”
— The Pragmatic Programmers

Yet Another Blog

Scott Hanselman said “Now, go write, create, commit.”. It took a while but here we are, blogging about “Programming and stuff”. I will be writing about languages and platforms I’m working on or learning about, solutions to problems I’ve struggled with and really any CS related topic I’m otherwise curious about.

pragmatic-tips

powershell

Git-NumberedAdd for PowerShell

30 Aug 2018

After copying file paths from git status output and pasting them after a git add quite a few times by now, I’ve written a small PowerShell script to manipulate the working directory and staging area with fabricated indexes.

git powershell product

Advanced Windows Explorer

22 Apr 2017

A listing of handy but less known shortcuts in Windows Explorer and some Autohotkey examples on how to add extra functionality.

Open Windows Explorer, the most direct way:

Win + E : Open Windows Explorer


autohotkey powershell windows

PowerShell and Git for the colorblind

21 Apr 2017

My PowerShell, Posh-Git and .gitconfig color configuration because of some red-green troubles with the default configurations.

powershell git

Managing Environment Variables with PowerShell

12 Apr 2017

Working with environment variables in Windows is as easy as:

Win + Pause > "Advanced system settings" > "Environment Variables..."

After which you get a tiny, unresizable, form where you can view and manage them. Something better eventually arrived with Windows 10 but still, PowerShell :)

Use Autohotkey to open the window with Left Alt + Pause:

LAlt & Pause::Run % "rundll32 sysdm.cpl,EditEnvironmentVariables"
powershell windows

PowerShell profiles

11 Apr 2017

Reload PowerShell profile

. $profile
powershell windows

Package Manager Console Entity Framework 6 Migrations profile

10 Apr 2017

This tutorial is about adding the following functionality to the Entity Framework Migrations CLI:

  • Execute commands against the project containing the migrations by providing the most likely -Project parameter value
  • Allow updating the database using a numeric TargetMigration (-2 = migrate to the third last migration)
powershell

windows

Advanced Windows Explorer

22 Apr 2017

A listing of handy but less known shortcuts in Windows Explorer and some Autohotkey examples on how to add extra functionality.

Open Windows Explorer, the most direct way:

Win + E : Open Windows Explorer


autohotkey powershell windows

Managing Environment Variables with PowerShell

12 Apr 2017

Working with environment variables in Windows is as easy as:

Win + Pause > "Advanced system settings" > "Environment Variables..."

After which you get a tiny, unresizable, form where you can view and manage them. Something better eventually arrived with Windows 10 but still, PowerShell :)

Use Autohotkey to open the window with Left Alt + Pause:

LAlt & Pause::Run % "rundll32 sysdm.cpl,EditEnvironmentVariables"
powershell windows

PowerShell profiles

11 Apr 2017

Reload PowerShell profile

. $profile
powershell windows

cheat-sheet

VSCode: Editor Settings and Shortcuts

17 Jul 2019

VSCode Editor

Pragmatic Tip 22: The editor should be an extension of your hand; make sure your editor is configurable, extensible, and programmable.

cheat-sheet tutorial pragmatic-tips

Pragmatic Tip #22 : Use A Single Editor Well A Sublime Goodbye

17 Jul 2019

VSCode Editor

Pragmatic Tip 22: The editor should be an extension of your hand; make sure your editor is configurable, extensible, and programmable.

As a long time Sublime user, the infrequent updates and missing support for new-ish stuff started to become quite apparent. Like all plugin maintainers have turned to Visual Studio Code.

And so I finally decided to leave Sublime Text 3 behind. Welcome Visual Studio Code, the new goto editor.

cheat-sheet tutorial pragmatic-tips

.NET Regex Tutorial

19 Apr 2019

Not nearly as confusing as it is in JavaScript.

using System.Text.RegularExpressions;

bool mach = Regex.IsMatch("input", @"\w+", RegexOptions.None);
Match match = Regex.Match("input", @"\w+");
IReadOnlyList<Match> matches = Regex.Matches("input", @"\w+");
string result = Regex.Replace("input", @"(\w+)", "$1");
cheat-sheet regex

Moment.js Tutorial

19 Apr 2019

Moment.js is a mutable wrapper with a fluent interface for the native JavaScript date object (property _d). Use .toDate() to convert back to a JavaScript date.

Dates are interpreted as local time. Unless instantiated with moment.utc().

const now = moment(); // current local time
const a = moment('2016-01-05');
const b = a.clone().add(1, 'week');
b.format('YYYY-MM-DD HH:mm:ss');

moment/moment : Parse, validate, manipulate, and display dates in javascript.

cheat-sheet tutorial

JavaScript RegExp Tutorial

5 Mar 2019

A cheat sheet for the regex syntax in JavaScript.

MDN RegExp Guide

TL&DR

''.test(/^$/);
'ok'.replace(/(.)(.)/g, '$2$1'); // $$, $&, $`, $'

const matchG = 'aaa'.match(/a/g);
matchG == ['a', 'a', 'a'];

const matchNoG = 'str'.match(/(st)r/);
matchNoG == Object.assign(['str', 'st'], {groups: undefined, index: 0, input: 'str'});
matchNoG == /(st)r/.exec('str');
cheat-sheet regex

Array.prototype for .NET developers

24 Feb 2019

The Array.prototype functions have been available for a long time but it’s since Arrow functions that “Linq lambda syntax”-like functionality is available in JavaScript.

This blog post explains the most common functions by comparing them to their C# equivalents.

A basic example:

// JavaScript
const result = [0, 1, 2, 3, null]
    .filter(x => x !== null)
    .map(x => x * 10)
    .sort((a, b) => b - a);

expect(result).toEqual([30, 20, 10, 0]);

// C#
var result = new int?[] {0, 1, 2, 3, null}
    .Where(x => x != null)
    .Select(x => x * 10)
    .OrderByDescending(x => x)
    .ToArray();
cheat-sheet tutorial

Debugging in Visual Studio

24 Feb 2019

Basic Shortcuts

F5 : Start debugging
Control + F5 : Start without debugging
Shift + F5 : Stop debugging
Control + Shift + F5 : Stop, rebuild and start debugging
Control + Alt + P : Attach to process


Control + Alt + Break : Break (Debug > Break All)
F10 : Step over
F11 : Step into
Shift + F11 : Step out
Control + F10 : Run to cursor
Control + Shift + F10 : Set next statement
Alt + Num * : See current statement


tutorial cheat-sheet debugging

Angular Pipes

20 Feb 2019

Pipes: Chainable, declarative display-value transformations to use in your Html.

This post covers:

  • All Builtin Angular pipes (json, async, string, array)
  • How to install different locales (currency, decimal, date, percent)
  • How to generate, implement and test your custom pipes
  • Some examples of custom pipes (ngx-pipes and angular-pipes)

An example:

<!-- This does exactly what you'd think -->
{{ value | uppercase }}
angular cheat-sheet tutorial

Programming Mnemonics

12 Jan 2019

Mnemonics - helping developers remember intrinsics since 1973.

A mnemonic
a system such as a pattern of letters, ideas, or associations which assists in remembering something.

cheat-sheet

Excel formulas cheat sheet

28 Mar 2018

Companion to the EPPlus series, specifically to Part 2: Formulas.
Covering the EPPlus syntax and implemented functions.

excel cheat-sheet

.NET Number and Date Formatting

20 Apr 2017

A cheat sheet with everything there is to know about formatting the primitive types, DateTimes and TimeSpans in .NET.

cheat-sheet

VB.NET vs C# Syntax differences

15 Apr 2017

A cheat sheet outlining the syntax differences between VB.NET and C#. This post is written specifically for advanced C# developers with little to no VB.NET knowledge who need to do some VB.NET coding.

Because some things are just so similar but still confusingly different in VB.NET vs C#…

Along the way we’ll make some amazing discoveries like:

  • There are things VB.NET just can’t do (pointers, …)
  • There are a few cases where VB.NET code is shorter than its C# counterpart (gasp!)
  • VB.NET defaults are not what you might expect from a strongly typed language due to its VB6 legacy (Option Strict, Explicit)
  • There is some VB.NET only stuff that comes in handy from time to time
cheat-sheet

git

Git Hooks with Husky

13 Apr 2019

Avoid pushing changes that break the build with githooks and Husky.

typicode/husky : 🐺 Git hooks made easy

git

Exotic Git Snippets

5 Apr 2019

Some git commands and scripts that come in handy from time to time.

git

Git Assume Unchanged

18 Feb 2019

Ideally one would create a new gitignored file to configure an application to fit his local development environment but when you do have to revert to modifying a committed configuration file, at least there is “git assume unchanged” to avoid committing your changes in these files accidentally.

Assume Unchanged

# Git assume a file
git update-index --assume-unchanged fileName

# And unassume with
git update-index --no-assume-unchanged fileName
git

Git-NumberedAdd for PowerShell

30 Aug 2018

After copying file paths from git status output and pasting them after a git add quite a few times by now, I’ve written a small PowerShell script to manipulate the working directory and staging area with fabricated indexes.

git powershell product

Less for your git pager

18 Aug 2018

A git diff or git log starts the less program. Perhaps not the fanciest tool but more powerful than you might expect.

This post details the arguments that can be passed to less and also how to navigate once less is running. Things not relevant for git are omitted.

Your current configuration:

git config --get core.pager

If this returns nothing, there is room for improvement there!

TL&DR:

Configure something sensible:

# Short version
git config --global core.pager "less -eFiJM~ -j3 --tabs=3"

# Not so short version
git config --global core.pager "less --LONG-PROMPT --tabs=3 --quit-at-eof --quit-if-one-screen --tilde --jump-target=3 --ignore-case --status-column"
h : See all less commands.
git

PowerShell and Git for the colorblind

21 Apr 2017

My PowerShell, Posh-Git and .gitconfig color configuration because of some red-green troubles with the default configurations.

powershell git

autohotkey

Autohotkey Debugging

23 May 2019

If you are like me, you just started writing Authotkey scripts without ever really taking the time to learn the language properly. This blog post contains some scripts and tools to help you try make some sense of what is going on.

autohotkey testing debugging

Autohotkey DynaRun

17 Feb 2019

Run any Autohotkey script on the web with a single.. Autohotkey hotkey.

autohotkey

Autohotkey Use Case: Submitting a Form

31 Jan 2019

A simple Autohotkey use case you can start using in your application right away:
Filling in an entire form with predefined values.

autohotkey

Autohotkey Tutorial - hotkeys

2 May 2018

First we’ll cover the basic Autohotkey hotkey syntax. Which is arguably already pretty confusing for newcomers in and by itself.

But we don’t stop there as after adding more and more hotkeys, it will also become harder and harder to think of new key combinations that are somehow still memorable. There is only so much you can do with the # (Windows) key etc.

Time for some creative hotkey combinations! ‘Advanced Hotkeys’ covers code snippets on how to run different scripts on single, double or triple key presses as well as how to differentiate between long(ish) key presses or mouse clicks. And more…

Example

; Single line hotkey
^#D::MsgBox Pressed Control + Win + D (%A_ThisHotKey%)

; Control + Win + C: Multi line script
^#C::
Run, notepad.exe
WinWait, Untitled - Notepad, , 3
Send, Dear sir,{enter}{enter}
Return
autohotkey

Advanced Windows Explorer

22 Apr 2017

A listing of handy but less known shortcuts in Windows Explorer and some Autohotkey examples on how to add extra functionality.

Open Windows Explorer, the most direct way:

Win + E : Open Windows Explorer


autohotkey powershell windows

excel

Excel formulas cheat sheet

28 Mar 2018

Companion to the EPPlus series, specifically to Part 2: Formulas.
Covering the EPPlus syntax and implemented functions.

excel cheat-sheet

Create Excels with C# and EPPlus: Miscellaneous

2 May 2017

Miscellaneous features

EPPlus can do a whole lot more for you. This post covers some interesting stuff that didn’t really fit anywhere else.

excel tutorial

Create Excels with C# and EPPlus: Import

1 May 2017

IEnumerable objects

Exporting data to an Excel doesn’t get easier than this

using (var package = new ExcelPackage())
{
	var sheet = package.Workbook.Worksheets.Add("IEnumerable");
	var data = new[]
	{
		new {Name = "A", Value = 1},
		new {Name = "B", Value = 2},
		new {Name = "C", Value = 3},
	};
	sheet.Cells["A1"].LoadFromCollection(data);
	sheet.Cells["A1"].SetHeaders("Name", "Value");
	package.SaveAs(new FileInfo(@""));
}
excel tutorial

Create Excels with C# and EPPlus: Formulas & DataValidation

27 Apr 2017

In case your users want to continue working with the Excels after generation.

Not a problem for EPPlus. Instead of calculating values and writing them to an excel, leverage the power of Excel formulas.

excel tutorial

Create Excels with C# and EPPlus: A tutorial

26 Apr 2017

Quick tutorial about creating xlsx Excels with C# and the EPPlus nuget package.

EPPlus Excel addresses are not zero based: The first column is column 1!

Also, before writing any loops, you might want to check out the LoadFromXXX methods. They are explained in depth in part 3 Import.

excel tutorial

tutorial

VSCode: Editor Settings and Shortcuts

17 Jul 2019

VSCode Editor

Pragmatic Tip 22: The editor should be an extension of your hand; make sure your editor is configurable, extensible, and programmable.

cheat-sheet tutorial pragmatic-tips

Pragmatic Tip #22 : Use A Single Editor Well A Sublime Goodbye

17 Jul 2019

VSCode Editor

Pragmatic Tip 22: The editor should be an extension of your hand; make sure your editor is configurable, extensible, and programmable.

As a long time Sublime user, the infrequent updates and missing support for new-ish stuff started to become quite apparent. Like all plugin maintainers have turned to Visual Studio Code.

And so I finally decided to leave Sublime Text 3 behind. Welcome Visual Studio Code, the new goto editor.

cheat-sheet tutorial pragmatic-tips

AVA Tutorial

24 Apr 2019

avajs/ava : 🚀 Testing can be a drag. AVA helps you get it done.


A concurrent test runner from the Andromeda galaxy. If I was to stray from Jasmine then it could only be for a project Sindre Sorhus is working on :) The screenshots on the project site promised extensive assertion failure output with clean stack traces and built-in Promise, async/await, Observable and React component support. So I tried it out and yup, AVA delivered.

Get Started

# Install
npm init ava

# Run tests
npx ava --watch --verbose
testing tutorial

Vue.js Tutorial

19 Apr 2019

vuejs/vue : Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

Why Vue

  • 100k+ ⭐: So many people can’t be wrong
  • Declarative rendering with a cool, terse syntax
  • Low learning curve
  • Reactive and composable view components
  • Optional official vue-router and vuex (statemanagement)
  • @vue/cli: Scaffold project with optional support for TypeScript, PWA, CSS Pre-processors, Linters, Tests, …
  • Automatic dependency tracking
  • Virtual DOM
  • Supports IE9+
tutorial

Moment.js Tutorial

19 Apr 2019

Moment.js is a mutable wrapper with a fluent interface for the native JavaScript date object (property _d). Use .toDate() to convert back to a JavaScript date.

Dates are interpreted as local time. Unless instantiated with moment.utc().

const now = moment(); // current local time
const a = moment('2016-01-05');
const b = a.clone().add(1, 'week');
b.format('YYYY-MM-DD HH:mm:ss');

moment/moment : Parse, validate, manipulate, and display dates in javascript.

cheat-sheet tutorial

Array.prototype for .NET developers

24 Feb 2019

The Array.prototype functions have been available for a long time but it’s since Arrow functions that “Linq lambda syntax”-like functionality is available in JavaScript.

This blog post explains the most common functions by comparing them to their C# equivalents.

A basic example:

// JavaScript
const result = [0, 1, 2, 3, null]
    .filter(x => x !== null)
    .map(x => x * 10)
    .sort((a, b) => b - a);

expect(result).toEqual([30, 20, 10, 0]);

// C#
var result = new int?[] {0, 1, 2, 3, null}
    .Where(x => x != null)
    .Select(x => x * 10)
    .OrderByDescending(x => x)
    .ToArray();
cheat-sheet tutorial

Debugging in Visual Studio

24 Feb 2019

Basic Shortcuts

F5 : Start debugging
Control + F5 : Start without debugging
Shift + F5 : Stop debugging
Control + Shift + F5 : Stop, rebuild and start debugging
Control + Alt + P : Attach to process


Control + Alt + Break : Break (Debug > Break All)
F10 : Step over
F11 : Step into
Shift + F11 : Step out
Control + F10 : Run to cursor
Control + Shift + F10 : Set next statement
Alt + Num * : See current statement


tutorial cheat-sheet debugging

Angular Pipes

20 Feb 2019

Pipes: Chainable, declarative display-value transformations to use in your Html.

This post covers:

  • All Builtin Angular pipes (json, async, string, array)
  • How to install different locales (currency, decimal, date, percent)
  • How to generate, implement and test your custom pipes
  • Some examples of custom pipes (ngx-pipes and angular-pipes)

An example:

<!-- This does exactly what you'd think -->
{{ value | uppercase }}
angular cheat-sheet tutorial

Developing with LocalDb

8 Oct 2018

Tutorial on how to use LocalDb as a lightweight Sql Server substitution for development purposes.

sql tutorial

Yaml tutorial

13 Aug 2018

Everyone happy when the downfall Xml was a fact with the widespread use of Json. Less tags, more data. What’s there not to like. It’s also just so much easier for a human to read.

If it wasn’t so straightforward to parse JSON in the omnipresent JavaScript, Yaml might have had a good chance to take over the world being the most readable data serialization language.

tutorial

NSubstitute Tutorial

12 Aug 2018

The creators of NSubstitute craved a mocking framework with comparable capabilities to the alternatives but with a shorter, more succinct syntax. They have not failed to do so and I loved the NSubstitute syntax right away.

tutorial testing

JavaScript Testing: Jasmine plugins

6 Aug 2017

What would we be without some extra plugins. There are over 1000 Jasmine npm packages and we’ll cover them all here.

tutorial testing

JavaScript Testing: Jasmine customization

5 Aug 2017

Make your Jasmine experience even more luscious with custom matchers and global convenience methods.
Mock global variables in your modules with jasmine.getGlobal().pi = 3.14.

tutorial testing

JavaScript Testing: Jasmine async syntax

31 May 2017

Need to test async code? No problem for Jasmine. There is done() to inform Jasmine a test has finished running.

With jasmine.clock(), the value of new Date() can be manipulated.

Finally instructions on how to configure Babel for async/await in tests.

tutorial testing

JavaScript Testing: Jasmine Spies

30 May 2017

Spies, the Jasmine implementation for mocks featuring spyOn and the new spyOnProperty as well as jasmine.createSpy(Obj) and how to inspect calls made.

tutorial testing

JavaScript Testing: Jasmine syntax

30 May 2017

The basic example contains the general test suite structure and the two most used matchers toBe() (===) and toEqual() (deep compare), followed by all the other matchers that come out of the box.

To finish some helpers for your workflow: how to only have certain tests run and how to exclude tests.

tutorial testing

JavaScript Testing: Getting started with Jasmine

29 May 2017

Probably the most widely used JavaScript testing framework.

This tutorial covers installation, configuration and execution only. For the Jasmine syntax, see parts 2 to 4!

tutorial testing

Create Excels with C# and EPPlus: Miscellaneous

2 May 2017

Miscellaneous features

EPPlus can do a whole lot more for you. This post covers some interesting stuff that didn’t really fit anywhere else.

excel tutorial

Create Excels with C# and EPPlus: Import

1 May 2017

IEnumerable objects

Exporting data to an Excel doesn’t get easier than this

using (var package = new ExcelPackage())
{
	var sheet = package.Workbook.Worksheets.Add("IEnumerable");
	var data = new[]
	{
		new {Name = "A", Value = 1},
		new {Name = "B", Value = 2},
		new {Name = "C", Value = 3},
	};
	sheet.Cells["A1"].LoadFromCollection(data);
	sheet.Cells["A1"].SetHeaders("Name", "Value");
	package.SaveAs(new FileInfo(@""));
}
excel tutorial

NSubstitute vs Moq

30 Apr 2017

Comparing NSubstitute syntax with Moq, probably the most used mocking framework out there at the moment.

moq/moq4

nsubstitute/nsubstitute

tutorial testing

Create Excels with C# and EPPlus: Formulas & DataValidation

27 Apr 2017

In case your users want to continue working with the Excels after generation.

Not a problem for EPPlus. Instead of calculating values and writing them to an excel, leverage the power of Excel formulas.

excel tutorial

Create Excels with C# and EPPlus: A tutorial

26 Apr 2017

Quick tutorial about creating xlsx Excels with C# and the EPPlus nuget package.

EPPlus Excel addresses are not zero based: The first column is column 1!

Also, before writing any loops, you might want to check out the LoadFromXXX methods. They are explained in depth in part 3 Import.

excel tutorial

testing

Autohotkey Debugging

23 May 2019

If you are like me, you just started writing Authotkey scripts without ever really taking the time to learn the language properly. This blog post contains some scripts and tools to help you try make some sense of what is going on.

autohotkey testing debugging

AVA Tutorial

24 Apr 2019

avajs/ava : 🚀 Testing can be a drag. AVA helps you get it done.


A concurrent test runner from the Andromeda galaxy. If I was to stray from Jasmine then it could only be for a project Sindre Sorhus is working on :) The screenshots on the project site promised extensive assertion failure output with clean stack traces and built-in Promise, async/await, Observable and React component support. So I tried it out and yup, AVA delivered.

Get Started

# Install
npm init ava

# Run tests
npx ava --watch --verbose
testing tutorial

NSubstitute Tutorial

12 Aug 2018

The creators of NSubstitute craved a mocking framework with comparable capabilities to the alternatives but with a shorter, more succinct syntax. They have not failed to do so and I loved the NSubstitute syntax right away.

tutorial testing

JavaScript Testing: Jasmine plugins

6 Aug 2017

What would we be without some extra plugins. There are over 1000 Jasmine npm packages and we’ll cover them all here.

tutorial testing

JavaScript Testing: Jasmine customization

5 Aug 2017

Make your Jasmine experience even more luscious with custom matchers and global convenience methods.
Mock global variables in your modules with jasmine.getGlobal().pi = 3.14.

tutorial testing

JavaScript Testing: Jasmine async syntax

31 May 2017

Need to test async code? No problem for Jasmine. There is done() to inform Jasmine a test has finished running.

With jasmine.clock(), the value of new Date() can be manipulated.

Finally instructions on how to configure Babel for async/await in tests.

tutorial testing

JavaScript Testing: Jasmine Spies

30 May 2017

Spies, the Jasmine implementation for mocks featuring spyOn and the new spyOnProperty as well as jasmine.createSpy(Obj) and how to inspect calls made.

tutorial testing

JavaScript Testing: Jasmine syntax

30 May 2017

The basic example contains the general test suite structure and the two most used matchers toBe() (===) and toEqual() (deep compare), followed by all the other matchers that come out of the box.

To finish some helpers for your workflow: how to only have certain tests run and how to exclude tests.

tutorial testing

JavaScript Testing: Getting started with Jasmine

29 May 2017

Probably the most widely used JavaScript testing framework.

This tutorial covers installation, configuration and execution only. For the Jasmine syntax, see parts 2 to 4!

tutorial testing

NSubstitute vs Moq

30 Apr 2017

Comparing NSubstitute syntax with Moq, probably the most used mocking framework out there at the moment.

moq/moq4

nsubstitute/nsubstitute

tutorial testing

product


Git-NumberedAdd for PowerShell

30 Aug 2018

After copying file paths from git status output and pasting them after a git add quite a few times by now, I’ve written a small PowerShell script to manipulate the working directory and staging area with fabricated indexes.

git powershell product

sql

Developing with LocalDb

8 Oct 2018

Tutorial on how to use LocalDb as a lightweight Sql Server substitution for development purposes.

sql tutorial

angular

Angular Pipes

20 Feb 2019

Pipes: Chainable, declarative display-value transformations to use in your Html.

This post covers:

  • All Builtin Angular pipes (json, async, string, array)
  • How to install different locales (currency, decimal, date, percent)
  • How to generate, implement and test your custom pipes
  • Some examples of custom pipes (ngx-pipes and angular-pipes)

An example:

<!-- This does exactly what you'd think -->
{{ value | uppercase }}
angular cheat-sheet tutorial

Angular Road Trip

22 Oct 2018

Today I want to blog about my Angular(2 - 6) experiences the past years.

After 3 years of desktop development I’ve started with Angular 2+ in july 2016, when it was still in beta.

Back then

Back then the landscape was a lot more difficult than it is today.

angular war-story

war-story

DateStart + DateEnd And Their Evil Relatives

19 Jun 2019

ValueObjects

A ramble against objects containing DateStart & DateEnd pairs of properties.

Some of their equally evil relatives:

  • DateStart & TimeSpan or Day/Month only in DateTime, etc.
  • decimal Money & string Currency
  • decimal X/Y and/or Width/Height

This is the case for the ValueObject:

A small simple object, like money or a date
range, whose equality isn’t based on identity.
— Martin Fowler

war-story

Angular Road Trip

22 Oct 2018

Today I want to blog about my Angular(2 - 6) experiences the past years.

After 3 years of desktop development I’ve started with Angular 2+ in july 2016, when it was still in beta.

Back then

Back then the landscape was a lot more difficult than it is today.

angular war-story

debugging

Autohotkey Debugging

23 May 2019

If you are like me, you just started writing Authotkey scripts without ever really taking the time to learn the language properly. This blog post contains some scripts and tools to help you try make some sense of what is going on.

autohotkey testing debugging

Rubber Duck Debugging

27 Feb 2019

Talk to the Duck

When confronted with a problem, don’t ask the person next to you for help right away, he’s probably doing something important as well!

Instead, first tell the duck about it - out loud. If you don’t get to a solution, start explaining your problem in more and more detail until it hits you. If the mere explanation led to a solution, you avoid unwillingly turning your colleague into a CardboardProgrammer.

debugging

Debugging in Visual Studio

24 Feb 2019

Basic Shortcuts

F5 : Start debugging
Control + F5 : Start without debugging
Shift + F5 : Stop debugging
Control + Shift + F5 : Stop, rebuild and start debugging
Control + Alt + P : Attach to process


Control + Alt + Break : Break (Debug > Break All)
F10 : Step over
F11 : Step into
Shift + F11 : Step out
Control + F10 : Run to cursor
Control + Shift + F10 : Set next statement
Alt + Num * : See current statement


tutorial cheat-sheet debugging

meta

Create a new blog post

25 Feb 2019

This is something for me (or anyone else really) because I keep forgetting all this stuff.

  • Use {: .hide-from-excerpt} to do just that.
  • img size must be 360x300. bigimg is 1400x262.
  • A
  • Pragmatic Tips
meta

regex

.NET Regex Tutorial

19 Apr 2019

Not nearly as confusing as it is in JavaScript.

using System.Text.RegularExpressions;

bool mach = Regex.IsMatch("input", @"\w+", RegexOptions.None);
Match match = Regex.Match("input", @"\w+");
IReadOnlyList<Match> matches = Regex.Matches("input", @"\w+");
string result = Regex.Replace("input", @"(\w+)", "$1");
cheat-sheet regex

JavaScript RegExp Tutorial

5 Mar 2019

A cheat sheet for the regex syntax in JavaScript.

MDN RegExp Guide

TL&DR

''.test(/^$/);
'ok'.replace(/(.)(.)/g, '$2$1'); // $$, $&, $`, $'

const matchG = 'aaa'.match(/a/g);
matchG == ['a', 'a', 'a'];

const matchNoG = 'str'.match(/(st)r/);
matchNoG == Object.assign(['str', 'st'], {groups: undefined, index: 0, input: 'str'});
matchNoG == /(st)r/.exec('str');
cheat-sheet regex

tech-talk

fun

Robocode Tutorial

18 Jun 2019

robo-code/robocode : Build the best - destroy the rest!

Robocode is a programming game, where the goal is to develop a robot battle tank to battle against other tanks in Java or .NET. The robot battles are running in real-time and on-screen.

fun

Robocode Installation & Debugging

18 Jun 2019

robo-code/robocode : Build the best - destroy the rest!

Robocode is a programming game, where the goal is to develop a robot battle tank to battle against other tanks in Java or .NET. The robot battles are running in real-time and on-screen.

fun