Angular in Visual Studio

October 08, 2020 angular vs

Now that the Angular Language Service is available for Visual Studio working on Angular projects from inside Visual Studio is a viable option. The linked blog post mentions a couple of ways of adding the Angular project to Visual Studio but I felt the suggestions left something to be desired here is what I came up with.

Read More

Creating a asp.net web app with an Angular frontend

WebShell

We're going to create a what I call a "WebShell" application with asp.net core on the backend and Angular on the frontend.

Read More

Predictable Random Number Generation in TypeScript

Lehmer

August 25, 2020 typescript rng

I got the idea for using this type of RNG from the javidx9 video Procedural Generation: Programming The Universe. It's a really good video as are most of the videos he produces so I recommend you give it a watch. The algorithm he talks about in the video is the Lehmer random number generator.

I'm implementing a simple match the blocks game in TypeScript and I wanted to implement the algorithm mentioned there in TypeScript.

Read More

Creating a tsexec command

August 21, 2020 typscript batch

I want to use TypeScript as a scripting language for my machine and so I want to be able just to execute TypeScript files directly. There are npm packages like ts-node that do this already but I wanted to have a crack at implementing it myself. So this is the batch file I've come up with so far.

Read More

Checking for uncommited git changes in a batch program

July 22, 2020 batch git

Sometimes it's helpful to exit out of a batch script if there are pending changes to a repo. This is done in batch script in a non intuitive way.

@ECHO OFF
PUSHD %~dp0

SET __HAS_CHANGES=0

REM The loop won't be executed if 'git status -s' doesn't produce any output.
FOR /f "tokens=*" %%i IN ('git status -s') DO ( SET __HAS_CHANGES=1 )

REM Check if the loop was executed and goto EXIT if it was.
IF "%__HAS_CHANGES%" NEQ "0" (
    ECHO There are currently uncommitted changes.
    GOTO EXIT
)

REM Do the work you want to do here.

:EXIT
POPD