Guidelines for building CLI tools

Best practices for building CLI tools

1 min · Jesstern Rays

How to structure your unit tests

When writing test cases, we can organize our tests into three segments Arrange – set variables, stubs, mocks, spies, etc Act – the action that you wish to assert on Assert – make an assertion on the expected and actual results Here’s a simple example: test("renders correct number of books", () => { // arrange const books = [ {title: "Animal Farm", author: "George Orwell"}, {title: "Nineteen Eighty-Four", author: "George Orwell"}, {title: "Down and Out in Paris and London", author: "George Orwell"}, ] // act const { queryAllByTestId } = render(<BookList books={books} />); // assert expect(queryAllByTestId('book-item')....

1 min · Jesstern Rays

PEP 20: Zen of Python

Here’s a small sample from Zen of Python: Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Readability counts.

1 min · Jesstern Rays

The 3-2-1 backup rule

Create 3 copies of your data – 1 primary and 2 backup copies Have 2 types of storage mediums – e.g. hard disk drives and cloud storage Store 1 of these backups offsite – preferably on the cloud Let’s say you have some files on your computer. You want to make a backup copy of your files on an external hard disk drive and have another copy on a cloud storage....

1 min · Jesstern Rays