Skip to content

Instantly share code, notes, and snippets.

View ShaneDunn's full-sized avatar

Shane Dunn ShaneDunn

  • Leeton, NSW 2705 Australia
  • 08:01 (UTC +11:00)
View GitHub Profile
[
{
"id": "667fdf0f9a80a951",
"type": "tab",
"label": "GrapeWeb v3",
"disabled": false,
"info": "",
"env": []
},
{
@ShaneDunn
ShaneDunn / download.sh
Created July 21, 2017 02:53
Download "Largest FREE Microsoft eBook Giveaway" curl script
curl –compressed -sD – -L -e “http://google.com” -A “Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)” “https://blogs.msdn.microsoft.com/mssmallbiz/2017/07/11/largest-free-microsoft-ebook-giveaway-im-giving-away-millions-of-free-microsoft-ebooks-again-including-windows-10-office-365-office-2016-power-bi-azure-windows-8-1-office-2013-sharepo/” | grep -E -i “PDF” | sed -n ‘s/.*href=”\([^”]*\).*/\1/p’
@ShaneDunn
ShaneDunn / logging.gs
Last active July 17, 2017 00:46
Google Apps Script - Looging functions
/**
* Logging and configuration functions adapted from the script:
* 'A Google Apps Script for importing CSV data into a Google Spreadsheet' by Ian Lewis.
* https://gist.github.com/IanLewis/8310540
* @author ianmlewis@gmail.com (Ian Lewis)
* @author dunn.shane@gmail.com (Shane Dunn)
* De Bortoli Wines July 2017
*/
/* =========== Globals ======================= */
/**
@ShaneDunn
ShaneDunn / config.gs
Created July 17, 2017 00:38
Google Apps Script to read configuration information from a spreadsheet
/**
* Logging and configuration functions adapted from the script:
* 'A Google Apps Script for importing CSV data into a Google Spreadsheet' by Ian Lewis.
* https://gist.github.com/IanLewis/8310540
* @author ianmlewis@gmail.com (Ian Lewis)
* @author dunn.shane@gmail.com (Shane Dunn)
* De Bortoli Wines July 2017
*/
/* =========== Globals ======================= */
var CONFIG_SHEET = 'Configuration';
/* =========== Setup Menu ======================= */
/**
* Create a Menu when the script loads. Adds a new csvconfig sheet if
* one doesn't exist.
*/
function onOpen(e) {
var ui = SpreadsheetApp.getUi();
// Or DocumentApp or FormApp.
ui.createMenu('DBW Menu')
.addItem('Weight Adjustment Report', 'createReport')
@ShaneDunn
ShaneDunn / update_calendar.gs
Created February 4, 2017 07:49
A google script to take spreadsheet events (a Football Draw) and load them into the google Calendar
//add a menu when the spreadsheet is opened
function onOpen() {
var ui = SpreadsheetApp.getUi();
// Or DocumentApp or FormApp.
ui.createMenu('Calendar Menu')
.addItem('Update Calendar', 'pushToCalendar')
.addToUi();
}
//push new events to calendar
@ShaneDunn
ShaneDunn / load_old_ncc_data.gs
Last active November 13, 2016 00:59
A script to automate data load from existing National Cold Call spreadsheet.
/**
* == A script to automate data load from existing National Cold Call spreadsheet. ==
*
* Adapted from and using the logging and configuration functions from the script:
* 'A Google Apps Script for importing CSV data into a Google Spreadsheet' by Ian Lewis.
* https://gist.github.com/IanLewis/8310540
* @author ianmlewis@gmail.com (Ian Lewis)
* @author dunn.shane@gmail.com (Shane Dunn)
* De Bortoli Wines Nov 2016
*/
curl -H "Content-Type: application/json" -X POST -d '{"authentication": {"username": "sdun","password": "xxxx"},"call": {"library": "dbgmvint.p", "procedure": "getVintage"}}' http://visched-dev.debortoli.private:3000/qad
curl -H "Content-Type: application/json" -X POST -d '{"authentication": {"username": "****","password": "****"},"call": {"library": "dbgmblock.p","procedure": "getSingleBlockDetail", "filters": [{"procedure": "getSingleBlockDetail", "block_ids": [337, 339, 1150]}]}}' http://visched-dev.debortoli.private:3000/qad
curl -H "Content-Type: application/json" -X POST -d '{"authentication": {"username": "****","password": "****"},"call": {"library": "dbgmblock.p","procedure": "setActualBlockTest", "action": [{"procedure": "setActualBlockTest", "block_id": 337, "date": "2015-01-05", "sequence": 43200, "source": "V"}]}}' http://visched-dev.debortoli.private:3000/qad
curl -H "Content-Type: application/json" -X POST -d '{"authentication": {"username": "****","password": "****"},"call": {"library": "dbgmb