Skip to content

Instantly share code, notes, and snippets.

View markf3lton's full-sized avatar

Mark Felton markf3lton

View GitHub Profile
@markf3lton
markf3lton / ACSF-htaccess.md
Last active September 25, 2019 20:29
Recommendations for .htaccess on Site Factory

Recommendations for .htaccess on Site Factory

This guide builds a set of .htaccess rules that are appropriate for common ACSF use cases and RCAB requirements.

1 - Default .htaccess

2 - ACSF requirement

3 — Force HTTP to HTTPS

#
# Apache/PHP/Drupal settings:
#
# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|install|make|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock)|web\.config)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$">
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
# From factory-hooks/post-settings-php/search-api-solr.php
<?php
/**
* @file
*
* Used to configure the most appropriate core depending on the environment
* currently in use. Site Factory and the Acquia Connector module vary
@markf3lton
markf3lton / blt-hands-on-tutorial.md
Last active February 1, 2023 18:24
BLT Hands On Tutorial
@markf3lton
markf3lton / geolocation-strategies.md
Created July 22, 2019 18:09
Approaches to geolocation

Geolocation strategies

Cloudflare adds the CF-IPCountry header to all incoming requests, other CDNs may have something similar.

You can the headers incoming in balancer traffic:

[12:25:19] [email protected]:/home/markfelton# varnishlog | grep CF-IPCountry
-   ReqHeader      CF-IPCountry: JP
- ReqHeader CF-IPCountry: JP

Getting Started with BLT on Windows

This is a work-in-progress notes stream of links that may be helpful for new Windows users, or macOS to Windows converters.

Create a free sandbox on Acquia Cloud

@markf3lton
markf3lton / install-cfcli.md
Last active August 9, 2019 14:02
Install CFCLI

Install CFCLI

CFCLI is available on Docker Hub. You will need to login with your Docker ID and password. The README is on GitHub.

You can use Docker to run a variety of apps like CFCLI, or develop PHP code in a local virtual machine.

If you already have Docker, update to the latest version. Otherwise, begin this tutorial by installing Docker for Windows or Mac.

Windows installation

@markf3lton
markf3lton / PHP_CodeSniffer-quick-start.md
Last active April 20, 2020 19:44
PHP CodeSniffer Quick Start

PHP_CodeSniffer Quick Start

PHP_CodeSniffer detects violations of a defined set of coding standards.

You can use it to prepare for PHP version upgrades. There is a set of sniffs that checks for PHP cross-version compatibility which allows you to analyze your code for compatibility with higher and lower versions of PHP.

To check your Drupal codebase, first clone it into a clean directory, and check out the correct branch (e.g. git checkout develop).

Install the PHPCompatibility sniffs

@markf3lton
markf3lton / Tokaido-quick-start.md
Last active June 14, 2019 15:39
Tokaido Quick Start

Tokaido Quick Start

Docker enables fast local environments. Tokaido gets you quickly up and running.

If you already have Docker, update to the latest version, otherwise, download Docker from https://docs.docker.com/docker-for-mac/install. You will need to login with your Docker ID and password.

Install Tokaido with Homebrew

@markf3lton
markf3lton / DDEV-quick-start.md
Last active July 12, 2019 20:21
DDEV quick start

DDEV Quick Start

Docker enables fast local environments. DDEV simplifies the use of Docker for PHP projects. With your project configuration can shared with others on the team and version-controlled for consistency and easier maintenance.

If you already have Docker, update to the latest version, otherwise, download Docker from https://docs.docker.com/docker-for-mac/install. You will need to login with your Docker ID and password.

Install Docker to your Applications folder as with any other app (perhaps add it to your macOS Dock as well).

Screenshot 2019-06-13 23 23 56