This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8" ?> | |
<Module> | |
<ModulePrefs title="hello world example" /> | |
<Content type="html"> | |
<![CDATA[ | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> | |
]]> | |
</Content> | |
</Module> |
This file contains hidden or 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 main() { | |
alert('You are the man!'); | |
} |
This file contains hidden or 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 test_doGet() { | |
var e = {}; | |
e.parameter = {}; | |
e.parameters = {}; | |
e.parameters.callback = 'callback'; | |
e.parameter.url = ""; | |
e.parameter.sheet = 'Sheet1'; | |
e.parameter.range = 'A1:H'; | |
Logger.log(doGet(e).getContent()); | |
} |
This file contains hidden or 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
/* | |
Summary of the Multiple Choices selected, with a space-bar ' | ' between each item | |
Removes leading and trailing space-bars (and internally repeating!) with a regexp: | |
The regexp does the following manipulations: | |
FROM TO | |
"A | |" --> "A" | |
" | | C" --> "C" | |
" | B | " --> "B" | |
"A | B | " --> "A | B" | |
" | | B | C" --> "B | C"" |
This file contains hidden or 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
/* | |
by ClassroomTechTools.com | |
This is free and unencumbered software released into the public domain. | |
Anyone is free to copy, modify, publish, use, compile, sell, or | |
distribute this software, either in source code form or as a compiled | |
binary, for any purpose, commercial or non-commercial, and by any | |
means. |
This file contains hidden or 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
/** | |
* Convert any spreadsheet value to a date. | |
* Assumes that numbers are using Epoch (days since 1 Jan 1900, e.g. Excel, Sheets). | |
* Originally found at http://stackoverflow.com/questions/33809229/how-to-get-a-date-format-string-from-a-sheet-cell/33813783#33813783 | |
* with minor modifications | |
* | |
* @param {object} value (optional) Cell value; a date, a number or a date-string | |
* will be converted to a JavaScript date. If missing or | |
* an unknown type, will be treated as "today". | |
* |
This file contains hidden or 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
""" | |
Requires Python3 | |
Solves this: https://projecteuler.net/problem=14 | |
Illustrates the following concepts: | |
* Object oriented programming, in particular subclassing int and list | |
* Generator pattern (Sequence is a generator) | |
# Properties | |
To save space, does not store full sequence in results, everything is calculated on demand | |
Uses up to about 400 MB |
This file contains hidden or 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
// Step 1: Place this in your <script> area of your template | |
// Step 2: Change 'columns' variable to reflect on line 19 to your desires | |
// e.g. columns = {'b': 'Column B!', 'c': 'Column C!'} | |
// | |
// NOTE: Does NOT refer to the columns in the data source sheet | |
// Column A here is the first column that appears on the awesometable, | |
// B the second | |
var convertColToN = function(val) { | |
var base = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', i, j, result = 0; |
This file contains hidden or 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
// Just a regular timezone string | |
var TMZ = 'GMT+8'; // 'GMT-10', etc etc | |
// Refer to here to change for the exact formatting http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html | |
// Single quotes around the %s are for the ordinal, like "3rd" and "4th". | |
// The single quotes are required, avoids interpretation and are required for the call to formatString | |
// The '%s' can be deleted as well, without ill effects | |
var FORMATSTRING = "EE MMM d'%s' yyyy @ hh:mm a"; // Tue Apr 26th 2016 @ 08:43 AM | |
if (!Date.prototype.formatted) { |
This file contains hidden or 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
// To use: | |
// Put the below in the <script> portion of your template | |
// Set awesometable config to use that template (see documentation for details) | |
function main() { | |
columns = { | |
1: // first column, not column A in the data sheet, the first column displayed in the table | |
{ | |
text: ['Yippee'], // changes title to "Yippee" | |
css: ['width', '10%'] // changes the width |