Skip to content

Instantly share code, notes, and snippets.

@Greg-Boggs
Greg-Boggs / gist:1529d9e977703500bda11f35016b1e4d
Created August 17, 2021 20:17
Sample Github actions for a Drupal 9 site.
name: PHP Composer
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
tests:
@Greg-Boggs
Greg-Boggs / defaul.vcl
Created June 28, 2021 19:17
Fastly VCL example
pragma optional_param geoip_opt_in true;
pragma optional_param max_object_size 20971520;
pragma optional_param smiss_max_object_size 20971520;
pragma optional_param fetchless_purge_all 1;
pragma optional_param default_ssl_check_cert 1;
pragma optional_param max_backends 5;
pragma optional_param customer_id "69tE1aWeLLcC9NVLbklz7g";
C!
W!
# Backends
@Greg-Boggs
Greg-Boggs / ridwell waste.html
Last active June 25, 2021 00:13
Where does Ridwell send Waste in Portland (6/24/21)?
The website didn't really say where our trash ends up. So, I asked them via email where the trash from Portland Oregon goes.
#!/bin/bash
#set -e
cd ~
xcode-select --install
# install homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
#composer

Day 1

Chest

3 x 25 pushups (Used to do bench press, but that hurt my shoulder, so I stopped doing them I'd probably use a machine for these if I had a gym.)

3 x 6-12 dumbbell flies on the floor (I'd probably also do these on a machine )

3 x 8-12 standing low dumbbell chest fly (I'd use a cable for these if I had one and I would throw in some dips if I had bars)

@Greg-Boggs
Greg-Boggs / settings.php
Last active June 21, 2021 18:05
settings.php on platform.sh
<?php
// ... default drupal 9 stuff...
// Include automatic Platform.sh settings.
if (file_exists(__DIR__ . '/settings.platformsh.php')) {
require_once(__DIR__ . '/settings.platformsh.php');
}
// Include local settings. These come last so that they can override anything.
$on_platformsh = !empty($_ENV['PLATFORM_PROJECT']);
@Greg-Boggs
Greg-Boggs / route.php
Last active May 12, 2021 19:19
How to print a platformsh route for your environment in PHP
<?php
$projectId = getenv('PLATFORM_PROJECT');
// A JSON-encoded value.
$projectId = getenv('PLATFORM_PROJECT');
// A JSON-encoded value.
$routes = json_decode(base64_decode(getenv('PLATFORM_ROUTES')), TRUE);
@Greg-Boggs
Greg-Boggs / delete_nodes.php
Last active April 27, 2021 17:49
Delete some nodes with a drush command
#!/usr/bin/env drush
//
// Usage: Edit the query as you need.
//
// drush scr --uri=events.lndo.site delete-nodes.php
//
// See `drush topic docs-scripts` for more information.
//
drush_print("Hello world!");
@Greg-Boggs
Greg-Boggs / updates.sh
Last active December 3, 2020 22:32
Update drupal 7 core with Lando
lando restart; lando drush cc all; lando drush up drupal -y; git add .; git commit -am 'security updates'; git pull; git push
@Greg-Boggs
Greg-Boggs / webhook.php
Created April 9, 2020 02:30
Example webhook
<?php
try {
$payload = json_decode($_REQUEST['payload']);
if ($payload->ref === 'refs/heads/master') {
$output = array();
// Pull Data
exec('cd /var/www && /usr/bin/git pull', $output);
print($output[0]);