Skip to content

Instantly share code, notes, and snippets.

@michalsen
michalsen / lando_wsl
Last active July 19, 2023 12:19
Lando and Windows
# Installing Docker CE and Lando inside of WSL2
# This solution was found here: https://github.com/lando/lando/issues/1723
#=================================
# Install WSL2
#=================================
# Inside an Administrator session of PowerShell
wsl --install
<?php
// Total Execution Time: 134 Min
$time_start = microtime(true);
$handle = fopen("sn_urls.inc", "r");
// $handle = fopen("equipment.inc", "r");
// $handle = fopen("positions.inc", "r");
@michalsen
michalsen / WPEngine DevKit
Created July 18, 2019 19:45
WP ENGINE DevKit Local Development
// Installation:
https://developer.wpengine.com/devkit/installation.html
// Getting Started
https://developer.wpengine.com/devkit/getting_started.html
// Clone Down Site
wpe clone <site>
wpe start
wpe projects list
wp plugin install one-time-login --activate && wp user one-time-login <user>
<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
RewriteEngine on
RewriteCond %{HTTP_HOST} ^site.net [NC,OR]
RewriteCond %{HTTP_HOST} ^www.site.net [NC]
RewriteRule ^(.*)$ http://www.site.com/$1 [L,R=301,NC]
@michalsen
michalsen / wp_lando.md
Last active March 27, 2018 16:33
Wordpress / Lando Setup

Setup of WP in a lando machine

mkdir YOURSITE
cd YOURSITE

git clone https://github.com/WordPress/WordPress .
lando init --recipe wordpress

.lando.yml (currently only for reference)

@michalsen
michalsen / vmsetup.md
Last active October 12, 2017 01:27
Local Wordpress Development using Vagrant

Examples will be shown using MacOS and Vagrant virtual machine (https://www.vagrantup.com/). Windows developers can aslo refer to https://www.sitepoint.com/getting-started-vagrant-windows/ on getting Vagrant up and running.

Once Vagrant is installed, a Scotch Box virtual machine will be used.

Step by Step (5 minute install)

  • Move to your local directory where you would like your local development. For me it is ~/Sites
  • git clone https://github.com/scotch-io/scotch-box SITENAME (this installs the VM into the directory SITENAME)
  • cd SITENAME (go into directory)
  • vagrant up (start Vagrant)
@michalsen
michalsen / gist:66a0019d76dbca703dd1103937d7a594
Last active September 29, 2017 20:05
Sales Force Lead Assignment
Round Robin
https://www.youtube.com/watch?v=408po8mEGcM
Google Calendar API
https://developers.google.com/google-apps/calendar/quickstart/php
https://developers.google.com/google-apps/calendar/v3/reference/events/list
https://developers.google.com/google-apps/calendar/v3/reference/events/get
@michalsen
michalsen / gist:af392186de75c1be5dc7298d65f58484
Created September 25, 2017 19:03
WordPress force https
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]