-
- BBQ
- The smoker went for 8.5hrs unattended last night. When I woke up, the coal basket and water pan each had about 30% remaining? At 175 and you could go 10+ hrs. Great to know. Turned it hot and spritzed, will transfer to the oven in about an hour.
- Supercontest
- Python 3.
- iteritems -> items
- operator.itemgetter -> dict.get
- dict.keys(), dict.values(), and zip() all return iterators now, not iterables. Cast to list when necessary. This is nice for memory saving, obviously.
- import pdb; pdb.set_trace() -> breakpoint()
- asyncio, obv
- docker-compose restart <> is the same as start -> stop. Useful for reloading.
- But there’s an even better way to iterate in development. Added –py-autoreload=1 to the uwsgi cmd call in the app container (same as flask’s dev server reload). Now when my files change (based on the mounted volume of my source), the uwsgi server reloads. Great!
- Watch the app in realtime with docker-compose logs -f <> !
- This confirms the app restart on change as well.
- Effectively about 2.7k lines in the entire infrastructure of my application:
- find -type f -not -path “*.venv*” -not -path “*.git*” -not -path “*.idea*” -not -path “*backups*” -not -path “*egg-info*” -not -path “*.pyc*” -exec wc -l {} +
- There’s only 800 lines restricting it to actual application code (python extensions within the supercontest/ subdir):
- find supercontest -name “*.py” -type f -not -path “*.venv*” -not -path “*.git*” -not -path “*.idea*” -not -path “*backups*” -not -path “*egg-info*” -not -path “*.pyc*” -exec wc -l {} +
- Pretty amazing. Under 1000 lines of custom code to produce a fully functional website.
- Adding all the enterprise bells and whistles of dev, management, deployment, etc only adds about 2000 more lines.
- Furthermore, the infra is twice the size of the source. Not surprising.
- Ran pylint (via tox) for the first time in a longggg time.
- Most common: no-member on all the usages of `db` (to commit, add, delete, etc).
- Closed #19.
- To search with ag but only for a specific filename regex (like an extension), use:
- JS. Class inheritance, templating. Prototypal inheritance (from other objects), more like composition. Composition is almost always favorable.
- Angular has more of a pattern of two-way binding (frontend object updates, backend does as well, and vice versa). React is more one-way dataflow. The model is the only source of truth. The view just reflects it.
- Game of thrones final season premiere!
- My typing cursor had been jumping around a bit. It’s a little annoying. The browser typing isn’t as consequential, but it’s dangerous in vim when I’m actually writing code. The active line changes based on autocomplete and other things, and I don’t want any unintended visual shift to slip under the radar because of this.
- I changed the cursor theme back to adwaita (default) in hopes this would help, based on this answer: https://askubuntu.com/questions/115349/why-does-my-cursor-jump-when-typing. Don’t think it’s gonna change much. Changing the movement speed just means you can’t move to a new line as quickly, which is a bandaid on the problem. A real solution would be changing the sensitivity. Maybe disabled touch clicks (and only registering push-clicks) would help. Otherwise, I just have to be very cognizant about my thumbs not touching the pad when typing (the setting for “disable touchpad when typing” is already on, but doesn’t work well).
- Ya, that worked. Disabling tap-to-click means that errant touches don’t misplace my cursor. Well worth the trade of not being able to silently click on something.