Skip to content

Instantly share code, notes, and snippets.

@SIFAR786
SIFAR786 / RosterMaker.gs
Created June 4, 2018 00:37 — forked from rheajt/RosterMaker.gs
google apps script to create multiple sections programmatically from a spreadsheet
function rosterMaker() {
//spreadsheet id of the rosters
var SHEET_ID = FormApp.getActiveForm().getDestinationId();
var ss = SpreadsheetApp.openById(SHEET_ID);
var form = FormApp.getActiveForm();
//get only the sheets with 'Roster' in the title
var sheets = ss.getSheets()
.filter(function(sheet) {return sheet.getName().match(/Roster/gi);});
@SIFAR786
SIFAR786 / sendgrid_eid.sql
Created April 11, 2018 15:16 — forked from emiel/sendgrid_eid.sql
Decode SendGrid Event ID in Postgres
create or replace function sendgrid_eid24_to_uuid(eid text)
returns uuid language sql immutable strict parallel safe
as $function$
select encode(decode(translate(eid, '-_', '+/'), 'base64'), 'hex')::uuid;
$function$;
create or replace function sendgrid_eid48_to_uuid(eid text)
returns uuid language sql immutable strict parallel safe
as $function$
@varun-raj
varun-raj / pullJSON.js
Last active October 31, 2022 16:19
Google App Script To Fetch Data From JSON Webservice and Write them to google spreadsheet.
function pullJSON() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheets = ss.getSheets();
var sheet = ss.getActiveSheet();
var url="http://example.com/feeds?type=json"; // Paste your JSON URL here
var response = UrlFetchApp.fetch(url); // get feed
var dataAll = JSON.parse(response.getContentText()); //
@mhawksey
mhawksey / gist:1442370
Last active February 25, 2024 12:01
Google Apps Script to read JSON and write to sheet
function getJSON(aUrl,sheetname) {
//var sheetname = "test";
//var aUrl = "http://pipes.yahoo.com/pipes/pipe.run?_id=286bbb1d8d30f65b54173b3b752fa4d9&_render=json";
var response = UrlFetchApp.fetch(aUrl); // get feed
var dataAll = JSON.parse(response.getContentText()); //
var data = dataAll.value.items;
for (i in data){
data[i].pubDate = new Date(data[i].pubDate);
data[i].start = data[i].pubDate;
}