Skip to content

Instantly share code, notes, and snippets.

View williamjulianvicary's full-sized avatar

William Julian-Vicary williamjulianvicary

View GitHub Profile
@williamjulianvicary
williamjulianvicary / gist:9083663e45444f7670da65b96f37e1a5
Created May 18, 2020 14:42 — forked from rodrigopedra/gist:a4a91948bd41617a9b1a
Laravel 5 Middleware for Database Transactions
<?php namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Response;
class DBTransaction
{
/**
* Handle an incoming request.
*
@williamjulianvicary
williamjulianvicary / costdata.gs
Created August 13, 2017 13:19 — forked from chipoglesby/costdata.gs
Cost Data Upload via Google Analytic's Management API with Google Sheets
function uploadData() {
var accountId = "xxxxxxxx";
var webPropertyId = "UA-xxxxxxxx-x";
var customDataSourceId = "xxxxxxxx";
var ss = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var maxRows = ss.getLastRow();
var maxColumns = ss.getLastColumn();
var data = [];
for (var i = 1; i <= maxRows;i++) {
data.push(ss.getRange([i], 1,1, maxColumns).getValues());