* Open `index.html` in text editor and first remove element `<p><br></p>` before the `<h1>Libraries</h1>`.
* Then replace the index and footer with contents of `pdf/index_for_pdf.html` file and save.
* Change brightness of comments by right clicking on them and selecting inspect. Then click on the rectangle that represents color and toggle the color space to HSLA by clicking on the button with two vertical arrows.
* Change lightness (L) percentage to 77%.
* Open `index.html` in Chrome and select 'Print...'.
* Select destination 'Save as PDF', paper size 'A4', margins and scale 'Default' and no headers and footers and save.
* Select destination 'Save as PDF', paper size 'A4', customised margins of top 10mm, right 9.5mm, bottom 5mm and left 10mm, 'Default' scale and no headers and footers and save (the document should be 50 pages long).
### PDF optimized for laser color printing
* Run `./parse.js` again.
@ -33,7 +35,7 @@ Printing to PDF
* 58% for the comments.
* Individually change brightness of every comment line that starts with: `# $ pip3 install
...` and of comments in basic script template to 57%, by adding `color: hsla(0, 0%, 57%, 1);` to their element.style.
* Select 'Print...' and destination 'Save as PDF', paper size 'A4', margins and scale 'Default' and no headers and footers and save.
* Select 'Print...' with destination 'Save as PDF', paper size 'A4', customised margins of top 10mm, right 9.5mm, bottom 5mm and left 10mm, 'Default' scale and no headers and footers and save (the document should be 50 pages long).
Adding headers and footers to PDF (the same for both files)
<detailsopen><summary><strong>What is the best way to use it?</strong></summary><br>
I keep the text file open on separate desktop at all times. It is also in a different text editor than the one I usually use, so it's easier to switch to with <code>Ctrl+↹</code> / <code>⌘↹</code>. Cheatsheet consists of minimal text and short examples so things are easy to find with <code>Ctrl+F</code> / <code>⌘F</code>. If you're on the webpage, searching for <code>'#<name>'</code> will only search for the titles.<br><br>
I also keep the Python console open at all times to test little snippets of code, to check out the available functions of a module using code completion and above all, to use <code>help(<module/object/function/type>)</code> command. If something is still unclear, then I search the Python docs by googling <code>'python docs <module/function>'</code>.
I also keep the Python console open at all times to test little snippets of code, to check out the available functions of a module using code completion and above all, to use <code>help(<module/object/function/type/str>)</code> command. If something is still unclear, then I search the Python docs by googling <code>'python docs <module/function>'</code>.
</details><br>
<detailsopen><summary><strong>What does the '<type>' signify?</strong></summary><br>
@ -32,12 +32,16 @@
Check out <ahref="https://google.github.io/styleguide/pyguide.html">Google Style Guide</a> and use <code>Ctrl+Alt+L</code> / <code>⌥⌘L</code> shortcut in PyCharm to automatically reformat code.
</details><br>
<detailsopen><summary><strong>Why are import statements, virtual environment, tests, packaging and installation not covered?</strong></summary><br>
<detailsopen><summary><strong>Why are there no blank lines between method definitions?</strong></summary><br>
This way classes can be copy-pasted into the Python console, which would otherwise raise IndentationError.
</details><br>
<detailsopen><summary><strong>Why are import statements, virtual environments and tests not covered?</strong></summary><br>
Check out <ahref="https://docs.python-guide.org/">The Hitchhiker’s Guide to Python</a> for a nice overview of the mentioned topics.
</details><br>
<detailsopen><summary><strong>Why is Django not covered?</strong></summary><br>
Maybe it will be in the future. For now, here is a nice <ahref="https://github.com/kickstartcoding/cheatsheets/blob/master/build/topical/django.jpg">Django cheatsheet</a>.
<detailsopen><summary><strong>Why are Flask and Django not covered?</strong></summary><br>
Maybe they will be in the future. For now, here is a nice <ahref="https://github.com/kickstartcoding/cheatsheets/blob/master/build/topical/django.jpg">Django cheatsheet</a>.
</details><br>
<detailsopen><summary><strong>Why are there no concrete Regex examples?</strong></summary><br>
@ -49,7 +53,7 @@
</details><br>
<detailsopen><summary><strong>Why is staticmethod decorator not covered in Class section?</strong></summary><br>
Because it's of very limited use and is easy to mix up with classmethod.
Because it is of very limited use and is easy to mix up with classmethod.
</details><br>
<detailsopen><summary><strong>Why are descriptors not covered?</strong></summary><br>