Skip to content

Instantly share code, notes, and snippets.

View hutch120's full-sized avatar

Simon Hutchison hutch120

View GitHub Profile
@hutch120
hutch120 / config.json
Last active March 21, 2024 08:32
Test the AWS SQS Queue functionality from a local server.
{
"accessKey": "",
"secretKey": "",
"sessionToken": "",
"region": "" ,
"queueUrl": ""
}
@hutch120
hutch120 / cross_country_bundoora_park.json
Last active May 2, 2022 23:43
Cross country bundoora park.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hutch120
hutch120 / gist:a53a9f484f7c2282dd8e0e6239ec3c91
Last active June 7, 2021 01:20
Booking a Vaccination at Northern Health
//
// Press F12 to open the web browser console
// Copy/Paste this script in the browser console to skip the questions at https://vaccination.nh.org.au/
//
function run () {
const showClasses = [
'wpforms-page wpforms-page-1',
'wpforms-page wpforms-page-2',
'wpforms-page wpforms-page-3',
@hutch120
hutch120 / download.js
Created July 4, 2019 05:55
Cut down for ES6 and ESLint compatibility
// download.js v4.21, by dandavis; 2008-2018. [MIT] see http://danml.com/download.html for tests/usage
// v1 landed a FF+Chrome compatible way of downloading strings to local un-named files, upgraded to use a hidden frame and optional mime
// v2 added named files via a[download], msSaveBlob, IE (10+) support, and window.URL support for larger+faster saves than dataURLs
// v3 added dataURL and Blob Input, bind-toggle arity, and legacy dataURL fallback was improved with force-download mime and base64 support. 3.1 improved safari handling.
// v4 adds AMD/UMD, commonJS, and plain browser support
// v4.1 adds url download capability via solo URL argument (same domain/CORS only)
// v4.2 adds semantic variable names, long (over 2MB) dataURL support, and hidden by default temp anchors
// https://github.com/rndme/download
export default function download (data, strFileName, strMimeType) {
@hutch120
hutch120 / mapbox-roundabout-issue.json
Created September 21, 2018 02:50
Mapbox output with roundabout issue
{
"routes": [
{
"geometry": "~_fiFc|fsZVL^?HKFALP|AN",
"legs": [
{
"summary": "Twentieth Avenue, Thirty Seventh Avenue",
"weight": 22.8,
"duration": 16.7,
"steps": [
@hutch120
hutch120 / bletest.html
Created September 28, 2017 00:26
Blue2 BLETest
<!DOCTYPE html>
<html lang="en">
<head>
<title>BLE Demo</title>
<!-- Meta -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@hutch120
hutch120 / delete_amis.js
Created June 12, 2017 03:11
AWS Lambda function to delete AMI backup images and associated snapshots
/**
* AWS Lambda function to delete AMI backup images and associated snapshots
* To be used in conjunction with create_amis.js
*/
var settings = {
'region': 'ap-southeast-2',
'retention_days': 7,
'ami_delete_tag_name': 'DeleteOn', // This tag name must match the one in the create_amis.js script.
'ami_delete_tag_value': 'yes',
'ami_deregister_wait_time_ms': 10000
@hutch120
hutch120 / create_amis.js
Last active June 21, 2022 16:37
AWS Lambda function to create AMI backup images and associated snapshots
/**
* AWS Lambda function to delete AMI backup images and associated snapshots
* To be used in conjunction with delete_amis.js
*/
var settings = {
'region': 'ap-southeast-2',
'noreboot': true,
'ec2backuptagname': 'Backup', // Add this tag to EC2 instances you wish to backup.
'ec2backuptagvalue': 'yes',
'amideletetagname': 'DeleteOn', // This tag name must match the one in the delete_amis.js script.
@hutch120
hutch120 / lambdaAMIBackups.py
Created June 10, 2017 03:48 — forked from bkozora/lambdaAMIBackups.py
AWS Lambda AMI Backups
# Automated AMI Backups
#
# @author Robert Kozora <bobby@kozora.me>
#
# This script will search for all instances having a tag with "Backup" or "backup"
# on it. As soon as we have the instances list, we loop through each instance
# and create an AMI of it. Also, it will look for a "Retention" tag key which
# will be used as a retention policy number in days. If there is no tag with
# that name, it will use a 7 days default value for each AMI.
#
@hutch120
hutch120 / model.js
Last active January 16, 2017 01:48
Model Controller
'use strict'
/** USAGE **
HTML requires script:
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.4/lodash.min.js"></script>
Attempts to load /config/mysite.json
Provides get/set methods using string paths