Skip to content

Instantly share code, notes, and snippets.

View schlos's full-sized avatar

Miroslav schlos

View GitHub Profile
@schlos
schlos / google-script-asana-api.js
Created August 26, 2018 17:16 — forked from superstrong/google-script-asana-api.js
Retrieve JSON data from the Asana API and add it to a Google Sheet. This example retrieves all the users in a workspace. Stands on the shoulders of https://gist.github.com/varun-raj/5350595a730a62ca1954
function getAsanaUsers() {
var options = {
"headers" : {
"Authorization": "Bearer <TOKEN>"
}
}
var response = UrlFetchApp.fetch("https://app.asana.com/api/1.0/workspaces/<workspace-id>/users", options);
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheets = ss.getSheets();
@schlos
schlos / pullJSON.js
Created August 26, 2018 17:13 — forked from varun-raj/pullJSON.js
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()); //
@schlos
schlos / gist:dfbafd17f7cdd68dfab1917da3bf9821
Created August 26, 2018 17:09 — forked from mhawksey/gist:1442370
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;
}
@schlos
schlos / emailer.js
Created August 25, 2018 13:04 — forked from gnunicorn/emailer.js
Mass emailer with auto reply for forms
/*
* Mass Emailer Google Spreadsheet and Forms Script.
*
* Changelog:
* 19. June 2013
* - also copy CC and BCC from draft email
* 27. May 2013
* - bugfix, kudos to @stefanhoth: the col is called "Email"
* - show the quota left for the day (thanks to @stefanhoth)
* 30. Apr. 2013

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

/*
* Mass Emailer Google Spreadsheet script.
*
* Changelog:
*
* 27. Apr. 2013
* - trial checkbox allows easier debugging
* 16. Feb. 2012
* - released the first version to public
* 15. Feb. 2012
@schlos
schlos / Google-Sheet-Form-Post.md
Created August 24, 2018 23:13 — forked from willpatera/Google-Sheet-Form-Post.md
Post to google spreadsheet from html form

Overview

This collection of files serves as a simple static demonstration of how to post to a google spreadsheet from an external html <form> following the example by Martin Hawksey

Run example

You should be able to just open index.html in your browser and test locally.

However if there are some permissions errors you can make a quick html server with python. Open terminal and cd to the directory where the gist files are located and enter python -m SimpleHTTPServer. By default this creates a local server at localhost:8000

/*
Copyright 2011 Martin Hawksey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@schlos
schlos / appsScript_ListFilesFolders_ver.2.js
Created August 24, 2018 22:37 — forked from mesgarpour/appsScript_ListFilesFolders_ver.2.js
[Google Apps Script] List all files & folders in a Google Drive folder, & write into a speadsheet
/*
* Copyright 2017 Mohsen Mesgarpour
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@schlos
schlos / imageToText.gs
Created August 24, 2018 22:36 — forked from tagplus5/imageToText.gs
google apps script image to text ocr
function doGet(request) {
if (request.parameters.url != undefined && request.parameters.url != "") {
var imageBlob = UrlFetchApp.fetch(request.parameters.url).getBlob();
var resource = {
title: imageBlob.getName(),
mimeType: imageBlob.getContentType()
};
var options = {
ocr: true
};