Skip to content

Instantly share code, notes, and snippets.

View bmcclure's full-sized avatar

Ben McClure bmcclure

View GitHub Profile
@bmcclure
bmcclure / html.tpl.php
Created February 17, 2020 20:31
OneTrust Cookie Consent snippet for Pantheon
<?php $cookieScriptId = '[SITE_ID]'; ?>
<?php if (!isset($_SERVER['PANTHEON_ENVIRONMENT']) || ($_SERVER['PANTHEON_ENVIRONMENT'] !== 'live')) : ?>
<?php $cookieScriptId .= '-test'; ?>
<?php endif; ?>
<!-- OneTrust Cookies Consent Notice start -->
<script src="https://cdn.cookielaw.org/scripttemplates/otSDKStub.js" charset="UTF-8" data-domain-script="<?php echo $cookieScriptId; ?>"></script>
<script>
function OptanonWrapper() { }
</script>
<!-- OneTrust Cookies Consent Notice end -->
@bmcclure
bmcclure / one-trust-cookie-consent-reload.js
Last active August 15, 2023 10:52
OneTrust Cookie Consent JS conflict workaround
@bmcclure
bmcclure / composer.json
Created December 6, 2017 15:54
Set up SMTP mail sending on a custom PHP site
{
"name": "topfloor/project-domain",
"description": "",
"minimum-stability": "stable",
"license": "proprietary",
"authors": [
{
"name": "Developer Name",
"email": "developer@email.address"
@bmcclure
bmcclure / AssetGathererComponent
Created August 24, 2011 04:45
AssetGathererComponent for CakePHP 2.0 which is not working properly
<?php
class AssetGathererComponent extends Component {
public $settings = array(
'mainJs' => 'main',
'mainCss' => 'main',
'requiredJs' => array(),
'requiredCss' => array(),
'controllersPath' => 'controllers',
'includeNamespaceJs' => '/auto_asset/js/namespace',
'includeScriptJs' => '/auto_asset/js/script.min',