View appsscriptzoneids.csv
value text
Pacific/Midway (GMT-11:00) Midway
Pacific/Niue (GMT-11:00) Niue
Pacific/Pago_Pago (GMT-11:00) Pago Pago
Pacific/Honolulu (GMT-10:00) Hawaii Time
Pacific/Johnston (GMT-10:00) Johnston
Pacific/Rarotonga (GMT-10:00) Rarotonga
Pacific/Tahiti (GMT-10:00) Tahiti
Pacific/Marquesas (GMT-09:30) Marquesas
America/Anchorage (GMT-09:00) Alaska Time
View gist:0c5ad7b79e1162b239156ce946cbe2be
import io
import picamera
import cv2
import numpy
import requests
import base64
def hitGA(faces):
print("Sending to GA")
requests.get("http://www.google-analytics.com/collect?v=1" \
View face-detection-to-google-analytics.py
import io
import picamera
import cv2
import numpy
def hitGA(faces):
print("Sending to GA")
requests.get("http://www.google-analytics.com/collect?v=1" \
+ "&tid=YOUR_UA_TRACKING_ID_HERE" \
+ "&cid=1111" \
View Index.html
<!DOCTYPE html>
<html>
<head>
<base target="_top">
</head>
<body>
<a class="twitter-timeline" data-dnt="true" href="https://twitter.com/search?q=%23altc%20OR%20from%3AA_L_T" data-widget-id="398755222102605825">Tweets about #altc OR from:A_L_T</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</body>
</html>
View include-snippet
var icons = {};
icons['ic_refresh_white_24dp.png'] = { id: 'sync_now',
class: 'i18n spinning',
src: 'data:image/png;base64,...'
};
View include-snippet.gs
<div id="action-bar">
<?!= Include.img(icons['ic_refresh_white_24dp.png']); ?>
<?!= Include.img(icons['ic_settings_white_24dp.png']); ?>
</div>
View include-snippet.gs
/**
* 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'
View YouTubeOAuth2Service.gs
/* 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'
View youtube.gs
/**
* 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
View Code.gs
// 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;
}
}