Skip to content

Instantly share code, notes, and snippets.

View hutch120's full-sized avatar

Simon Hutchison hutch120

View GitHub Profile
{
"template": {
"layername": "DataGovAu",
"overrides": {
"title": "Libraries",
"group": "Cultural Centres",
"style": {
"src": "img/font-awesome/white/book.svg",
"bubbleBackground": "#BCA9F5"
},
@hutch120
hutch120 / SaveAsCSV.vbs
Last active July 18, 2020 23:43
Save Excel worksheet as CSV
'
' This VBS script opens an MS Excel Workbook, sets the active sheet, and saves that sheet to CSV.
'
' Usage:
' cscript //nologo saveascsv.vbs "source.xls" "worksheetname" "output.csv"
' cscript //nologo saveascsv.vbs "c:\temp\SaveAsCSV\Book1.xlsx" "Sheet2" "c:\temp\SaveAsCSV\output.csv"
'
if WScript.Arguments.Count < 3 Then
' One WScript.Echo in case user doesnt put cscript //nologo and would otherwise have to press enter a bunch of times.
WScript.Echo "Usage:" & vbCRLF & _
@hutch120
hutch120 / pdfmake.tsiegleauq.vfs_fonts.min.js
Created August 24, 2016 01:45
Combined PDFMake and VFS_fonts and minified
This file has been truncated, but you can view the full file.
!function(a){function c(d){if(b[d])return b[d].exports;var e=b[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,c),e.loaded=!0,e.exports}var b={};return c.m=a,c.c=b,c.p="",c(0)}([function(a,b,c){(function(b){a.exports=b.pdfMake=c(1)}).call(b,function(){return this}())},function(a,b,c){(function(b){"use strict";function h(a,b,c){this.docDefinition=a,this.fonts=b||g,this.vfs=c}var d=c(6),e=c(105),f=e.saveAs,g={Roboto:{normal:"Roboto-Regular.ttf",bold:"Roboto-Medium.ttf",italics:"Roboto-Italic.ttf",bolditalics:"Roboto-Italic.ttf"}};h.prototype._createDoc=function(a,c){var e=new d(this.fonts);e.fs.bindFS(this.vfs);var h,f=e.createPdfKitDocument(this.docDefinition,a),g=[];f.on("data",function(a){g.push(a)}),f.on("end",function(){h=b.concat(g),c(h,f._pdfMakePages)}),f.end()},h.prototype._getPages=function(a,b){if(!b)throw"getBuffer is an async method and needs a callback argument";this._createDoc(a,function(a,c){b(c)})},h.prototype.open=function(a){var b=window.open("","_blank");try{this.getDat
@hutch120
hutch120 / pdfmake-tsiegleauq.min.js
Created August 24, 2016 01:48
Minified pdfmake from tsiegleauq updates
!function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b,c){(function(b){a.exports=b.pdfMake=c(1)}).call(b,function(){return this}())},function(a,b,c){(function(b){"use strict";function d(a,b,c){this.docDefinition=a,this.fonts=b||h,this.vfs=c}var e=c(6),f=c(105),g=f.saveAs,h={Roboto:{normal:"Roboto-Regular.ttf",bold:"Roboto-Medium.ttf",italics:"Roboto-Italic.ttf",bolditalics:"Roboto-Italic.ttf"}};d.prototype._createDoc=function(a,c){var d=new e(this.fonts);d.fs.bindFS(this.vfs);var f,g=d.createPdfKitDocument(this.docDefinition,a),h=[];g.on("data",function(a){h.push(a)}),g.on("end",function(){f=b.concat(h),c(f,g._pdfMakePages)}),g.end()},d.prototype._getPages=function(a,b){if(!b)throw"getBuffer is an async method and needs a callback argument";this._createDoc(a,function(a,c){b(c)})},d.prototype.open=function(a){var b=window.open("","_blank");try{this.getDat
'use strict'
/**
* Test Adapter
*/
// A (Adapter)-> TestAdapter function is implemented in order to follow the standard Adapter pattern
function TestAdapter(optionalGlobals) {
/**
* Handle some request
@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
@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 <[email protected]>
#
# 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 / 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 / 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 / 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">