Notes: Difference between revisions
From Wiki
(Add youtube-dl trick) |
(Add Python section. Rearrange a couple of entries.) |
||
(18 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
I hope that things here will eventually be sorted into their own separate sections. | |||
=== Python === | |||
* GIL only affects CPU-bound multi-threaded code. Network-bound multi-threaded programs seem to work just fine. | |||
* Since the GIL pins all the threads in the program to a single CPU, it is basically pointless to use Python multi-threading if your task needs to leverage multiple CPUs. | |||
* To enforce a particular directory as the root directory for Pytest, just drop an empty pytest.ini file into the directory that you want to be the root directory. | * To enforce a particular directory as the root directory for Pytest, just drop an empty pytest.ini file into the directory that you want to be the root directory. | ||
* To ensure that a GoCD pipeline can only run based on timer and never on a material, mark the first stage of that pipeline as manual. Or mark it as manual in the template itself. | |||
* Idempotency is an essential feature of automation software like Ansible and FreedomBox. I wonder if there's a way to write a test suite that checks each action in the system for idempotency. | === Linux === | ||
* Download a youtube playlist using <pre>$ youtube-dl -t <url></pre> | |||
*Setting permissions after copying the file will lead to momentary exposure of the private key to other users on the system. Use umask instead. | |||
=== Git === | |||
* Accept theirs for a particular file/path <br /> https://stackoverflow.com/questions/22544305/git-merge-accept-theirs-for-multiple-conflicts/22544803#22544803 | |||
*To make git use git urls instead of https urls for a git host such as GitHub | |||
<pre> | |||
git config --global url.git@github.com:.insteadOf https://github.com/ | |||
</pre> | |||
=== Miscellaneous === | |||
*To ensure that a GoCD pipeline can only run based on timer and never on a material, mark the first stage of that pipeline as manual. Or mark it as manual in the template itself. | |||
*Idempotency is an essential feature of automation software like Ansible and FreedomBox. I wonder if there's a way to write a test suite that checks each action in the system for idempotency. | |||
*Download a youtube playlist using <pre>$ youtube-dl -t <url></pre> | |||
*Android activities are destroyed and recreated on screen orientation change. To avoid this, set<pre>android:configChanges="orientation|screenSize"</pre> under the Activity tag inside the AndroidManifest.xml. This only works if the minimum target version is API 13 or more. | |||
*To add a location to bookmarks in Nautilus file manager (default in Gnome 3), navigate to the directory and press Ctrl+D | |||
*Use org + LaTeX Beamer to rapidly create presentations. A simpler tool is mdp (markdown presenter) | |||
*Lektor builds a website by taking all the files in the content/ folder, processing them according to the rules of your Models and rendering them by using templates. | |||
*Create a REPL inside a Clojure REPL | |||
<pre> | |||
(defmacro loop_ [& body] `(while true ~@body)) | |||
(-> (read) (eval) (println) (loop_)) | |||
</pre> |
Latest revision as of 20:57, 5 December 2021
I hope that things here will eventually be sorted into their own separate sections.
Python
- GIL only affects CPU-bound multi-threaded code. Network-bound multi-threaded programs seem to work just fine.
- Since the GIL pins all the threads in the program to a single CPU, it is basically pointless to use Python multi-threading if your task needs to leverage multiple CPUs.
- To enforce a particular directory as the root directory for Pytest, just drop an empty pytest.ini file into the directory that you want to be the root directory.
Linux
- Setting permissions after copying the file will lead to momentary exposure of the private key to other users on the system. Use umask instead.
Git
- Accept theirs for a particular file/path
https://stackoverflow.com/questions/22544305/git-merge-accept-theirs-for-multiple-conflicts/22544803#22544803 - To make git use git urls instead of https urls for a git host such as GitHub
git config --global url.git@github.com:.insteadOf https://github.com/
Miscellaneous
- To ensure that a GoCD pipeline can only run based on timer and never on a material, mark the first stage of that pipeline as manual. Or mark it as manual in the template itself.
- Idempotency is an essential feature of automation software like Ansible and FreedomBox. I wonder if there's a way to write a test suite that checks each action in the system for idempotency.
- Download a youtube playlist using
$ youtube-dl -t <url>
- Android activities are destroyed and recreated on screen orientation change. To avoid this, set
android:configChanges="orientation|screenSize"
under the Activity tag inside the AndroidManifest.xml. This only works if the minimum target version is API 13 or more. - To add a location to bookmarks in Nautilus file manager (default in Gnome 3), navigate to the directory and press Ctrl+D
- Use org + LaTeX Beamer to rapidly create presentations. A simpler tool is mdp (markdown presenter)
- Lektor builds a website by taking all the files in the content/ folder, processing them according to the rules of your Models and rendering them by using templates.
- Create a REPL inside a Clojure REPL
(defmacro loop_ [& body] `(while true ~@body)) (-> (read) (eval) (println) (loop_))