Skip to content

Instantly share code, notes, and snippets.

View myknbani's full-sized avatar

Richard Michael Coo myknbani

  • Central Philippine University
  • Iloilo City, Philippines
  • X @myknbani
View GitHub Profile

Benefits of pure functions

  1. Easier to reason about

    • a pure function tells everything you need to know about the function. No hidden I/O, no external variables modified, no instance or even global variables to hunt down.
  2. Easier to test

    • since the same input(s) always return the same output(s), they're easy to test. Provide the input and expected output. Simple! No need for setup, teardown, or mocking.
@myknbani
myknbani / colab-demo.ipynb
Last active April 6, 2022 07:35
colab-demo.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
+ verbose=on
+ shift
+ [[ -n '' ]]
+ get_distro
+ get_bold
+ case "$ascii_bold" in
+ ascii_bold='\033[1m'
+ case "$bold" in
+ bold='\033[1m'
+ get_distro_colors