Skip to content

Instantly share code, notes, and snippets.

View rodigu's full-sized avatar
:electron:
☝️🤓

Rodrigo Morais rodigu

:electron:
☝️🤓
View GitHub Profile
@rodigu
rodigu / python-pandas-oneliners.py
Created June 24, 2025 18:50
a python one liner featuring the walrus operator
(a:=df.melt(value_vars=[qtt, val], id_vars=[moy, par, ven], var_name='type')).assign(**{mnt:a[moy] + '-' + a['type']})[[mnt,par,ven,'value']].pivot(columns=[mnt], index=[par,ven], values='value').to_csv('73-1.csv')
@rodigu
rodigu / powershell-ref-scroll.md
Created April 25, 2025 21:08
scrolling on powershell with the keyboard

there are built-in key bindings for scrolling on powershell

was looking for a way to do this, as i have been looking through docker logs1 for basically the whole day2. a lot of moving my hand all the way over to the mouse to scroll

after searchingit up, a reddit comment suggested adding key bindings

Footnotes

  1. why is the docker ps command so poorly fomatted? it is terribly annoying to parse what is going on a basic visual level. seems to be a gripe sustained by at least 173 other poor souls

  2. the docker inspect command has been quite useful

@rodigu
rodigu / pbi-data-info.md
Created April 1, 2025 17:23
powerbi tooltip help
  1. insert an oval shape
  2. write a question mark inside it (style > text)
  3. add an action, bookmark type
  4. you can write a help-kind of text in the tooltip section (action > tooltip)
NPR how much does this cow weight survey:
- https://www.npr.org/sections/money/2015/08/07/429720443/17-205-people-guessed-the-weight-of-a-cow-heres-how-they-did
- https://www.npr.org/sections/money/2015/08/07/429720443/17-205-people-guessed-the-weight-of-a-cow-heres-how-they-did
[Hill investment wisdom of the crowd](https://www.hillinvestmentgroup.com/2023/08/17/wisdom-of-crowds/)
[first american wisdom of the crowd](https://blog.firstam.com/economics/the-wisdom-of-the-crowd-myth-or-reality)
betting markets in elections
@rodigu
rodigu / quote-walden-delicate-handling.md
Created March 26, 2025 09:50
walden - the most delicate handling

The finest qualities of our nature, like the bloom on fruits, can be preserved only by the most delicate handling. Yet we do not treat ourselves nor one another thus tenderly.

Thoreau, Henry David; Walden; 31

@rodigu
rodigu / reference-wumbo.md
Created March 24, 2025 12:53
reference-wumbo

wumbo is a website with references for formal mathematical symbols.

@rodigu
rodigu / python-pip-show.md
Created February 19, 2025 19:28
checking for pip package versions
pip show [package]
@rodigu
rodigu / architecture-unit-testing.md
Last active February 17, 2025 14:03
unit testing considered harmful?

in searching more in depth for topics in software architecture, i have come accross Simon Brown's Software Architecture vs Code lecture, for GOTO 2014.

the section that most caught my attention, was his reference to Why Most Unit Testing is Waste [^1], by James O Coplien.

in the paper, a specific quote from Coplien caught my attention:

(...) notions such as: “Every line of code has been reached,” which, from the perspective of theory of computation, is pure nonsense (...)

which is, undeniably true and, as i tought more about it, also comically unfortunate that lines of code reached is used as a measurement of test coverage.

@rodigu
rodigu / airflow-pickling.md
Created February 17, 2025 12:12
pickling classes in airflow

one of our classes, which made use of the pbipy library, could not be passed through XCom. we were getting the following error: airflow cannot pickle [CLASS] object

the fix involved changing a cfg variable to false:

# Whether to enable pickling for xcom (note that this is insecure and allows for
# RCE exploits).
# Variable: AIRFLOW__CORE__ENABLE_XCOM_PICKLING
enable_xcom_pickling = False