With npm, as simple as:
npx kill-port 5678
In simple terms:
flush
and commit
, later queries will be able to retrieve these changes.flush()
changes are in a pending state (no db statements are issued yet), and can be undone by rollback()
; commits are persisted to db and non-reversible.Why use flush:
Github actions getting stuck in limbo, never starting. No fear! There is a solution!
Continue readingError running pre-commit:
Type tag 'jupyter' is not recognized. Try upgrading identify and pre-commit?
Continue reading >>> dance.__name__
'dance'
>>> callable(foo)
True/False
2 Errors that were painful to debug.
Continue readingSometimes data is corrupted, and you just want to nuke the whole world and start a new life. In which case do:
$ docker container prune
$ docker volume prune
Domain Driven Design basically means to let business logic decide on object model, and construct the rest of the code from that starting point. Instead of, say, starting off by designing db schema and build from grounds up.
Continue readingAnd, what is the difference between raising normal errors and assertions? Basically:
Raising Error | Assertion |
Raise ValueError('Input not in range [1, 10]') | assert 1 <= v <= 10 |
Intended for users | Intended for developers |
Happens when user action is illegal | Happens when code contains bug |
To signal to user to take a different course of action | To easily find where code starts to error |
Cannot and should not be disabled | Can be disabled during compilation, therefore should not be used in logics like data validation |
Usually, the error module x has no attribute y
means that:
x
file, which collides with python’s x
modulex
collides with python’s x
module