Skip to content

Instantly share code, notes, and snippets.

@FranciscoMoretti
FranciscoMoretti / working_effectively_with_legacy_code.md
Last active February 1, 2024 13:58 — forked from jonnyjava/working_effectively_with_legacy_code.md
Working effectively with legacy code summary

WORKING EFFECTIVELY WITH LEGACY CODE

To me, legacy code is simply code without tests. I’ve gotten some grief for this definition. What do tests have to do with whether code is bad? To me, the answer is straightforward, and it is a point that I elaborate throughout the book: Code without tests is bad code. It doesn’t matter how well written it is; it doesn’t matter how pretty or object-oriented or well-encapsulated it is. With tests, we can change the behavior of our code quickly and verifiably. Without them, we really don’t know if our code is getting better or worse.

Chapter 1 Changing Software

Four Reasons to Change Software: For simplicity’s sake, let’s look at four primary reasons to change software.

@FranciscoMoretti
FranciscoMoretti / search_and_replace_with_regex.md
Last active October 23, 2021 23:55
Search and replace with regex groups in VS Code - MD image to Next JS Image

This example converts a MD image to a Next JS Image. HEIGHT and WIDTH need to be replaced manually.

Text to replace

![Numeric Algorithms](/public/static/images/talk/bFSnXNIsK4A/numeric_algorithms.png)

Regex to use in the Search field. Group 1 is the title, and group 2 is the src.

!\[(.*)\]\(/public(.*)\)
@FranciscoMoretti
FranciscoMoretti / domain_alias_netlify.md
Last active September 12, 2021 15:33
Domain Alias in Netlify

How to set a domain alias in Netlify

To set up a domain alias you should already have a primary domain. Other than that, two other things are needed:

  1. Another domain
  2. A DNS provider

Will assume that you already have "another domain" therefore the piece missing is the DNS provider. The best option for this is to use netlify itself (https://app.netlify.com/dns). Just add the new domain and point it to your app name.

SSL certificate

Set up you alias in advance or it won't be included in the SSL certificate generation. Visit the following site for more info https://docs.netlify.com/domains-https/https-ssl/#domain-aliases.

@FranciscoMoretti
FranciscoMoretti / index.html
Created December 22, 2019 17:54
Tic Tac Toe
<div id="errors" style="
background: #c00;
color: #fff;
display: none;
margin: -20px -20px 20px;
padding: 20px;
white-space: pre-wrap;
"></div>
<div id="root"></div>
<script>