Skip to content

Instantly share code, notes, and snippets.

View hliyan's full-sized avatar

Hasitha N. Liyanage hliyan

View GitHub Profile
@hliyan
hliyan / magpie.js
Created March 11, 2014 05:07
Magpie init
magpie = include.magpie; // use the library identifer instead of 'include' if it's different
include.$db.set(ScriptDb.getMyDb()); // Magpie will use the spreadsheet's database
// this will create the Magpie menubar items
function onOpen() {
magpie.onOpen();
};
// this will run when you select Magpie > Update
// and once every hour
@hliyan
hliyan / gaga1.js
Last active August 29, 2015 13:57
Github API for Google Apps
// how to use GAGA
var data = $git.token('<your github token here>')
.org('hliyan')
.project('enterprise')
.milestone(1)
.status('open+closed')
.fetch('issues', true); // true: returns GitIssue objects, false: raw data
for (var i = 0; i < data.length; i++) {
var issue = data[i];
@hliyan
hliyan / gasp1.js
Created March 9, 2014 14:57
GASP basics
// how to use GASP
var sheet = $('sheet1');
var range1 = $('sheet1', 'A5');
var range2 = $('sheet1', 1, 2);
var range3 = $('sheet1', 1, 1, 5, 5); // a 5 x 5 grid
var range4 = $(sheet, 'A5'); // same as range1, but with sheet already known
$.sheet = sheet; // you can even set the sheet context
var range5 = $(1, 2); // same as range 2
var range6 = $(1, 1, 5, 5); // same as range 3