Skip to content

Instantly share code, notes, and snippets.

View kadams54's full-sized avatar
🏠
Working from home

Kyle Adams kadams54

🏠
Working from home
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Django-environ

Installing

pip install django-environ

OR

@kadams54
kadams54 / 00_README.md
Last active October 2, 2023 14:16
Grokking Simplicity: Chapter 12 Functional iteration

Python's equivalents:

  1. map()
  2. filter()
  3. functools.reduce()

Several notes:

Python uses the reverse order for the arguments for the map()/filter() defined in the book: in Python, the function comes first, then the collection.

@kadams54
kadams54 / 00_README.md
Last active October 3, 2023 19:01
Example of chaining functions

All the programs below implement these steps:

  1. Generate a list of 1-8, not including 8: [1, 2, 3, 4, 5, 6, 7]
  2. Filter that list to even values: [2, 4, 6]
  3. Return each value N repeated N times: [2, 2, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6]