Skip to content

Instantly share code, notes, and snippets.

perki / Fixing HTTPS for localhost - an all-purpose
Last active February 7, 2024 13:33
Fixing HTTPS for localhost - an all-purpose solution

For a WebApp or Backend developers, mixing HTTP & HTTPS while testing a live API from their local environment or the opposite with live webapp connecting to a local backend does usually end with errors such as:

  1. Mixed Content Warning:

"Mixed Content: The page at '' was loaded over HTTPS, but requested an insecure image ''. This content should also be served over HTTPS."

"Loading mixed (insecure) display content '' on a secure page."

perki / realign.js
Created December 12, 2022 16:29
Realign all comments with heading /**
const fs = require('fs');
const path = require('path');
function processFile (filePath) {
const content = fs.readFileSync(filePath, 'utf-8');
const lines = content.split('\n');
let identBy = -1;
let changeCount = 0;
for (let i = 0; i < lines.length; i++) {
const line = lines[i];