Skip to content

Instantly share code, notes, and snippets.

Avatar

Glenn Walker walkergv

View GitHub Profile
@walkergv
walkergv / pulautin.gs
Created Dec 17, 2019 — forked from molybo/pulautin.gs
Yle Skenaariopeli - Korttipulautin
View pulautin.gs
function onOpen() {
var ui = SpreadsheetApp.getUi();
ui.createMenu('Korttipulautin')
.addItem('Luo Ilmiökortit', 'createScenarioCards')
.addItem('Luo Linssikortit', 'createLensCards')
.addToUi();
}
function getNamedRange(name) {
var sheet = SpreadsheetApp.getActive();
@walkergv
walkergv / slidesAppSctipt.js
Created Dec 17, 2019
Playing around with Google Slides App Script
View slidesAppSctipt.js
function myFunction() {
var currentPresentation = SlidesApp.getActivePresentation();
var obj = currentPresentation.getSlides();
var Master = currentPresentation.getMasters();
var Layouts = Master[1].getLayouts();
for (var i = 0; i < Layouts.length; i++){
Logger.log("Layout = " + Layouts[i].getLayoutName());
var Elements = Layouts[i].getPageElements()
for (var j = 0; j < Elements.length; i++){
@walkergv
walkergv / eventTracker.js
Created Apr 27, 2016
Unbounce Event Tracker Script
View eventTracker.js
<script type='text/javascript'>
(function() {
var EventTracker, lpScriptVersion;
lpScriptVersion = "1.2.0";
(function(i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function() {
(i[r].q = i[r].q || []).push(arguments)
@walkergv
walkergv / faq.schema.org.json.html
Last active Jan 30, 2020
Frequently Asked Questions (FAQ) Pages Schema.org JSON-LD format
View faq.schema.org.json.html
<!--When a JSON-LD document's top-level structure is an object that contains no other
properties than @graph and optionally @context (properties that are not mapped to an IRI
or a keyword are ignored), @graph is considered to express the otherwise implicit default graph.
This mechanism can be useful when a number of nodes exist at the document's top level that
share the same context, which is, e.g., the case when a document is flattened. The @graph
keyword collects such nodes in an array and allows the use of a shared context.
From https://www.w3.org/TR/json-ld/#h3_named-graphs
More on graph - http://stackoverflow.com/questions/30505796/json-ld-schema-org-multiple-video-image-page/30506476#30506476
@walkergv
walkergv / powerpoint.macro.layouts.vba
Last active Aug 29, 2015
List layouts of each PowerPoint slide in a deck using a Macro.
View powerpoint.macro.layouts.vba
Public Sub LayoutDebug()
Dim oPres As Presentation
Dim oSld As Slide
Set oPres = ActivePresentation
For Each oSld In oPres.Slides
Debug.Print oSld.SlideIndex & " - " & oSld.CustomLayout.Name
Next
End Sub
@walkergv
walkergv / privacy.policy.txt
Created Apr 29, 2015
Privacy Policy Boilerplate
View privacy.policy.txt
Privacy Policy
Your privacy and security are important to us.
We recognize and respect your need for privacy and security as you visit our site. When you visit our site to view any pages, read product information, or use our on-line calculators and tools, you do so without telling us who you are and without revealing any personal information. While we do not collect identifying information about visitors to our site, we do use standard software to collect information for the strict purpose of tracking activity on our site. This allows us to better understand how many people use our site and which pages and features are most popular. The only information we normally collect and store is:
The name of your Internet service provider
The web site that referred you to us (if any)
The date and time the pages were accessed
The page or pages you requested
@walkergv
walkergv / gtm.tampermonkey.js
Last active Sep 20, 2019
Adding GTM (Google Tag Manager) Container Code using Tampermonkey
View gtm.tampermonkey.js
// ==UserScript==
//@name Name of your script
//@namespace http://use.i.E.your.homepage/
//@version 0.1
//@description Inject GTM bootstrap on my website
//@include http://www.domain.com/* [wildcard url where GTM should inject the code]
// ==/UserScript==
// Google Tag Manager
setTimeout("(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':"+
@walkergv
walkergv / mailt0-scraper.appscript.js
Created Feb 12, 2015
Scrapes a list of sites and gathers the values of mailto links
View mailt0-scraper.appscript.js
function scrapeAndGetEmail() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("Sheet1");
var array = sheet.getDataRange().getValues();
var emails = [];
var i = 0;
for (i = 0; i < array[0].length; i++){
var URL = array[i][0].toString();
var response = UrlFetchApp.fetch(URL);
@walkergv
walkergv / .htaccess
Created Feb 9, 2015
Redirect old domain to a new domain in .htaccess file
View .htaccess
## Gets an the old domain and any sub page and redirects it to the new domain and any path after the hostname.
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^olddomain.com$
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L]
@walkergv
walkergv / multiselect.excel.vba
Created Feb 5, 2015
Create a multiselect excel macro
View multiselect.excel.vba
'
' taken from the website for instructions http://www.contextures.com/excel-data-validation-multiple.html
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngDV As Range
Dim oldVal As String
Dim newVal As String
If Target.Count > 1 Then GoTo exitHandler