This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::ops::ControlFlow; | |
/// Finds the first occurrence of either `a` or `b` in `s`. | |
/// | |
/// Returns the index of the first occurrence of either `a` or `b` in `s`, | |
/// as well as a boolean indicating whether the first occurrence was `a`. | |
/// (If it was `b`, the boolean is `false`.) | |
fn find_one_of(s: &str, a: &str, b: &str) -> Option<(usize, bool)> { | |
let control_flow = | |
s.bytes() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name McMaster Avenue to Learn Fast Login | |
// @namespace http://github.com/vidhanio | |
// @description Skip the two clicks needed to log in to Avenue to Learn. | |
// @match https://avenue.cllmcmaster.ca/d2l/login | |
// @match https://avenue.mcmaster.ca | |
// @author Vidhan Bhatt | |
// ==/UserScript== | |
const target = new URLSearchParams(window.location.search).get("target"); |