How to publish on Github Pages with create-react-app and react-router

Now I will be assuming a couple of things: You have a GitHub account and you created a repository for your app. You created a react app either with `npx create-react-app <appName>` or `npx create-react-app <appName> –scripts-version=react-scripts-ts` Then let’s get started. Add gh-pages Run npm i -D gh-pages Configure your package.json First, …

CodeWars: 6kyu – Counting Bits

Problem: You got numbers, you want to know how many bits are flipped to a 1 https://www.codewars.com/kata/bit-counting/train/python Approach: Well, first we need to convert our number from an integer to a binary number. There are two ways to do this: # Variant 1: String Formatting “{:b}.format(number)” # Variant 2: Build …

Codewars: Sum Of Pairs

Problem: * Given a list of integers and a single sum value, return the first two values (parse from the left please) in order of appearance that add up to form the sum. Source: https://www.codewars.com/kata/sum-of-pairs The initial problem does seem quite simple: Iterate over the array Check for every item …

NPM: windows-build-tools

node-gyp is really useful and annoying. npm install fails if Python 2.7 and a C# Compiler is missing. You could use choco to get and install the missing packages or simply install another npm package: [code lang=bash] npm -g windows-build-tools [/code] will install Phyton 2.7 and the Visual Studio Build …