TypeScript settings in csproj

These are the settings I put in the csproj file for TypeScript – it sets values to convert to ES5, takes all TypeScript files and compiles to individual JavaScript files in the /Scripts/js directory. From there, I’ll bundle them into a single site.js file inside of wwwroot/js using BunderMinifier.

Reload page in javascript

To reload a page without re-posting, you may have seen something like: location.href = “” + location.href; This doesn’t work if there’s a hash in the URL. Instead, do this: location = location.href.split(“#”)[0]; To reload a page without re-posting, you may have seen something like: This doesn’t work if there’s a hash in the URL. […]

Simple Bootbox message with callback

bootbox.js is a nice simple replacement for alerts. Here’s a quick extension that shows a message by hiding any existing boxes, then showing the new one. Since it’s using Bootstrap’s event-based modals, you have to wait for one to finish loading before closing it or expecting it to be open.

NPM Package Location

Global libraries You can run npm list -g to see where global libraries are installed. On Unix systems they are normally placed in /usr/local/lib/node or /usr/local/lib/node_modules when installed globally. If you set the NODE_PATH environment variable to this path, the modules can be found by node. Windows XP: %USERPROFILE%\Application Data\npm\node_modules Windows 7: %AppData%\npm\node_modules Non-global libraries […]