Forbidden icon when upgrading a MacBook Pro 2011

Upgrading a MacBook Pro 2011 with a SSD is the easiest way to boost your old laptop performance. Follow the tutorial here.

You dont need a thumbdrive to reinstall MacOS on the new SSD

One particular situation is that when I tried to install the MacOS on the new SSD, after selecting the thumb drive it prompted me a forbidden logo (a circle with a line through it) and the system halted.

From the Youtube comments I found that the root cause for this forbidden logo is the thumb drive. Remove it and proceed with wifi restoration by pressing option key then it will be fine.

From Lion to High Sierra

Please beware that you need to upgrade from Lion to El Capitan to High Sierra, but not directly from Lion to High Sierra.

For 2011 MacBook Pro, the last version of macOS supported is High Sierra.

You won’t be able to search El Capitan on Lion App Store, but you can access it through the link below:

El Capitan App Store link in Step 4

High Sierra App Store link in Step 4

read more

Jekyll Sitemap generated with localhost domain, not the base URL

Problem

The Jekyll Sitemap plugin helps to generate sitemap.xml and robots.txt, which improves your SEO to search engines. Then you can submit them to Google Search Console for indexing.

However Google Search Console prompted the error URL not allowed - This URL is not allowed for a Sitemap at this location. when I submitted the sitemap from Jekyll Sitemap plugin.

Google Search Console error

Upon checking, the domain in sitemap.xml was actually in localhost domain.

<url>
<loc>http://localhost:4000/2017/05/28/builder-pattern-vs-constructor-vs-setter/</loc>
<lastmod>2017-05-28T00:00:00+08:00</lastmod>
</url>
<url>
<loc>http://localhost:4000/about/</loc>
</url>
<url>
<loc>http://localhost:4000/tags/</loc>
</url>
<url>
<loc>http://localhost:4000/</loc>
</url>
<url>
<loc>http://localhost:4000/style-guide/</loc>
</url>

read more

Builder pattern vs Constructor vs Setter

Builder pattern, as hinted by the name, is one of the ways to build an object.

You could have built an object with this:

// Example 1

new FlyingMachine("Boeing 787", 2, false);

Or this:

// Example 2

FlyingMachine plane = new FlyingMachine();
plane.setName("Boeing 787");
plane.setNumEngine("Boeing 787");
plane.setHasRocketBooster(false);

So, why bother using this pattern:

// Example 3

new FlyingMachineBuilder()
	.name("Boeing 787")
	.numEngine(2)
	.hasRocketBooster(false)
	.build();

read more