Showing all posts tagged: 'Utility'

A 4-post collection

Create .gitignore and other hidden files on Windows

If you ever needed to create a hidden file (.)filename on Windows then you'll have noticed that it's not particularly intuitive or easy to do. By default, Windows Explorer does not allow you do this in the GUI. Why? No idea! Solution 1 One easy and fast way to create files with a prepending (.) in the name (e.g .gitignore) is to open the Command Prompt and navigate to the directory you need to create your file. Alternatively, if you're already on the desired directory in the Explorer, you can Alt+RighClick and use Open Command Prompt from the context …[read more]


Configure a RunOnce task on Windows

Today was one of these days. Faced with a new problem I've never come across before. I was trying to configure a task to run once and only once on the server was provisioned for the first time. Something like a bootstrap script. In my quest to solve that problem, I came across a thing called Run and RunOnce registry keys! What are Run(Once) registry keys? Who knew that these things even existed, but here we are. So what do these keys really do? Let's grab the definition from the official documentation on MSDN Run and RunOnce registry keys …[read more]


Get URL parameters using JavaScript

This one will be quick and easy. I'm currently working on an Angular.js/MVC application and I need to grab the URL parameters from the current page. Simple right? Well not so much. Firstly, I'm not using ngRoute and, secondly, I don't want to use any other external library/utility. Just plain, old, vanilla JavaScript. How did I do it then? Parsing URLs with JavaScript I've created a simple method to manage this. The method is pretty straightforward. It takes a URL, parses the parameters with a bit of RegEx 'magic' and then returns an object with our parameters. …[read more]


Generate ASCII folder structures on Windows with Tree

I was reading through Adron Hall's post yesterday about generating ASCII trees on Linux and Mac OSx. This is a handy feature if you want to include a project/folder structure to your documentation and don't wish to copy paste screenshots. What is an ASCII tree you may ask? There you go: Say hello to the tree command. This MS-DOS command has been around since Windows XP (YES really) but it's not well advertised. I only found out today and that's 14 years late! This is how to use it: Open your favorite command line editor (I jump between Powershell …[read more]