43rd Week of 2021
Life Management⚑
Book Management⚑
- Improvement: Add link to the calibre-web kobo integration project.
Coding⚑
Python⚑
Full screen applications⚑
- New: Testing full screen applications.
-
To map an action to two key presses use
kb.add('g', 'g')
. -
New: Add note on how to debug the styles of the components.
Set the style to
bg:#dc322f
and it will be highlighted in red.
Pytest⚑
-
New: Exclude the
if TYPE_CHECKING
code from the coverage.If you want other code to be excluded, for example the statements inside the
if TYPE_CHECKING:
add to yourpyproject.toml
:[tool.coverage.report] exclude_lines = [ # Have to re-enable the standard pragma 'pragma: no cover', # Type checking can not be tested 'if TYPE_CHECKING:', ]
Python Snippets⚑
-
a = ['a', 'b'] index = a.index('b')
-
New: Transpose a list of lists.
>>> l=[[1,2,3],[4,5,6],[7,8,9]] >>> [list(i) for i in zip(*l)] ... [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
-
New: Check the type of a list of strings.
def _is_list_of_lists(data: Any) -> bool: """Check if data is a list of strings.""" if data and isinstance(data, list): return all(isinstance(elem, list) for elem in data) else: return False
Prompt Toolkit⚑
-
New: Basic concepts of building full screen applications with python prompt toolkit.
prompt_toolkit
can be used to create complex full screen terminal applications. Typically, an application consists of a layout (to describe the graphical part) and a set of key bindings.In the section we cover:
- The layout
- The controls
- How to use key bindings
- How to apply styles
- A difficult ordered list of examples to get a grasp of these concepts with simple working code.
DevOps⚑
Infrastructure as Code⚑
Helmfile⚑
-
Correction: Use environment name instead of get values.
Instead of
.Environment.Name
, in theory you could have used.Vars | get "environment"
, which could have prevented the variables and secrets of the default environment will need to be calleddefault_values.yaml
, anddefault_secrets.yaml
, which is misleading. But you can't use.Values
in thehelmfile.yaml
as it's not loaded when the file is parsed, and you get an error. A solution would be to layer the helmfile state files but I wasn't able to make it work. -
New: How to install a chart only in one environment.
environments: default: production: --- releases: - name: newrelic-agent installed: {{ eq .Environment.Name "production" | toYaml }} # snip
-
New: Add note that templates can't be used inside the secrets.
See this issue
Helm Secrets⚑
-
Correction: Update the repository url.
The last fork is dead, long live the fork
-
New: How to install the plugin.
Operative Systems⚑
Linux⚑
Kitty⚑
-
New: Enable infinite scrollback history.
To make the history scrollback infinite add the next lines:
scrollback_lines -1 scrollback_pager_history_size 0
-
New: Reasons to migrate from urxvt to kitty.
- It doesn't fuck up your terminal colors.
- You can use peek to record your screen.
- Easier to extend.
Peek⚑
- Correction: Add note that it works with kitty.
Arts⚑
Drawing⚑
-
Ellipses are the next basic shape we're going to study (after the lines). They are extremely important and notoriously annoying to draw. Important because we're going to be using ellipses in 2D space to represent circles that exist in 3D space.
In this section we:
- Introduce the basic concepts surrounding the ellipses
- How to draw them.
Exercise Pool⚑
-
New: Add the Tables of ellipses drawing exercise.
This exercise is meant to get you used to drawing ellipses, in a variety of sizes, orientations and degrees. It also sets out a clear space each ellipse is meant to occupy, giving us a means to assess whether or not an ellipse was successful, or if there were visible mistakes (where it went outside of its allotted space, or ended up falling short). Practicing against set criteria, with a way to judge success/failure is an important element of learning. There's nothing wrong with failure - it's an opportunity to learn. Having a clearly defined task allows us to analyze those failures and make the most of them.