Sometimes you have a file with tens or hundreds of lines of text and you need to wrap each line with double quotes and a comma so that it can be easily put inside a javascript array. This can happen for example if your data is rows in a spreadsheet. Here’s how you can go from a list of lines to a quoted, comma separated list:
Continue reading “Convert lines of text to an array format”How to keep using port 10080 after many browsers block it as an unsafe port
If you have been doing web development using port 10080 you might have run into some issues recently since many browsers including Chrome and Firefox have decided to add that port to their blocked ports list.
I use a tool called InstantWP for WordPress development and it’s using port 10080 for http by default.
I first researched the option to change the ports IWP is using. It seems like it could be done from the config file which you can open from the “Advanced” tab by clicking “Edit Config File”. In the file that opens you should see a setting called PortOffset. I tried to change that but couldn’t get it to work even after trying many different numbers for the port offset.
I also tried to add a flag into Chrome’s startup parameters by right-clicking the Chrome icon and choosing properties. Then I replaced the value under “target” with the following string:
“C:\Program Files (x86)\Google\Chrome\Application\chrome.exe” –explicitly-allowed-ports=10080
However that didn’t seem to fix the situation in my case. I still got the same “unsafe port” error from Chrome.
What finally helped was switching to Firefox and performing these steps:
- Type about:config to the address bar and click on the “accept the risk and continue” button.

Then paste in this string to the search bar:
network.security.ports.banned.override

Choose “string” as the type (I know, number would seem more logical), click on the + button and enter the port number you want to allow (in my case 10080).
Now you should be able to access applications via that port!
How to use Git with InstantWP
If you are using the amazing free InstantWP WordPress development package often, then you might start wondering how to properly use it with Git version control. The difficulty is that trying to add the entire Linux Alpine virtual operating system to Git is too heavy, but adding only the contents of the Theme folder will not keep track of your posts and other database related content. I will outline the steps I used to get Git working with IWP below:
Continue reading “How to use Git with InstantWP”Colorize or tint an SVG image with CSS
This is a quick example of how you can tint an svg image even if it’s added to the page externally (it’s not an inline svg):
Continue reading “Colorize or tint an SVG image with CSS”Increment number when creating multiple html elements using emmet
Sometimes you need to create many elements so that each one of them gets a unique, incrementing number. You probably already know about VS Code’s Emmet capabilities which let you type something like .myClass*5 to automatically create five divs with the class “myClass”. So the output of that would be:
Continue reading “Increment number when creating multiple html elements using emmet”How to create SVG image maps with Inkscape.
Examples of Brackets plus the Emmet extension
Here’s how the Emmet extension for Brackets can really speed up your workflow:
-type #mydiv and hit tab to get <div id=”mydiv”></div>
-type lorem and hit tab to get lorem ipsum text
-type #container>.col-sm-4*3 and hit tab to get
<div id=”container”>
<div class=”col-sm-4″></div>
<div class=”col-sm-4″></div>
<div class=”col-sm-4″></div>
</div>
Copy html from Chrome’s developer tools
This video shows you how to copy html content from the developer tools toolbar in Google Chrome.
How to remove all lines containing a certain character in Notepad++
In this quick video we demonstrate how to fix a situation in which your data contains lines that you need to remove and these lines can be identified by a string of characters. The method is easier than what you might think, since it doesn’t envolve any regular expressions or scripts.
Continue reading “How to remove all lines containing a certain character in Notepad++”
How to quickly add jQuery to your web page
Too lazy to type? Copy my code below:
<!doctype html>
<html>
<head>
<title>jQuery</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="jquery-1.10.2.min.js" type="text/javascript"></script>
</head>
<body>
Click me to test
<script>
$('body').click(function(){
alert('jQuery is working');
});
</script>
</body>
</html>
Continue reading “How to quickly add jQuery to your web page”