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
// Pie Chart visualization client-side scripting | |
// Initialize the script and grab the data from the spreadsheet. | |
google.script.run.withSuccessHandler(drawChart).getSpreadsheetData(); | |
google.load("visualization", "1", {packages:["corechart"]}); | |
// Using the returned data from the spreadsheet, draw the chart. | |
// ssData is a 2D array of the candidate name and their electoral vote totals from the spreadsheet. | |
function drawChart(ssData) { | |
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
// Server side scripts to draw and load the page. | |
// Call the sheet | |
var ss = SpreadsheetApp.openById('SPREADSHEET_KEY'); | |
// Initialize the HTMLService and draw the page from the template. | |
function doGet() { | |
return HtmlService | |
.createTemplateFromFile("index") | |
.evaluate(); |
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
/** | |
* @param {Obj} a - array from daily list built | |
**/ | |
function assignCons(a) { | |
// These rely on the global variables set at the top of the script | |
var sheet = ss.getSheets()[2]; | |
var data = sheet.getDataRange().getValues(); | |
var target = ss.getSheets()[3].getRange("A2").getValue(); | |
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 ui = DocumentApp.getUi(); | |
var docProps = PropertiesService.getDocumentProperties(); | |
// Grab the document body. | |
// No formatting, tables, etc are kept. | |
function getText() { | |
var doc = DocumentApp.getActiveDocument(); | |
var body = doc.getBody(); | |
Logger.log(body.getText()); | |
var array = []; |
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
/* Put this into the WordPress functions.php file to embed a large image from the Flickr RSS feed */ | |
function edit_content_img($content) { | |
$content = preg_replace("/(_m)/", "_b", $content); | |
return $content; | |
} | |
add_filter( 'the_content', 'edit_content_img'); |
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
// ALL SERVER CODE RUNNING ON THE SPREADSHEET | |
// new property service GLOBAL | |
// see: https://developers.google.com/apps-script/reference/properties/ | |
var SCRIPT_PROP = PropertiesService.getScriptProperties(); | |
// Grab the correct spreadsheet | |
var sheet = SpreadsheetApp.openById("spreadsheetIdHere"); | |
/** |
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 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | |
<title>Camp Ray Bird Summer Camp</title> | |
<meta name="description" content="Summer Camp and Mission Work at Camp Ray Bird"/> | |
<meta name="rating" content="safe for kids" /> | |
<link rel="stylesheet" href="styles/style.css" type="text/css"/> | |
<script type="text/javascript"> |
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
#!/bin/bash | |
set -euo pipefail | |
function printHelpAndExit { | |
echo 'Usage:' | |
echo ' gifify [options] filename' | |
echo '' | |
echo 'Options: (all optional)' | |
echo ' c CROP: The x and y crops, from the top left of the image, i.e. 640:480' |
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++) { |
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() |