- Project (Drupal) is served on
/var/www/htmlin the Vagrant box - Local project files location:
c:\Users\username\Work\projects\my-project\repo\html - Guest machine IP is 10.0.2.2 (if this doesn't work, run
route -neein the VM and look for the gateway address)
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
| #!/bin/bash | |
| # Source: https://github.com/microsoft/WSL/issues/1350 | |
| tmp=`mktemp` | |
| powershell="/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe" | |
| trap ctrlC INT | |
| removeTempFiles() { | |
| rm -f $tmp |
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
| <?php | |
| function markup_shipping_rates($rates, $packages) | |
| { | |
| $percentage = 5; | |
| $cartTotal = WC()->cart->get_totals()['cart_contents_total']; | |
| $additionalFee = ($percentage * $cartTotal) / 100; | |
| if (isset($rates['enviashipping:1'])) { |
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
| # INSTALL | |
| curl https://get.acme.sh | sh | |
| # USE | |
| acme.sh --issue -d MYDOMAIN -d www.MYDOMAIN -w /home/USERNAME/public_html/ | |
| acme.sh --install-cert -d MYDOMAIN -d www.MYDOMAIN | |
| acme.sh --deploy -d MYDOMAIN -d www.MYDOMAIN --deploy-hook cpanel_uapi | |
| # Source: https://github.com/acmesh-official/acme.sh | |
| # Source: https://massingham.net/using-lets-encrypt-certificates-on-namecheap-shared-hosting-with-automatic-updates/ |
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
| #!/bin/bash | |
| # sleep is in seconds, to use minutes, hours, or days append m h or d like so: 10m, 3h, 4d | |
| function commit() { | |
| TIMESTAMP=$(date +%c) | |
| git pull | |
| git add . | |
| git commit -m "Auto update $TIMESTAMP" | |
| git push origin master | |
| } | |
| while true |
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
| add this in the site's .htaccess file: | |
| RewriteCond %{REQUEST_URI} !\.ts |
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
| Source: https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/ | |
| The HTML | |
| <body class="Site"> | |
| <header>…</header> | |
| <main class="Site-content">…</main> | |
| <footer>…</footer> | |
| </body> | |
| The CSS |
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
| 1. Hit ctrl+alt+esc | |
| 2. Hit Alt+F2, type r, and press Enter | |
| 3. Switch to another tty, for example tty6, by pressing Ctrl+Alt+F6 | |
| Run: | |
| pkill -HUP -f "cinnamon --replace" | |
| Return to tty8 by pressing Ctrl+Alt+F8 |
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
| (function (context, trackingId, options) { | |
| const history = context.history; | |
| const doc = document; | |
| const nav = navigator || {}; | |
| const storage = localStorage; | |
| const encode = encodeURIComponent; | |
| const pushState = history.pushState; | |
| const typeException = 'exception'; | |
| const generateId = () => Math.random().toString(36); | |
| const getId = () => { |
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
| #1 { | |
| // Source: https://www.apres.io/ | |
| h1 { | |
| font-family: Merriweather; | |
| weight: 900; | |
| font-size: 68px; | |
| } | |
| h2 { | |
| font-family: Merriweather; |