Skip to content

Instantly share code, notes, and snippets.

function onOpen() {
var menuEntries = [ {name: "Create Diary Doc from Sheet", functionName: "createDocFromSheet"}];
var ss = SpreadsheetApp.getActiveSpreadsheet();
ss.addMenu("Fitness Diaries", menuEntries);
}
function createDocFromSheet(){
var templateid = "1O4afl8SZmMxMFpAiN16VZIddJDaFdeRBbFyBtJvepwM"; // get template file id
var FOLDER_NAME = "Fitness Diaries"; // folder name of where to put completed diaries
// get the data from an individual user
@jccarlin56
jccarlin56 / Sites.Attachment.getLastUpdated().js
Created November 2, 2013 14:42
Gets the latest date updated for attachments.
var pages = SitesApp.getSite('example.com', 'mysite').getChildren();
var attachments = pages[0].getAttachments();
var date = attachments[0].getLastUpdated();
@jccarlin56
jccarlin56 / Sites.Attachment.getDescription().js
Created November 2, 2013 14:39
Gets the descriptions for the attachments.
var pages = SitesApp.getSite('example.com', 'mysite').getChildren();
var attachments = pages[0].getAttachments();
var description = attachments[0].getDescription();
@import "compass";
$iconSpritePath: '../images/iconSprite.png';
// 1.0 Color Palette
/*
Logo
$logoGray - Gray found in the RJM logo
<style type="text/css">
body
{
background-image:
url("images/blu.gif")
}
</style>
<style type="text/css">
body {background-color: yellow}
h1 {background-color: #00ff00}
h2 {background-color: transparent}
p {background-color: rgb(250,0,255)}
</style>
@jccarlin56
jccarlin56 / new_gist_file.css
Created October 25, 2013 13:59
Text Border: Mouseover Dotted Line From http://jdstiles.com/css/cssborders.html
.over{border:2px dotted red;width:320px;height:20px}
.out{border:0px;width:320px;height:23px;padding-left:2px;padding-top:2px}
@jccarlin56
jccarlin56 / Contacts.js
Created October 12, 2013 14:42
Contact code that will read your spreadsheet, look up contacts by email address and add or update your My Contacts. From https://sites.google.com/site/scriptsexamples/learn-by-example/other-examples/contacts-sharing Example: http://spreadsheets.google.com/ccc?key=0AjThpih7byJUdDZlNGY3TEJPYU9VcWd0TWhaaElfNVE&hl=en
//This onOpen function adds a menu item
function onOpen() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var searchMenuEntries = [ {name: "Update Contacts", functionName: "updateContacts"}];
ss.addMenu("Contacts", searchMenuEntries);
}
function updateContacts() {
//Here we get the spreadsheet
@jccarlin56
jccarlin56 / DocumentCreateFromSpreadsheet.js
Created October 9, 2013 14:48
Create and share a personalized Google Doc that shows the user's itinerary. @param {Object} user An object that contains the user's name and email. @param {String[][]} response An array of data for the user's session choices.
/**
* Create and share a personalized Google Doc that shows the user's itinerary.
*
* @param {Object} user An object that contains the user's name and email.
* @param {String[][]} response An array of data for the user's session choices.
*/
function sendDoc_(user, response) {
var doc = DocumentApp.create('Conference Itinerary for ' + user.name)
.addEditor(user.email);
var body = doc.getBody();
/**
* A set-up function that uses the conference data in the spreadsheet to create
* Google Calendar events, a Google Form, and a trigger that allows the script
* to react to form responses.
*/
function setUpConference_() {
if (ScriptProperties.getProperty('calId')) {
Browser.msgBox('Your conference is already set up. Look in Google Drive!'); }
var ss = SpreadsheetApp.getActive();