Skip to content

Instantly share code, notes, and snippets.

View SheepTester's full-sized avatar
🐑
Existing

Sean SheepTester

🐑
Existing
View GitHub Profile
@SheepTester
SheepTester / leshep.rkt
Created October 14, 2017 03:14
simply scheme FOOP class stuffiness
; leShep.rkt - scheme library made by Sean
; squares number
(define (square n) (* n n))
; if the letter given is a vowel
(define (vowel? l) (member? l 'aeiou))
; version of mod that accepts floats which mimics Scratch's mod behavior
(define (% a b) (- a (* (floor (/ a b)) b)))
@SheepTester
SheepTester / test.rkt
Last active December 14, 2017 02:30
tests
#lang racket ; draw a graph of
(require plot) ; cos and log
(plot #:label "y = cos(x) & y = log(x)"
(list (function cos -5 5) (function log -5 5)))
"an unclosed string is an error
; background: #1D1F21
; https://sheeptester.github.io/javascripts/sadbooks/sadbooks.css
@SheepTester
SheepTester / arraysort.js
Last active December 26, 2017 02:44
Sorting algorithm that only works for positive numbers. Is it efficient? I doubt it.
let arrayToSort = [];
for (let i = 1000; i--;) arrayToSort.push(Math.floor(Math.random() * 1000)); // add 1000 random integers between 0-999
function arraySort(arrayToSort) {
let sortedArray = [],
array = [];
for (let i = arrayToSort.length; i--;) {
if (array[arrayToSort[i]]) array[arrayToSort[i]]++;
else array[arrayToSort[i]] = 1;
}
@SheepTester
SheepTester / format.md
Last active February 9, 2018 16:21
PROPOSAL FORMAT

@everyone PROPOSAL N TL;DR: very brief summary; TL;DR's are optional You should describe the proposal in detail. INCLUDE A PUNISHMENT AND A PUNISHER; rules don't enforce themselves. Voting ends at TIME AND DATE. Majority rules. Per country (or person if the proposal concerns HOW the game is played). React 👍 to pass; react 👎 to veto.

@SheepTester
SheepTester / alternate_schedules.json
Created February 25, 2018 02:02
Descriptions of alternate schedules by Gunn in JSON format
[
"Period E Final (8:30-10:10)\nBrunch (10:10-10:25)\nPeriod F Final (10:30-12:10)\n",
"Period A Final (8:30-10:10)\nBrunch (10:10-10:25)\nPeriod C Final (10:30-12:10)\nLunch (12:10-12:40)\nPeriod G Final (12:45-2:25)\n",
"Period B Final (8:30-10:10)\nBrunch (10:10-10:25)\nPeriod D Final (10:30-12:10)\nBreak with NO LUNCH SERVED (12:10-12:40)\nZero & H Period Finals (12:45-2:25)\n",
"Period A (8:25-9:17)\nPeriod B (9:27-10:14)\nBrunch (10:14-10:29)\nPeriod C (10:29-11:16)\nPeriod D (11:26-12:13)\nLunch (12:13-12:57)\nPeriod E (12:57-1:44)\nPeriod F (1:54-2:41)\nPeriod G (2:51-3:38)",
"Period E (8:25-9:45)\nBrunch (9:45-10:00)\nFlexTime (10:00-10:45)\nPeriod B (10:55-12:00)\nStaff Holiday Lunch in Bow Gym (12:00-12:55)\nPeriod A (1:05-2:10)\nPeriod G (2:20-3:35)\n",null,
"Period D (8:25-9:50)\nBrunch (9:50-10:05)\nAssembly for 9th/10th graders in Titan Gym (10:05-10:40)\n11th/12th graders to FlexTime\nAssembly for 11th/12th graders in Titan Gym (10:50-11:25)\n9th/10th graders to FlexTime\nPeriod E
@SheepTester
SheepTester / autoid.user.js
Last active October 11, 2019 02:28
(DEPRECATED - see below) Helpful userscripts/userstyles
// ==UserScript==
// @name Auto-sign in to RapidIdentity
// @namespace http://tampermonkey.net/
// @version 1
// @description Automatically sign in to RapidIdentity
// @author Sean
// @match https://id.pausd.org/idp/AuthnEngine*
// @grant none
// ==/UserScript==
@SheepTester
SheepTester / parser.py
Created September 17, 2018 00:08
Gunn alternate schedule parser in Python
# https://sheeptester.github.io/alt-schedule-parser-tester/
import re
EARLIEST_AM_HOUR = 6
html_newline_regex = r'<(p|div|br).*?>|\) *(?=[A-Z0-9])'
no_html_regex = r'<.*?>'
no_nbsp_regex = r'&nbsp;'
time_getter_regex = r'\(?(1?[0-9]):([0-9]{2}) *(?:-|–) *(1?[0-9]):([0-9]{2}) *(pm)?\)?'
class CommentDemo {
constructor() {}
getInfo() {
return {
id: 'commentdemo',
name: 'Comment demo',
colour: '#607D8B',
@SheepTester
SheepTester / Randp.java
Created January 26, 2019 05:57
Randp generates a random number between 1 and n, and will never generate that again; no loops or recursion! - http://paleyontology.com/AP_CS/randp.html
public class Randp {
private int[] nums;
private int numsLeft;
public Randp(int n) {
nums = new int[n];
numsLeft = n;
}
@SheepTester
SheepTester / PortfolioStorer.js
Last active February 20, 2019 22:05
Schoology portfolio getter and setter
const PortfolioStorer = (() => {
function fetchJSON(path, headers, method = 'GET', body = undefined) {
return fetch('https://pausd.schoology.com/portfolios/' + path, {method, headers, body: body && JSON.stringify(body)})
.then(r => r.json())
.then(({data}) => data);
}
class PortfolioStorer {