This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var icons = {}; | |
icons['ic_refresh_white_24dp.png'] = { id: 'sync_now', | |
class: 'i18n spinning', | |
src: 'data:image/png;base64,...' | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="action-bar"> | |
<?!= Include.img(icons['ic_refresh_white_24dp.png']); ?> | |
<?!= Include.img(icons['ic_settings_white_24dp.png']); ?> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* given an image object, it will generate an img tag | |
* @param {Object} imgData with image data | |
* @return {string} of img tag or src | |
*/ | |
ns.img = function (imgData, isImgTag) { | |
if (!isImgTag){ | |
var html = '<img '; | |
Object.entries(imgData).forEach(function(k){ html += k[0]+'="'+k[1]+'" '}); | |
html += '>\n' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Setup | |
1. In the Script Editor select Resources > Cloud platform project... and click the link to the currently associated project | |
2. In the Google Cloud Platform window click "Go to APIs overview" | |
3. In APIs & services click "Enable APIs and Services" | |
4. In the Library search/click on YouTube Data API and click 'Enable' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Google Apps Script Library for the youtube API | |
* | |
* Documentation can be found: | |
* https://developers.google.com/youtube/v3 | |
* | |
* OAuth2 Scopes | |
* https://www.googleapis.com/auth/youtube | |
* https://www.googleapis.com/auth/youtube.force-ssl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Grabs my latest tweet favorited using the handy TwtrService wrapper by +MartinHawksey - https://goo.gl/2it7yb | |
function getLatestTweet() { | |
var data = TwtrService.get("statuses/user_timeline", {screen_name: /*"YourTwitterHandle(without the @)"*/, count: 1}); | |
var id = false; | |
for (var i = 0; i < data.length; i++){ | |
if (data[i].favorited) { | |
id = data[i].id_str; | |
break; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Port of Slides API demo by Wesley Chun to Google Apps Script | |
// Source: http://wescpy.blogspot.co.uk/2016/11/using-google-slides-api-with-python.html | |
function slides_template() { | |
/* | |
from apiclient import discovery | |
from httplib2 import Http | |
from oauth2client import file, client, tools | |
*/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function showRow(doc){ | |
var cache = getCache_(); | |
try { | |
// if cache is set and id matches handle open row for editing | |
if (cache.id && cache.id === doc.getId()){ | |
doc.toast("Opened on row for editing..."); | |
var sheet = doc.getSheetByName(cache.sheet); | |
if (sheet != null) { | |
if(cache.row){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doGet(e) { | |
var html = HtmlService.createTemplateFromFile('index'); | |
html.e = e.parameter; | |
return html.evaluate().setTitle('Opening a row...'); | |
} | |
function setCache(parameter){ | |
var values = { | |
'row': parameter.row, | |
'header':parameter.header, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<base target="_top"> | |
<script> | |
var e = <?!= JSON.stringify(e) ?>; | |
google.script.run.withSuccessHandler(onSuccess).setCache(e); | |
function onSuccess(url){ | |
window.top.location.href = url; |