Skip to content

Instantly share code, notes, and snippets.

Avatar
👋

Benjamin Cooper bencooper222

👋
View GitHub Profile
@bencooper222
bencooper222 / GetJot.cs
Created Mar 18, 2017
Checks if IHSA JOT semi-finals change. Makes synchronous GET requests and checks if it ever changes.
View GetJot.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Media;
using System.Net;
using System.Text;
using System.Threading.Tasks;
namespace GetJot
@bencooper222
bencooper222 / code.js
Created Dec 12, 2016
Easy Google Apps Script Secret Santa code given a spreadsheet with names in the B column and emails in the C column
View code.js
var ss = SpreadsheetApp.getActiveSpreadsheet(); // this is meant to run inline google appsscript - you'll have to use a different get method if you don't want that
var sheet = ss.getSheets()[0]; // assumes sheet 1
var names = sheet.getRange(2,2,sheet.getLastRow()-1,2).getValues();
Logger.log(names);
if (names.length % 2 != 0) {
//alert("You must have an even number of names. You currently have " + names.length + " names.");
} else {
@bencooper222
bencooper222 / add_image_onclick.js
Created Sep 18, 2016
Adds image anywhere on a webpage at every location someone clicks.
View add_image_onclick.js
function createImage(coordinates){
var xPos = coordinates[0];
var yPos = coordinates[1];
var image = document.createElement("img");
image.src = ;// add image file reference here
// set their position
image.style.top = yPos + "px";
image.style.left = xPos + "px";
@bencooper222
bencooper222 / superlative_creator.gs
Created Sep 1, 2016
Creates a superlative form for a set of names
View superlative_creator.gs
function myFunction() {
var form = FormApp.create("Superlatives");
var array = // PUT YOUR NAMES HERE
for(var i = 0; i<array.length; i++){
var item = form.addParagraphTextItem();
item.setTitle(array[i]);
}
Logger.log(breakUpString("hello,goodbye"));
@bencooper222
bencooper222 / Check_checkboxes_squirrelmail.js
Last active Aug 12, 2016
Selects all messages on Squirrelmail to allow for easy deleting on servers that have quotas (was designed to work with the student and alumni squirrelmail at IMSA)
View Check_checkboxes_squirrelmail.js
var inputs = document.getElementsByTagName("input");
var checkboxes = [];
for (var i = 0; i < inputs.length; i++) {
if (inputs[i].type == "checkbox") {
checkboxes[checkboxes.length] = inputs[i];
}
}
View hello.cs
private string doThis(){
return kek;
}