Skip to content

Instantly share code, notes, and snippets.


Wogan May woganmay

  • Cape Town, South Africa
View GitHub Profile
woganmay /
Created Jun 25, 2020
Cache node_modules between deploys
# Use cached node_modules for faster frontend compile times
# on
# Rationale: If you don't want to set up node_modules caching on
# every server you deploy to, this drop-in deployment hook serves
# a similar purpose. It will symlink every new release to a shared
# node_modules folder, cutting out the installation time.
woganmay / bitbucket-pipelines.yml
Created Sep 11, 2019
Bitbucket CI Pipeline - Deploy Laravel Vapor
View bitbucket-pipelines.yml
# Prerequisites:
# 1. Have the laravel/vapor-cli dependency in your project, so that composer install catches it
# 2. Set the VAPOR_API_TOKEN environment variable to your Vapor API key
# Details in the documentation:
# This pipeline will build a PHP 7.2 environment with dependencies, run the standard
# phpunit tests, then deploy to the staging environment on Vapor.
image: php:7.2.22-alpine
woganmay /
Created Aug 24, 2019
Read Harvest timesheet data into a Google Sheet
function onOpen() {
var ui = SpreadsheetApp.getUi();
.addItem('Fetch Harvest', 'fetchHarvestData')
function fetchHarvestData() {
// Update monthly, or read from another sheet
woganmay / api.php
Created Jun 12, 2019
Detect new versions of app.js automatically
View api.php
// Ugly as sin, but gets the latest version URL for the app.js file
// The Vue app will query this every 60 seconds
Route::get('/version', function(){
$manifest = file_get_contents(public_path('mix-manifest.json'));
$manifest = json_decode($manifest);
return response()->json([
'latest' => $manifest->{'/js/app.js'}
woganmay /
Created Sep 7, 2018
Pull Toggl entries through the Reports API, into an incremental Sheet tab.
function onOpen() {
var ui = SpreadsheetApp.getUi();
ui.createMenu('My Business')
.addItem('Refresh Timesheets', 'getTimesheets')
function getTimesheets() {
// Read API token and Workspace ID from Configuration tab
woganmay / page.php
Created Nov 5, 2017
Simple HTTP POST request from an OctoberCMS form submission
View page.php
function onStart()
$flow = curl_init("");
curl_setopt($flow, CURLOPT_POST, TRUE);
curl_setopt($flow, CURLOPT_HTTPHEADER, [
'Content-Type: application/json'
woganmay / PixelController.php
Created Oct 2, 2017
Manage a tracking pixel
View PixelController.php
namespace App\Http\Controllers;
use App\Http\Requests;
use Illuminate\Http\Request;
use App\Jobs\SendOpened;
class PixelController extends Controller
View gist:de9bf6da8d23117e3f932c546f0581ae

This was all done on a Debian Linux server.


Install speedtest-cli by:

sudo easy_install speedtest-cli

That gives you a one-line command to run up/down tests via To hit a specific server, check the main list at and provide the ID to test against:

woganmay / script.js
Last active Feb 2, 2018
Gscript for Sheets - get crypto tickers and maintain a history
View script.js
// Sample workbook here:
// Main function - does everything
// Triggered by Google every 15 minutes
function getAllTickers() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Crypto");
// Get all tickers
View bloop.js
(function() {
// Do not use this library. This is just a fun example to prove a
// point.
var Bloop = window.Bloop = {};
var mountId = 0;
function newMountId() {
return mountId++;