It can be embeded independently of the other files in the Gist using the url below.
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
| <!-- Added to the advanced section on each Arabic page to make text RTL --> | |
| <script> | |
| document.addEventListener('DOMContentLoaded', function() { | |
| // Set language | |
| document.body.setAttribute('data-lang', 'ar'); // For Arabic pages | |
| // Set text direction | |
| document.body.setAttribute('data-dir', 'rtl'); // For Right-to-Left text direction | |
| }); | |
| </script> |
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
| <!-- To allow a user to creat an account even though the create account buton is hidden, go to: | |
| https://example.com/account/login/create | |
| These urls access account details that are not available when the script is hiding the links to them: | |
| https://example.com/account | |
| https://example.com/account/digital-products | |
| --> | |
| <script> | |
| /*! | |
| * Hide Create Account Link | |
| * Author: Michael Mashay <[email protected]> |
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
| <!-- These redirects do not help with SEO, they are just to ensure users end up on the desired page if following an link from an old single page site that used anchors instead of pages for different sections.--> | |
| <script> | |
| /* Redirect home page anchors from old site to relevant page on this site */ | |
| const redirects = { | |
| '#about': '/about-me', | |
| '#contact': '/contact', | |
| '#service': '/services' | |
| }; | |
| if (window.location.pathname === '/') { |
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
| # return 1 if alive, 0 if dead | |
| ping_success() { | |
| ! ping -c1 -W1 8.8.8.8 >/dev/null 2>&1 | |
| } | |
| # Spinner taken from https://stackoverflow.com/a/12498395 | |
| spinnerindex=0 | |
| spinner='-\|/' | |
| sleepy_spinner() { | |
| for (( i=0; i<$(($1 * 2)); i++ )) |
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
| Snippet: [[SnippetName]] | |
| Chunk: [[$ChunkName]] | |
| System Setting: [[++SettingName]] | |
| TV: [[*fieldName/TvName]] | |
| Link tag: [[~PageId? ¶mName=`value`]] | |
| Placeholder: [[+PlaceholderName]] | |
| <?php |
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
| ———————————————————————————————————————————————————————————————————————————————————————————————————— | |
| BBEDIT/TEXTWRANGLER REGULAR EXPRESSION GUIDE MODIFIED 2016/02/29 17:26 | |
| ———————————————————————————————————————————————————————————————————————————————————————————————————— | |
| NOTES: | |
| The PCRE engine (Perl Compatible Regular Expressions) is what BBEdit and TextWrangler use. | |
| Items I'm unsure of are marked '# PCRE?'. The list while fairly comprehensive is not complete. |