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 / Winnie the Pooh Quotes.markdown
Created September 2, 2015 20:50
Winnie the Pooh Quotes
function shuffle(array) {
var currentIndex = array.length, temporaryValue, randomIndex ;
// While there remain elements to shuffle...
while (0 !== currentIndex) {
// Pick a remaining element...
randomIndex = Math.floor(Math.random() * currentIndex);
currentIndex -= 1;
@rheajt
rheajt / createGroups
Created October 5, 2015 08:56
randomly generate seating groups
function createGroups() {
//create a new document
var date = new Date();
var document = DocumentApp.create("Seating Groups " + date.toDateString()).getBody();
//declare the object classList filled with an array for each class
var classList = {};
var newGroups = {};
@rheajt
rheajt / createUBDTemplate
Last active October 5, 2015 09:07
unit by design template creator, designed for use in the izmir sev english department
function onOpen(e) {
DocumentApp.getUi().createAddonMenu()
.addItem('Start', 'showWindow')
.addToUi();
}
function onInstall(e) {
onOpen(e);
}
@rheajt
rheajt / averageCompletes
Created October 5, 2015 09:15
get the average of a range of both numbers and text
/*Average of text fields */
function AVGCOMPLETES(arr) {
//declare the array that will be used to get the average
//push 100 to the array if the field is 'complete' and 0 to the array if the field is 'incomplete'
var averageArray = [];
for(i = 0; i < arr[0].length; i++) {
if(typeof arr[0][i] === 'string') {
if(arr[0][i].toLowerCase() === 'complete') {
averageArray.push(100);
} else if(arr[0][i].toLowerCase() === 'incomplete') {
@rheajt
rheajt / highlightIncompletes
Created October 5, 2015 09:18
function that will highlight a cell red when it is marked 'incomplete' and white when it is anything else
function onEdit(event) {
if(event.value.toLowerCase() === "incomplete") {
event.range.setBackground("red");
} else {
event.range.setBackground("white");
}
}
@rheajt
rheajt / after-school.gs
Created October 9, 2015 13:36
select names for after-school study hall and save to a separate spreadsheet
//get the name of the student on the selected row and add them to an Etut list(after school tutoring)
function setEtutList(selected) {
var fname = '2'; //where is the first name
var row = SpreadsheetApp.getActiveRange().getRow();
var name = SpreadsheetApp.getActiveSheet().getRange(row, fname, 1, 2).getValues();
var etutList = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Etut Lists");
etutList.appendRow([getNextThurs().toDateString(), name[0][0] + ' ' + name[0][1]]);
}
@rheajt
rheajt / FlashCards.markdown
Last active November 6, 2015 14:42
FlashCards
@rheajt
rheajt / angularFire.js
Created November 20, 2015 22:09
Angular Problems!
app.factory('Auth', ['$firebaseAuth', 'FBURL',
function($firebaseAuth, FBURL) {
var ref = new Firebase(FBURL);
return $firebaseAuth(ref);
}]);
app.factory('User', ['FBURL', '$firebaseObject',
function(FBURL, $firebaseObject) {
var ref = new Firebase(FBURL + '/users');
var userData = {};
@rheajt
rheajt / attendance-bookmarklet
Last active December 4, 2015 14:13
easy way to send attendance emails
var attendance = "<WHOEVER_TAKES_ATTENDANCE_FOR_YOU>";
var bcc = "<YOUR_EMAIL ADDRESS_GOES_HERE>";
var d = new Date();
var bodyText = d.toDateString() + '\n' + d.toTimeString() + '\n\n\n';
var className= $("header>div>div div").text().substr(0,2);
var subject = 'Absent Students from ' + className;
var late = $("img[src='/be0f7a34ef27e82a28e9005115e57754.png']").parent().parent().prev().children();