Skip to content

Instantly share code, notes, and snippets.

View rheajt's full-sized avatar
🏠
Working from home

jordan rhea rheajt

🏠
Working from home
View GitHub Profile
@rheajt
rheajt / ajax.js
Created September 28, 2016 07:39
ajax requests without jquery
// POST request
var request = new XMLHttpRequest();
request.open('POST', '/my/url', true);
request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
request.send(data);
// GET request
var request = new XMLHttpRequest();
request.open('GET', '/my/url', true);
@rheajt
rheajt / Code.gs
Last active October 10, 2016 16:45
Example code for EduOnAir Live Event
//How to open the Script Editor
//Sheets, Docs, and Forms
//Start a new project in Sheets
//Variables are the NOUNS (who, what, where)
var exampleString = 'This is a string';
var exampleNumber = 123.45;
var exampleArray = [];
var exampleObject = {};
@rheajt
rheajt / Caption.html
Created October 11, 2016 15:04
Caption Creator for Drive
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<base target="_top">
<?!= HtmlService.createHtmlOutputFromFile('Stylesheet').setSandboxMode(HtmlService.SandboxMode.IFRAME).getContent() ?>
</head>
<body class="container">
<div class="row">
@rheajt
rheajt / Code.gs
Created October 26, 2016 18:31
WeCreate
/**
# WeCreate Picture Citation Project for Joanne Schmutz
### Idea by Joanne Schmutz
### Coded by [@rheajt](http://jordanrhea.com)
1. Create a folder for the root of your project
2. Create a script file and copy each of the below files into the project
3. Create a spreadsheet in that directory and in the header row name each column as follows:
* uploadedOn
* user
@rheajt
rheajt / Code.gs
Created November 10, 2016 12:18
Use the script editor with Google Forms
function onOpen() {
FormApp.getUi()
.createAddonMenu()
.addItem('Copy text into form', 'importText')
.addToUi();
}
function importText() {
var commentModal = HtmlService
.createHtmlOutputFromFile('Textbox')
@rheajt
rheajt / Code.gs
Created November 10, 2016 16:34
Vocabulary Sidebar for Google Documents
var MW_KEY = '';
function onOpen() {
DocumentApp.getUi()
.createAddonMenu()
.addItem('Get vocabulary words', 'openSidebar')
.addToUi();
}
function openSidebar() {
@rheajt
rheajt / Code.gs
Last active November 19, 2016 15:48
summarize your labels
// the name of the label in your Gmail that you want to create a document for
var LABEL = '';
// number of days to use if you set a trigger
var DAYS = 1;
// email address of person to send the link to your document
var EMAIL = 'TEST@EXAMPLE.COM';
// the function that creates the document and emails you a link
@rheajt
rheajt / Code.gs
Last active November 29, 2016 18:50
filter achieve 3000 data from the sidebar
function onOpen() {
SpreadsheetApp.getUi()
.createAddonMenu()
.addItem('Open Sidebar', 'openSidebar')
.addToUi();
}
function onInstall() {
onOpen();
}
@rheajt
rheajt / Code.gs
Created November 29, 2016 19:09
track library reading with custom projects
function doGet() {
return HtmlService.createTemplateFromFile('ReadingLog').evaluate().setTitle('Reading Log');
}
function getUser() {
var ss = SpreadsheetApp.openById(SPREADSHEET_ID);
var activeUser = Session.getActiveUser().getEmail();
var studentInfo = ss.getSheetByName(STUDENT_INFO).getDataRange().getValues();
@rheajt
rheajt / Code.gs
Created November 30, 2016 07:11
create folders and save links to a google sheet
function createFolders(student) {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var emails = sheet.getRange(2, student, sheet.getLastRow() - 1, sheet.getLastColumn());
var data = emails.getValues();
for(var i = 0; i < data.length; i++) {
if(!data[i][2]) {