This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
// Paste these into a `.code-snippets` file in VS Code. | |
"php echo open and close": { | |
"scope": "php, html", | |
"prefix": "phpe", | |
"body": [ | |
"<?= $0; ?>" | |
] | |
}, | |
"php open and close brackets": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- BAD --> | |
<div> | |
<a href="https://twitter.com/pickleat">Made with ❤ by Andy Pickle</a> | |
</div> | |
<!-- Good! --> | |
<a href="https://twitter.com/pickleat"> | |
Made with <span role="img" aria-label="love">❤</span> by Andy Pickle | |
</a> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
useEffect( () => { | |
// formats the Markdown | |
function styleChildren(children) { | |
children.forEach((child) => { | |
let tagIt = child.tagName | |
child.classList = blogStyle[tagIt] | |
if(tagIt === 'CODE' && child.innerText.length > 15){child.classList = longCode[tagIt]} | |
if(tagIt === 'CODE' && child.innerText.length <= 15){child.classList = shortCode[tagIt]} | |
if(child.children) { | |
let grandChildren = [...child.children] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
useEffect(() => { | |
// Cleans up the text provided by QuillJS wysiwyg | |
function styleChildren(children) { | |
children.forEach((child) => { | |
if (child.tagName === 'H1') { | |
child.classList = quillStyle.h1 | |
} | |
if (child.tagName === 'H2') { | |
child.classList = quillStyle.h2 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
<h1>An Example Heading!</h1> | |
<p><br></p> | |
<p>Here's a bunch of paragraph text that shows you | |
<strong>how awesome it is</strong> | |
to write here!</p> | |
<p><br></p> | |
<p>Here's a list: </p> | |
<ul> | |
<li>Item</li> |