Welcome!
My repository of things I've learned. Mostly programming related. Part microblog, part knowledge base, part digital garden. If you like this, you might enjoy my blog.
10 TILs so far!
Recent TILs
- javascript
appendChild
Move an element from its current position to the new position.
- python
Extract files from a docker container without running it
- python
Verify and lazy load imports of a python package
Scenario: You have a python package with an entry point class that needs to be instantiated and
- python
Defining setup.py dependencies using a URL
Any branch on GitHub can be installed by pip by finding the URL to the zip export of that branch.
- python
Efficiently copying a file
- python
Use setup.py to install platform-specific dependencies
- javascript
structuredClone
The object spread syntax
...makes a shallow clone of an object, but a shallow clone is only useful for cloning primitive values in the object. - git
Update all submodules to latest commit on origin
I use Git submodules in a bunch of projects, and one common task is checking out the latest commit on the origin.
- git
Ignore all .DS_Store files
If you use git on a Mac, chances are you've accidentally committed a
.DS_Storeto a repo. I used to reflexively add.DS_Storeto all my.gitignorefiles to avoid ever repeating that mistake. - django
Conditionally extend a template
Django supports template inheritance via the
extendstag. Often, a template inheritance chain follows all the way up to a "base" template that contains the full markup for a page, from the doctype to the closing HTML tag.