How to exclude some files from TypeScript build

If you are using TypeScript nightly (and only with TypeScript 1.6 up) you can use in your tsconfig.json new property exclude which will mostly be used for node_modules like this (more on this here : http://blogs.msdn.com/b/typescript/archive/2015/07/27/introducing-typescript-nightlies.aspx) : [javascript] { "compilerOptions": { "out": "../../built/local/tsc.js", "sourceMap": true…

How to force types in Array with TypeScript’s union types

From TypeScript 1.4 we can do nice stuff with types now, with help of feature called Union Types : https://github.com/Microsoft/TypeScript/wiki/What%27s-new-in-TypeScript#union-types which will let you do also this sweet stuff : You can see this in action on this link : http://www.typescriptlang.org/Playground Sample snippet here :…

How to create simple DTO “object” in PowerShell

Why this sample : I needed simple and short solution for creating custom DTO objects with simple logic for later reuse elsewhere. Function essentialy takes “constructor” argument and returns object with properties that have getters with small piece of logic and are using constructor parameter….

Simple PowerShell snippet to search file or array for content

Since I play these days a lot with PowerShell I need from time to time some simple functionality. Sometimes dead simple. Like today , snippet to search file content or array of data if you will and return true/false if text is present in it….