- 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
| 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
| 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
| #!/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
| # 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
| <?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
| #!/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
| # Source: https://anggo.ro/note/installing-redis-in-ubuntu-wsl/ | |
| # Update and upgrade Ubuntu | |
| sudo apt update && apt upgrade | |
| # Install Redis | |
| sudo apt install redis-server | |
| # Update redis.conf file | |
| sudo nano /etc/redis/redis.conf |
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://gist.github.com/juanique/4092969#gistcomment-3078760 | |
| function git_add_ssh_key () { | |
| read -p "Enter github email : " email | |
| echo "Using email $email" | |
| if [ ! -f ~/.ssh/id_rsa ]; then | |
| ssh-keygen -t rsa -b 4096 -C "$email" | |
| ssh-add ~/.ssh/id_rsa | |
| fi | |
| pub=`cat ~/.ssh/id_rsa.pub` | |
| read -p "Enter github username: " githubuser |
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://news.ycombinator.com/item?id=25381535 | |
| # Usage: $ LONG-COMMAND; notifyme | |
| function notifyme() { | |
| MSG=${1:-'Terminal is done'} | |
| TITLE=${2:-"Done!"} | |
| osascript -e "display notification \"${MSG}\" with title \"${TITLE}\"" | |
| } |