From 22c4f271e8d3f9d9e8b377838d885e4f65c7e356 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 10 Aug 2018 15:57:44 -0700 Subject: small software tweaks --- software/bash.page | 2 ++ software/chromium.page | 13 +++++++++++++ software/python.page | 36 ++++++++++++++++++++++++++++++++++++ software/rust.page | 1 + 4 files changed, 52 insertions(+) diff --git a/software/bash.page b/software/bash.page index 5c81d3f..0d5325b 100644 --- a/software/bash.page +++ b/software/bash.page @@ -42,3 +42,5 @@ life difficult. Sometimes `|| true` is enough to get around this. Google has a style guide: https://google.github.io/styleguide/shell.xml Shellcheck is a lint tool: https://www.shellcheck.net/ + +http://redsymbol.net/articles/unofficial-bash-strict-mode/ diff --git a/software/chromium.page b/software/chromium.page index 2212a20..9a88295 100644 --- a/software/chromium.page +++ b/software/chromium.page @@ -56,7 +56,20 @@ back so often and reaching for backspace is a pain:: Flash Block -------------- +*Note: pretty sure this isn't necessary circa 2018)* + I still use `flash block `_ to disable flash by default; an indicator pops up and I can enable flash for an entire page which is nice for sites that have hidden flash (like hulu). +Flags +------- + +- `#show-saved-copy`: enable primary +- `#pause-background-tabs`: enabled +- `#expensive-background-timer-throttling: enabled + +Opt-Outs +---------- + +- https://mouseflow.com/opt-out/ diff --git a/software/python.page b/software/python.page index deada7a..0fd2531 100644 --- a/software/python.page +++ b/software/python.page @@ -102,15 +102,21 @@ number (as an int). RunSnakeRun ------------- +Runsnake seems to be unmaintained... `snakeviz` is the new thing? + Example session:: $ python -m cProfile -o ./dump.profile myscript.py --script-option blah $ # run to completion or Ctrl-C, then $ runsnakerun ./dump.profile + # or + $ snakeviz ./dump.profile nosetests ------------- +NOTE: by default I now use pytest instead of nose + To do minimal tests without wrapping everything in a class, import assert functions from nose.tools, eg:: @@ -169,3 +175,33 @@ To make Python 3.4 the default for `python` system-wide, do something like: For an individual user you can also just create a `python` alias. See also: http://linuxconfig.org/how-to-change-from-default-to-alternative-python-version-on-debian-linux + + +Nice Packages +-------------- + +subprocess/pexpect: https://github.com/kennethreitz/delegator.py + +time/datetime: https://github.com/crsmithdev/arrow + +tsv: https://github.com/kennethreitz/tablib + +simple HTML scraping: https://github.com/michaelhelmick/lassie + +sqlite3dbm is a library to back a python dict with sqlite3 on disk + + +pytest +----------- + +pytest sort of "just works" if you put test files under `./tests/`. If you want +crude file imports, skipping directories, and including `test_*` functions from +any python file (not just those with `test_*.py`, install `pytest-pythonpath` +and create a `pytest.ini` like: + + [pytest] + python_paths = . + python_files = *.py + norecursedirs = .svn _build tmp* + +Need to mock? diff --git a/software/rust.page b/software/rust.page index af5ea3a..df99de4 100644 --- a/software/rust.page +++ b/software/rust.page @@ -5,6 +5,7 @@ Rust - [http://xion.io/post/code/rust-iter-patterns.html]() - [https://deterministic.space/rust-cli-tips.html]() +- [https://manishearth.github.io/blog/2018/01/10/whats-tokio-and-async-io-all-about/]() Optimization: use `RUSTFLAGS="-C target-cpu=native"` to take advantage of CPU special features. -- cgit v1.2.3