Set windows environment variables with in batch script

There could be a situation where we want to add new path to the Path environment variable using batch script. Let’s say you have a directory build/commands and you want to add this path to the Windows Path environment variable.

windows environment path

Let’s then create small batch script setpath.bat which will do few things:

  • be able to execute with UAC privilege elevation
  • read the current directory path so that you don’t have to worry about specifying full path
  • add specified path to the end of PATH configuration
  • check, if at the end of PATH configur[……]

    Read more

Most common mistake software developers make

Eric Elliot sent a tweet with a question: What do you think is the biggest / most common mistake software developers make?. I think it’s worth it to collect them here into one list.

  • technology is not politically neutral
  • underestimating the time something will take
  • deferring technical debt
  • “copy & paste”
  • coming up with patterns, just for the sake of patterns; solving real life problems is what they should do
  • chronically adopting new tools and frameworks, and leaving no time to learn or embrace the fundamentals
  • not testing
  • dev[……]

    Read more

setup-defender.ps1 is not digitally signed while using ember-cli-windows-addon

So, I started playing with EmberJS framework. However, build times on Windows are longer than on Linux or Mac OS X. Much of that penalty is not because of node or ember-cli, but because of Windows services monitoring filesystem. So, I have installed npm package npm install --save-dev ember-cli-windows-addon in order to configure Windows to work effectively with Ember build. Then, to start the automatic configuration, I run ember windows and got error message:

Configuration Error: File C:\Sources\ember\node_modules\ember-cli-windows-addon\no[……]

Read more

Sass and import directives may not be used within control directives or mixins

Currently I am using both Grunt tasks grunt-sass and grunt-contrib-sass to compile sass (strictly scss). The first one is faster than second one, but second one generating source maps that just works. Unfortunately grunt-sass source maps somehow doesn’t work properly and browsers can’t use them.

I got an error message today and I’d like to share simple solution to that. The scss code more or less looks like:

@include example() {
@import 'part1';
@import 'part2';

Above code is compiled fine using grunt-sass, but grunt[......]

Read more

Remove CSS outlines, but keep it for keyboard navigation

I often see outline: 0; or outline: none; in CSS just because we don’t like the ring around actionable elements. Because it’s ugly sometimes and we don’t want to have it in our application / web site. I think this is mostly misunderstanding the mission of that ring. By removing this ring we solving one problem, but in the same time we creating another. I think the trade-off would be removing focus ring for the mouse users only, but not for keyboard navigation.

Let me provide here important cite from W3C about focus ring: Do not use any other[……]

Read more

Using Fiddler to force a web service to support CORS for debugging

There is already nice article about Using Fiddler to force a web service to support CORS for debugging. However, it was written in 2013 and I am going here to little bit update the code for Fiddler v4.5.1.0.

So, you need to add:

public static RulesOption("Force CORS")
var m_ForceCORS: boolean = false;

just at the beginning of class Handlers.

In function static function OnBeforeResponse(oSession: Session) { add:

if (m_ForceCORS && (oSession.oRequest.headers.HTTPMethod == "OPTIONS" || o[......]

Read more

How do I change default editor for git to Notepad++?

At some point I wanted to change default core git editor from Vim to Notepad++. There are couple of solutions how to do that. However, this:

git config --global core.editor "'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin"

works for me on Windows 8.1. By writing this short post here I may save your time in researching.[……]

Read more

How to prevent the screen readers to read any information about the image

This post will be super short. So, you want to prevent screen reader from reading any information about image? To achieve that you need to use aria-hidden="true". Example:

<img src="" alt="" aria-hidden="true" role="presentation"/>


Read more