Skip to content

Instantly share code, notes, and snippets.

View paulsheldrake's full-sized avatar

Paul Sheldrake paulsheldrake

  • Vancouver, Canada
View GitHub Profile
@paulsheldrake
paulsheldrake / circle.yaml
Last active September 17, 2024 18:09 — forked from sfgov-mikela/circle.yaml
SF Gov AWX Drupal deployment CircleCI config
# Set this environment variable using the Circle CI admin
# TOWER_OAUTH_TOKEN="<access token value>"
SLACK_WEBHOOK: &SLACK_WEBHOOK "https://hooks.slack.com/services/123/XXX/YYY"
BRANCH_PROD: &BRANCH_PROD "main"
BRANCH_STAGE: &BRANCH_STAGE "staging"
BRANCH_DEV: &BRANCH_DEV "dev"
SSH_HOST_PROD: &SSH_HOST_PROD "123.123.123.123"
SSH_HOST_STAGE: &SSH_HOST_STAGE "123.123.123.123"
SSH_HOST_DEV: &SSH_HOST_DEV "123.123.123.123"
AWX_DEPLOY_ID_PROD: &AWX_DEPLOY_ID_PROD "123"
{
  "objectID": "",  
  "nid": "",
  "label": "",, // String title of node
  "image": "",, // String Absolute path to image
  "entity_type": "", // String Entity type
  "root_nid": // top level index nid.   I.E.   The Austrian
  "parent_nid": // node that is referencing this item.   The Austrian vol. 9 (2023)
  "taxonomy_tags:": [
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{DOCUMENT_ROOT}/$1 -f [OR]
RewriteCond %{DOCUMENT_ROOT}/$1 -d
RewriteRule (.*) - [L]
#
# Else proxy
RewriteRule ^/(.*)$ ##DOMAIN##/$1 [P,QSA]
ProxyPassReverse / ##DOMAIN##
@paulsheldrake
paulsheldrake / facetapi_slider_disable_slider.patch
Last active December 15, 2020 00:21
disable the jquery slider
diff --git a/sites/all/modules/contrib/facetapi_slider/plugins/facetapi/widget_slider.inc b/sites/all/modules/contrib/facetapi_slider/plugins/facetapi/widget_slider.inc
index 47d176f4a..1e9d2d9ea 100644
--- a/sites/all/modules/contrib/facetapi_slider/plugins/facetapi/widget_slider.inc
+++ b/sites/all/modules/contrib/facetapi_slider/plugins/facetapi/widget_slider.inc
@@ -61,6 +61,9 @@ class FacetapiWidgetSlider extends FacetapiWidget {
$slider['#range_max'] = isset($slider['#range_max']) ? $slider['#range_max'] : $slider['#global_range_max'];
}
// Kanopi patch end
+ $this->build[$this->facet['field alias']][$this->facet['field']] = $slider;
+
@paulsheldrake
paulsheldrake / acf_url_as_html.php
Last active October 16, 2020 23:17
Output an ACF url field as html. Also allow for extra attributes.
/**
* Output ACF url field as HTML.
*
* Optionally add attributes to the link as an array.
*
* Example:
*
* acf_format_link('cp_flex_tab_1', ['class' => 'btn btn-large', 'data-id' => 123]);
*
* Will render the field like so.
@paulsheldrake
paulsheldrake / blazy_youtube_nocookie.patch
Created October 9, 2020 18:02
Update Blazy Drupal module to make all videos not autoplay and use the nocookie url.
diff --git a/src/BlazyMedia.php b/src/BlazyMedia.php
index a996b32..7129204 100644
--- a/src/BlazyMedia.php
+++ b/src/BlazyMedia.php
@@ -46,6 +46,20 @@ class BlazyMedia {
$allow = $iframe_attributes['allow'] = 'autoplay; accelerometer; encrypted-media; gyroscope; picture-in-picture';
}
+ // Update Youtube to not be no-cookie and not autoplay.
+ if (strpos($iframe_attributes["data-src"], 'youtu') !== FALSE) {
#!/bin/bash
# Find security updates
MODULE_LIST_FILENAME=module_list
rm $MODULE_LIST_FILENAME #This is just for local dev testing
touch $MODULE_LIST_FILENAME
terminus auth:login
terminus drush prepme.live -- ups --security-only --pipe > $MODULE_LIST_FILENAME
# Check if there are things to update
@paulsheldrake
paulsheldrake / Country codes
Created May 14, 2020 18:02
jVectormap World Map with all countries
AF : Afghanistan
AX : Aland Islands
AL : Albania
DZ : Algeria
AS : American Samoa
AD : Andorra
AO : Angola
AI : Anguilla
AG : Antigua and Barbuda
AR : Argentina
@paulsheldrake
paulsheldrake / jvectormap_parse_svg.php
Last active May 15, 2020 12:54
Parse an SVG to get data for jvectormap js file
This file has been truncated, but you can view the full file.
<?php
$amchart_map_svg = '<?xml version="1.0" encoding="utf-8"?>
<!-- (c) ammap.com | SVG map of World - High -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:amcharts="http://amcharts.com/ammap" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
<defs>
<style type="text/css">
.land
{
fill: #CCCCCC;
fill-opacity: 1;