Information Management Cheatsheet
Some stuff about organization, that terrible issue in my life.
Bookmarking
Use Firefox for bookmarking:
Shortcut | Function |
---|
Some stuff about organization, that terrible issue in my life.
Use Firefox for bookmarking:
Shortcut | Function |
---|
Cheatsheet for psql, the command line client for PostgreSQL.
Do:
First, the term working tree refers to the current checked out branch, the working directory in it's present state.
It is recommended that comparison are made on commited, clean states, and not on uncommited changes. To compare with the current uncommited state of the working tree move the changes to staged. If not, new files won't show up at the SEARCH & COMPARE dialog, but this is tricky.
Use the VSC Git extension. To evaluate if a stalled branch is worth to be maintained, check out the develop, master, or main branch. If not very sure of the result, create a merge test branch.
Right click on the stalled branch and select Compare with Working Tree. The SEARCH & COMPARE section will read Compating XXX to Working Tree, being XXX the right clicked branch. The interpretation of the output is based on the changes to be done to XXX to reach the state of WT. Therefore:
Some Docker recipes.
GitLab provides access tokens at various access levels, like API or Read Registry ones. To use them:
Encryption and how to read and write it with GPG.
In most cases is just a matter of copying the ~/.gnupg folder. Check available keys with commands explained below.
Owner of folder .gnupg and its contents must be the user. Folder permissions must be 700, and permissions for file gpg.conf must be 600.
Copy is a command and a psql metacommand to import data into a PostgreSQL:
-- Tables
\copy test_data.test from sigwx.csv with delimiter '|' csv delimiter E'\t' header quote '"' encoding 'utf-8' null '-'
\copy test_data.test to sigwx.csv with delimiter '|' csv header quote '"' encoding 'utf-8' null '-'
# ----- | |
# | |
# Some recipes for ImageMagick | |
# | |
# ----- | |
# Cropping one pixel from the border, in place, batch version | |
mogrify -crop +1+1 -crop -1-1 ../src/images/*.png |
In the past, we tend to overstuff objects with fixed dependencies. Object A uses object B for a lot of things. Is the relation is 1:1, it may be ok to fix the instance of B as a member in A, but if not, if A can use in a given method ANY instance of B, then provide the B object directly to the method. This way the code is free to check for loaded dependencies into A before executing methods, it's up to the API user to ensure they are providing the right object to the method. This is specially useful when dealing with dependencies that comes from a DB, since they are async procedures and the code goes too complicated. Leave this complication to the client code.
Some hints and important stuff about PostgreSQL.
Reordering columns in existing tables with data: never do that, pointers to data seems to be lost. Redo the table if needed with create select and such.
Avoiding divisions by zero: the nullif function is an useful way to avoid them:
round(((sum(e001518)::float) / (nullif(sum(e166418), 0))::float)::numeric, 2)
Command | Action |
---|---|
PREFIX-a | Send nested prefix |