Skip to content

Instantly share code, notes, and snippets.

Avatar

Duncan Isaksen-Loxton 65

View GitHub Profile
@65
65 / gamselect.sh
Last active Nov 17, 2021
Helper file for for Google Workspace (GSuite) Resellers using GAMADV-XTD3 and need to swap between resold customers regularly
View gamselect.sh
#!/bin/bash
# Set the path to the GAM you want to use
GAM=$HOME/bin/gamadv-xtd3/gam
FILE=$HOME/GAMConfig/gam.cfg
VALIDCUSTOMER='Customer Domain Verified: True'
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
NORMAL=$(tput sgr0)
MAGENTA=$(tput setaf 5)
@65
65 / mailchimp-googlescript.txt
Last active Jan 15, 2022
On Google Spreadsheet / Google Form submission, push new entry to a MailChimp subscription list with an `onformsubmit` trigger. Uses the MailChimp 3.0 API and Google Apps Script.
View mailchimp-googlescript.txt
/**
* Mailchimp API v3
* Add a subscriber to a list with interests on Google Form submit
*
* Updated to 3.0 from https://gist.github.com/acarrillo/5772508
*
* Edit the Google Sheet connected to your form
* Menu > Tools > Script Editor
* Copy and paste this into the file, remove anything there already
* Update the variables in the top section
View GeoJSON Final File
{
"style_buildings":{
"color": "#0000ff",
"weight":"1"
},
"style_green":{
"color": "#00ff00",
"weight":"3"
},
"style_red":{
@65
65 / GeoJSON Style definitions
Last active Aug 29, 2015
GeoJSON Style definitions
View GeoJSON Style definitions
"style_buildings":{
"color": "#0000ff",
"weight":"1"
},
"style_green":{
"color": "#00ff00",
"weight":"3"
},
"style_red":{
"color": "#ff0000",
@65
65 / Buildings GeoJSON
Last active Aug 29, 2015
Medic52 GeoJSON Examples
View Buildings GeoJSON
"buildings":{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[148.391956873,-36.41520944409831,0],
@65
65 / complete.js
Last active Aug 29, 2015
Gmail Script - email to pdf to xero
View complete.js
function send_Gmail_as_PDF() {
var gLabel = "#Receipt";
var thread = GmailApp.search("label:" + gLabel);
for (var x = 0; x < thread.length; x++) {//for all emails
var messages = thread[x].getMessages();
for (var y = 0; y < 1; y++) {// only do on the first email, use messages.length otherwise
var attach = messages[y].getAttachments();
@65
65 / icon.html
Created Jun 18, 2013
Apple touch icons
View icon.html
<link rel="apple-touch-icon" href="/media/pics/site/ios.png">
@65
65 / createtable.sql
Last active Dec 14, 2015
Create SQL server deadlock simulation
View createtable.sql
Create table vin_deadlock (id int, Name Varchar(30))
GO
Insert into vin_deadlock values (1, 'Vinod')
Insert into vin_deadlock values (2, 'Kumar')
Insert into vin_deadlock values (3, 'Saravana')
@65
65 / timer.js
Created Mar 12, 2012
Ajax suggest - bash your SQL server!
View timer.js
// set property timer to zero initially
var propertyTimerID = 0;
function timeProperty() {
// if property timer is set
if(propertyTimerID) {
// clear it
clearTimeout(propertyTimerID);
}
// set it to fire a second from now
propertyTimerID = self.setTimeout('getPropertyHelper()', 1000);
@65
65 / XMPPConnection.cfm
Created Mar 11, 2012
Java Library for instant messaging over XMPP - Smack
View XMPPConnection.cfm
<cfset XMPPConnection = createObject("java", "org.jivesoftware.smack.XMPPConnection").init("localhost")>