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
[core] | |
repositoryformatversion = 0 | |
filemode = true | |
bare = false | |
logallrefupdates = true |
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
from canvasapi import Canvas | |
API_URL = 'https://my.url.com' | |
API_KEY = 'mySTringKEy123' | |
canvas = Canvas(API_URL, API_KEY) | |
outcome = canvas.get_outcome(5426) | |
class Rating: |
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() { | |
var ref = new Firebase("https://nodes-commenting.firebaseio.com/"), | |
postRef = ref.child(window.location.pathname); | |
postRef.on("child_added", function(snapshot) { | |
var newPost = snapshot.val(); | |
if(newPost.moderated) { | |
$("#comment-list").prepend('<div class="comment">' + | |
'<h4>' + escapeHtml(newPost.name) + '</h4>' + | |
'<div class="profile-image"><img src="http://www.gravatar.com/avatar/' + escapeHtml(newPost.md5Email) + '?s=100&d=retro"/></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
const functions = require('firebase-functions'); | |
const admin = require('firebase-admin'); | |
const nodemailer = require('nodemailer'); | |
admin.initializeApp(functions.config().firebase); | |
// set up email credentials in firebase.config | |
// See https://github.com/firebase/functions-samples/tree/master/quickstarts/email-users for example | |
const gmailEmail = functions.config().gmail.email; |
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
// Copyright 2017 Brian E. Bennett | |
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software | |
// and associated documentation files (the "Software"), to deal in the Software without restriction, | |
// including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
// and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, | |
// subject to the following conditions: | |
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
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
// Copy this script into the feedback spreadsheet TEMPLATE | |
/************************ OnOpen *******************************/ | |
function onOpen(e) { | |
var ui = SpreadsheetApp.getUi().createMenu("Shortlink") | |
.addItem("Show URL and QR code", "showQrAndLink") | |
.addToUi() | |
} | |
/************************ GLOBALS *******************************/ |
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
// The rest of the backend code. | |
// postTweet.gs and getThumbnails.gs can be appended to this file. | |
// When combined, click Publish > Deploy as web app | |
// You can then test by visiting your app page. | |
var KEY = "YOUR_APP_KEY"; | |
var SECRET = "YOUR_APP_SECRET"; | |
// Initialize Twitter login | |
// See https://mashe.hawksey.info/2014/10/twtrservice-a-twitter-api-client-for-google-apps-script/ |
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 isTimeUp_(starttime) { | |
var now = new Date(); | |
return now.getTime() - starttime.getTime() > 270000; // 4.5 minutes | |
} | |
// Set the start time outside the loop | |
var starttime = new Date(); | |
// Inside your function, check the time and break to prevent failure mid-loop | |
for(var i=0; i<data.length; i++) { |
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
#! /usr/local/bin/python | |
import json, requests | |
# Your Google Sheet as JSON feed | |
url = "https://spreadsheets.google.com/feeds/list/YOUR_KEY_HERE/od6/public/values?alt=json" | |
# Get the data and store it as a dictionary you can sort | |
r = requests.get(url) | |
logs = r.json() |
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 revisionHistoryLite() { | |
var doc = DocumentApp.getActiveDocument(); | |
var eds = doc.getEditors(); | |
var original = doc.getBody().getParagraphs(); | |
var revs = Drive.Revisions.list(doc.getId()) | |
var editsList = []; | |
for(var i=0; i<revs.items.length; i++) { |