U+1F916, U+1F37B, U+1F469 U+200D U+1F4BB
View the Project on GitHub MarcyMarxy/tech-troubleshooting-tavern
🤖 🍻 👩‍💻 GitHub Pages site: https://marcymarxy.github.io/tech-troubleshooting-tavern/
For Mac: VSCode+zsh(package install)
git --version
git status
git init
git add .
git commit -m "write some messages"
git push
Author identity unknown *** Please tell me who you are.
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
git remote add origin https://github.com/???.git
git branch -M main
git push -u origin main
References:
git remote rm origin
ls
Python debugger pdb
import pdb
Set breakpoint
pdb.set_trace()
Inspect variables
p state
state
n
c
Quit
q
quit
self.assertSomething(expected, actual)
Think: “I’m telling the test case to assert something”
assert condition
Think: “I’m writing a normal Python assertion”
What you want to test | unittest | pytest |
---|---|---|
Equality | self.assertEqual(a, b) |
assert a == b |
Truthiness | self.assertTrue(x) |
assert x |
Falseness | self.assertFalse(x) |
assert not x |
Type checking | self.assertIsInstance(obj, cls) |
assert isinstance(obj, cls) |
None check | self.assertIsNone(x) |
assert x is None |
Not None | self.assertIsNotNone(x) |
assert x is not None |
Container membership | self.assertIn(item, container) |
assert item in container |
Not in container | self.assertNotIn(item, container) |
assert item not in container |
Exception raised | self.assertRaises(Exc, func, *args) |
pytest.raises(Exc, func, *args) |
Approximate equality | self.assertAlmostEqual(a, b) |
assert abs(a - b) < tolerance |
https://validator.w3.org/#validate_by_input
Emoji Unicode
emojipedia
TinyTex + LaTex Workshop
parskip.sty not found
pdflatex --version
tlmgr install parskip
tlmgr install titlesec
Python code formatter.
Generate documentation from comments and docstrings using Sphinx.
In terminal, type:
sphinx-quickstart
Enter basic project information.
In conf.py
, add:
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
extensions = ['sphinx.ext.autodoc']
autodoc_member_order = 'bysource'
html_theme = 'sphinx_rtd_theme'
In index.rst
, add:
.. automodule:: <module name>
:members:
:undoc-members:
:show-inheritance:
:special-members: __init__
In terminal, type:
sphinx-apidoc -o docs . -f
make html
In VS Code, use “Live Server” extension to preview.
https://www.colorhexa.com/web-safe-colors
https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status