Triple-double quote v.s. Double quote

From the PEP8 Style Guide: PEP 257 describes good docstring conventions. Note that most importantly, the “”” that ends a multiline docstring should be on a line by itself, e.g.: “””Return a foobang Optional plotz says to frobnicate the bizbaz first. “”” For one liner docstrings, it’s okay to keep the closing “”” on the … Read more

Make big quotes with

I believe you’re looking for something like this: blockquote { font-family: Georgia, serif; font-size: 18px; font-style: italic; width: 500px; margin: 0.25em 0; padding: 0.35em 40px; line-height: 1.45; position: relative; color: #383838; } blockquote:before { display: block; padding-left: 10px; content: “\201C”; font-size: 80px; position: absolute; left: -20px; top: -20px; color: #7a7a7a; } blockquote cite { color: … Read more

HTML5 block-quote with author

I googled about this and it looks like <figure> and <figcaption> should do the job: <figure> <blockquote cite=”https://developer.mozilla.org/samples/html/figure.html”> Quotes, parts of poems can also be a part of figure. </blockquote> <figcaption>MDN editors</figcaption> </figure> https://developer.mozilla.org/samples/html/figure.html <figure> <blockquote cite=”http://www.w3.org/html/wg/drafts/html/master/grouping-content.html#the-figure-element”> The figure element represents some flow content, optionally with a caption, that is self-contained and is typically referenced … Read more

Single quote escape in JavaScript function parameters

JSON.stringify(plainTextStr).replace(/&/, “&amp;”).replace(/”/g, “&quot;”) will produce a string you can safely embed in a quoted attribute and which will have the same meaning when seen by the JavaScript interpreter. The only caveat is that some Unicode newlines (U+2028 and U+2029) need to be escaped before being embedded in JavaScript string literals, but JSON only requires that … Read more

How to escape single quote in sed?

Quote sed codes with double quotes: $ sed “s/ones/one’s/”<<<“ones thing” one’s thing I don’t like escaping codes with hundreds of backslashes – hurts my eyes. Usually I do in this way: $ sed ‘s/ones/one\x27s/'<<<“ones thing” one’s thing

tech