There are two modes for development: Single Page Applications, Multi Page Applications Build Workflow Dependency Management Tool: npm or yarn Use Bundler: Webpack Compiler: Babel + Presets Use Development Server (Docker preferrably) Single Page Applications (SPA) For React 16, I like to scaffold a new project using the create-react-app CLI: npm install -g create-react-app Multiple […]
Monthly Archives: October 2017
I’ve recently switched back to using NPM from Yarn as my default package manager due to Angular project problems. The following two commands will let you switch between Yarn and NPM: # Switch to Yarn ng set –global packageManager=yarn # Switch to NPM ng set –global packageManager=npm The main reason that I had to switch […]
Gravatar requires the usage of MD5 hasing when it comes to pulling images from their website. To accomplish this, I’ve implemented several MD5 plugins from different authors. The plugin that integrated nicely (with no console errors) was JavaScript MD5. To implement this on an Angular Component/Service: import { Component } from ‘@angular/core’; var md5 = […]
Google PageSpeed Insights is giving me one of the criterias that requires some work: Leverage browser caching I’m using Amazon S3 + CloudFront to serve my static assets. To set the HTTP headers for Cache-Control, I used an application on Windows called “CloudBerry Explorer for Amazon S3”. The application lets me manage many different types […]
I find myself updating Angular a lot (I’m currently on 4). One of the conversations I found with other Angular developers, there’s a website that helps explain the update process to a newer version. Here’s the site: https://angular-update-guide.firebaseapp.com/ Additionally, don’t forget about the official Angular website: https://angular.io/
Uniform Cost Search (UCS) traverses nodes by the shortest cost. Here’s an example of a map with a starting point from Las Vegas to the goal point Calgary. I’ve marked up the depth levels by arrow color. To determine the order, I needed to find the shortest cost between nodes. It helped me make a […]
Code documentation example with TypeScript. /** Class representing a point. */ class Point { /** * Create a point. * @param {number} x – The x value. * @param {number} y – The y value. */ constructor(x, y) { // … } /** * Get the x value. * @return {number} The x value. */ […]