Skip to content

Instantly share code, notes, and snippets.

@Kaelinator
Kaelinator / find-v8.js
Created September 14, 2022 00:51
Use this nodejs script to search through a junkyard's VIN list for a V8
const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args));
const cheerio = require('cheerio');
processVin = vin =>
fetch(`https://yournewvin.com/check-vin-${vin}-full-report`)
.then(res => res.text())
.then(html => html)
.then(cheerio.load)
.then($ => ({
make: $('table tbody tr:nth-child(1) td:nth-child(2)').text(),
@Kaelinator
Kaelinator / PRFEncryption.java
Created April 25, 2022 18:49
Pseudorandom Function Encryption in Java
import java.math.BigInteger;
import java.util.Random;
import java.util.HashMap;
class PRFEncryption {
private BigInteger key;
private int length;
public PRFEncryption(int length) {
@Kaelinator
Kaelinator / piazza_read.js
Created September 28, 2020 06:34
Read all posts on Piazza
/* Paste into your console. Be sure to select "unread" list */
(() => {
const delay = 100
document
.querySelectorAll('li.feed_item')
.forEach((li, i) => {
setTimeout(() => P.feed.feedItemClick({ target: li }, li), delay * i)
})
})()
@Kaelinator
Kaelinator / EverfiPayload.js
Last active May 21, 2019 15:07
Time is money; save it!
/* hold a and click a module to activate */
const keys = {};
window.onkeyup = function(e) { keys[e.keyCode] = false; }
window.onkeydown = function(e) { keys[e.keyCode] = true; }
const completeIt = () => {
EF.currentPage.complete();
}
const goHome = () => {
@Kaelinator
Kaelinator / Sapling Learning Bot
Last active April 10, 2019 15:59
Does your homework for you
/*
Copy and paste this code into the console of your browser.
Make sure the target frame is set to "http://hs.saplinglearning.com/sac/#!/XXXXXXX"
*/
(() => {
let previousState
const attempt = () => {
const state = $('button#button-check').innerText
@Kaelinator
Kaelinator / cloudSettings
Last active March 31, 2019 21:12
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-03-31T21:12:41.088Z","extensionVersion":"v3.2.7"}
@Kaelinator
Kaelinator / EdgenuityPayload.js
Last active July 28, 2022 18:47
Paste this into your console (with target set to Frame: Activity) for extra tools to allow you to be more productive when learning with Edgenuity
(() => {
const stopAllAudio = () => {
API.Audio.soundQueue = new Array();
API.Audio.callBackQueue = new Array();
API.Audio.playing = false;
try {
API.Audio.stopAudio();
} catch (ex) { }
@Kaelinator
Kaelinator / nest.test.js
Created April 16, 2018 23:55
Jest `Compared values have no visual difference.` reproduction
const compose = (...fns) => fns.reduce((f, g) => (...args) => f(g(...args)))
const stripData = obj => obj.data
const assign = child => parent => Object.assign(parent, child)
const arrAssign = (arr, k) => data => data.map((d, i) => assign({[k]: d})(arr[i]))
/* function being tested */
const insertAndPair = (obj, key1, key2) => compose(
d => assign({ [key1]: arrAssign(obj.slice(-1)[0][key1], key2)(d) })(obj.slice(-1)),
stripData
)