Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael F. Lamb datagrok

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am datagrok on github.
  • I am datagrok (https://keybase.io/datagrok) on keybase.
  • I have a public key ASCrSLf3jYbRq3V0I7pJgP1UEqtjxqqP5iTBLfN5VXNq-Qo

To claim this, I am signing this object:

@datagrok
datagrok / README.md
Last active Jun 6, 2021
Circular imports in Python 2 and Python 3: when are they fatal? When do they work?
View README.md
@datagrok
datagrok / README.md
Last active Jul 11, 2022
What happens when you cancel a Jenkins job
View README.md

When you cancel a Jenkins job

Unfinished draft; do not use until this notice is removed.

We were seeing some unexpected behavior in the processes that Jenkins launches when the Jenkins user clicks "cancel" on their job. Unexpected behaviors like:

  • apparently stale lockfiles and pidfiles
  • overlapping processes
  • jobs apparently ending without performing cleanup tasks
  • jobs continuing to run after being reported "aborted"
@datagrok
datagrok / README.md
Last active Jan 14, 2019
How `mv`'s permission-preserving behavior is a gotcha in group-editable shared directory schemes.
View README.md
@datagrok
datagrok / README.md
Last active Aug 29, 2015
Update a directory upon `git push`
View README.md
@datagrok
datagrok / if_i_ran_the_company.md
Last active Jan 14, 2019
If I ran a company, what would it look like?
View if_i_ran_the_company.md

The article previously hosted at this location is now published on my website: If I Ran The Company.

@datagrok
datagrok / AGPL3-modifications.md
Last active Jan 14, 2019
Some questions and answers about various Free Software licenses.
View AGPL3-modifications.md
@datagrok
datagrok / noob-questions.md
Last active Sep 18, 2015
Questions while reading stuff
View noob-questions.md

Python

__debug__ vs. -O

Python has a built-in variable __debug__ which is set to True when python is called without -O (optimize). The -O flag disables all assertion code.

This seems at first glance like a very easy and clean construct to rely on when coding in development versus production: in development, don't use -O, defensively litter your code with type- and sanity-checking asserts. Perform development-only debugging by testing __debug__ beforehand.

When in production, run all code is run with -O which disables asserts (speeding execution) and sets __debug__ to False.

@datagrok
datagrok / vendoring.md
Last active Nov 10, 2022
"Vendoring" is a vile anti-pattern
View vendoring.md

"Vendoring" is a vile anti-pattern

What is "vendoring"?

From a comment on StackOverflow:

Vendoring is the moving of all 3rd party items such as plugins, gems and even rails into the /vendor directory. This is one method for ensuring that all files are deployed to the production server the same as the dev environment.

The activity described above, on its own, is fine. It merely describes the deployment location for various resources in an application.

@datagrok
datagrok / ergodox.md
Last active Jan 14, 2019
Reflections on my ErgoDox keyboard
View ergodox.md