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 / replaceLinks.js
Created August 27, 2020 02:56
[Replace Links] grab a drive link from a spreadsheet and replace it with an embeddable url #gsuite #gas #sheets
@rheajt
rheajt / Code.gs
Created July 29, 2020 03:18
Google Classroom API to Build Classrooms
function main() {
// 1. get the courses from the spreadsheet
const courses = getCoursesFromSpreadsheet();
// 2. create the courses on the classroom
const responses = courses.map((course, ind) => {
const resource = createCourseResource(course);
const response = Classroom.Courses.create(resource);
course[3] = response.alternateLink;
function doGet() {
var html = HtmlService
.createHtmlOutputFromFile('form')
.setSandboxMode(HtmlService.SandboxMode.IFRAME)
.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL);
return html;
}
function submit(name) {
@rheajt
rheajt / UpdateNamedRanges.ts
Created April 20, 2020 05:32
[UpdateNamedRangs] excel typescript to update the ranges of all named ranges in a workbook #excel #typescript
async function main(context: Excel.RequestContext) {
// Your code here
const items = context.workbook.names.load('items')
await context.sync();
items.items.forEach(item => {
const lastIndex = item.formula.lastIndexOf('$');
const main = item.formula.substring(0, lastIndex + 1);
const split = +item.formula.substring(lastIndex + 1);
@rheajt
rheajt / Code.gs
Last active December 11, 2019 04:02
[slide data templates] auto-magically pull data from a spreadsheet into a slidedeck #gaspowered
function onOpen() {
SlidesApp.getUi().createMenu('Template')
.addItem('Build template', 'buildTemplate')
.addToUi();
}
function buildTemplate() {
var presentation = SlidesApp.getActivePresentation();
var newPresentation = DriveApp.getFileById(presentation.getId())
.makeCopy('COPY OF TEMPLATE');
@rheajt
rheajt / Code.gs
Last active December 10, 2019 10:15
[Marking Application] old project #gaspowered
function onOpen() {
SpreadsheetApp.getUi()
.createMenu('Marking Application')
.addItem('Open App', 'openApp')
.addToUi();
}
function openApp() {
var html = HtmlService.createHtmlOutputFromFile('app');
@rheajt
rheajt / readme.md
Last active June 20, 2019 18:13
sass setup for create-react-app cli tool

Create-React-App with Sass configuration

Here are instructions for add Sass support to an app built with create-react-app. Hopefully this will be redundant when Sass support is built into the tool! Visit their form and let them know you need Sass support.

Install the create-react-app tool from npm. This will be installed globally. We also need to install the loaders needed for webpack, and we will save those as development dependencies.

npm install -g create-react-app

create-react-app your-app-name
cd your-app-name
@rheajt
rheajt / SampleMarkdown.md
Created November 1, 2018 06:37
Sample Markdown

Sample Markdown file

This is going to be a test file for the Office 365 Add-in Tutorial

@rheajt
rheajt / Code.gs
Last active September 6, 2018 06:33
copy filenames into documents on google drive
function copyTitles() {
var folderId = '0Byvt4e0JQrRAMVR2Z0dnZnVhcDA';
var folder = DriveApp.getFolderById(folderId);
var files = folder.getFilesByType(MimeType.GOOGLE_DOCS);
while(files.hasNext()) {
@rheajt
rheajt / easy-grader.gs
Last active June 9, 2018 15:28
google scripts sidebar that makes it easier to enter grades into a spreadsheet
function gradeBar() {
var gradeBar = HtmlService
.createHtmlOutputFromFile('sidebar')
.setSandboxMode(HtmlService.SandboxMode.IFRAME)
.setTitle('Grader');
SpreadsheetApp.getUi().showSidebar(gradeBar);
}
function endColumn() {