32nd Week of 2021
Projects⚑
-
New: Introduce pynbox the inbox management tool.
Pynbox is a tool to improve the management of ideas, tasks, references, suggestions when I'm not in front of the computer. Right now I've got Markor for Android to register these quicknotes, but the reality is that I don't act upon them, so it's just a log of tasks that never get done, and ideas, references and suggestions that aren't registered in my knowledge or media management systems.
On the computer there are also cases of tasks that are not worth registering in the task management system, or ideas that I get at a moment but don't have time to process at the moment.
The idea then is to automatically sync the Android quicknote with syncthing, and have a special format for the file that allows
pynbox
to extract the elements from that file to the "inbox system". For example: +t. buy groceries tv. IT crowd i. Improve the inbox management I want a system to improve ...
Gets introduced in the "inbox system" as a task, a TV suggestion and an idea.
-
New: Introduce nyxt as a solution for a better browser.
Coding⚑
Python⚑
Python Snippets⚑
-
New: Explain how to find a static file of a python module.
import pkg_resources file_path = pkg_resources.resource_filename("my_package", "assets/config.yaml"),
-
New: Explain how to delete a file.
import os os.remove('demofile.txt')
-
New: Explain how to measure elapsed time between lines of code.
import time start = time.time() print("hello") end = time.time() print(end - start)
pexpect⚑
-
New: Explain how to read the output of a command run by pexpect.
import sys import pexpect child = pexpect.spawn('ls') child.logfile = sys.stdout child.expect(pexpect.EOF)
rich⚑
-
New: Explain how to build pretty tables with rich.
from rich.console import Console from rich.table import Table table = Table(title="Star Wars Movies") table.add_column("Released", justify="right", style="cyan", no_wrap=True) table.add_column("Title", style="magenta") table.add_column("Box Office", justify="right", style="green") table.add_row("Dec 20, 2019", "Star Wars: The Rise of Skywalker", "$952,110,690") table.add_row("May 25, 2018", "Solo: A Star Wars Story", "$393,151,347") table.add_row("Dec 15, 2017", "Star Wars Ep. V111: The Last Jedi", "$1,332,539,889") table.add_row("Dec 16, 2016", "Rogue One: A Star Wars Story", "$1,332,439,889") console = Console() console.print(table)
-
New: Explain how to print pretty text with rich.
from rich.console import Console from rich.text import Text console = Console() text = Text.assemble(("Hello", "bold magenta"), " World!") console.print(text)
DevOps⚑
Infrastructure as Code⚑
Terraform⚑
-
New: Explain how to ignore the change of an attribute.
resource "aws_instance" "example" { # ... lifecycle { ignore_changes = [ # Ignore changes to tags, e.g. because a management agent # updates these based on some ruleset managed elsewhere. tags, ] } }
-
New: Explain how to define the default value of an variable that contains an object as empty.
variable "database" { type = object({ size = number instance_type = string storage_type = string engine = string engine_version = string parameter_group_name = string multi_az = bool }) default = null
-
New: Explain how to do a conditional if a variable is not null.
hcl resource "aws_db_instance" "instance" { count = var.database == null ? 0 : 1 ...