Skip to content

Instantly share code, notes, and snippets.

View billmei's full-sized avatar
☑️
Verified Profile

Bill Mei billmei

☑️
Verified Profile
View GitHub Profile
@billmei
billmei / checklist.md
Created May 13, 2021 11:38
Car checklist

Exterior

  • Windshield free of cracks
  • Body panel colors match
  • Magnet adheres to all steel body panels
  • Fresh paint job (if yes, it could be to conceal rust)
  • Seams where the trunk and hood close are properly aligned
  • Seams where doors and fenders meet are properly aligned
  • Free of body scratches
  • Free of body dents
@billmei
billmei / keepalive.js
Created January 14, 2021 16:17
Tampermonkey script to prevent Queen's MyCareer, Moodle, and D2L sessions from timing out.
// ==UserScript==
// @name KeepAlive
// @namespace https://billmei.net
// @version 0.1
// @description Prevents Queen's MyCareer, Moodle, and D2L from timing out
// @include https://careers.sso.queensu.ca/*
// @include https://moodle.queensu.ca/*
// @include https://qsblearning.ca/*
// @copyright 2014, Bill Mei
// ==/UserScript==
@billmei
billmei / jQuery_inject.js
Created August 29, 2020 02:32
Inject jQuery into a page. Useful from the DevTools console if the site doesn't have jQuery. Avoids CSP issues.
// From https://stackoverflow.com/a/55885836/2142259
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"
document.getElementsByTagName('head')[0].appendChild(jq);
@billmei
billmei / edx_speed_options.js
Last active August 30, 2020 01:34
Add extra speed options like 2x playback on EdX videos.
// In the new EdX, a redirect is required to go inside the iframe before executing custom JavaScript
open(document.getElementById('unit-iframe').src)
// After the new tab is opened, you can run the code below in that tab (not the old tab).
// To use, paste into your DevTools console, create a bookmarklet, or use a browser extension like Tampermonkey.
const addSpeedOption = (speed) =>
$('.video-speeds').prepend(`<li data-speed="${speed}"><button class="control speed-option" tabindex="-1" aria-pressed="false">${speed}x</button></li>`)
addSpeedOption(2);
addSpeedOption(2.5);
@billmei
billmei / piazza_hotkeys.js
Last active September 17, 2019 23:51 — forked from zzeleznick/piazza_hotkeys.js
Provides hotkey support for piazza. Paste into the Chrome Dev Console for use. This fork changes the keycodes to Gmail/Vim defaults.
(function() {
/*
Provides hotkey support for navigating many posts on piazza.
1) e + alt: archives the current post and navigates to the previous post
2) u + alt: marks the current post as unread and navigates to the previous post
3) k + alt: navigates to the more recent post from current
4) j + alt: navigates to the older post
*/
// keycodes: http://keycode.info/
const keyArchive = 69; // alt + e
@billmei
billmei / timelapse.md
Last active January 14, 2022 10:54 — forked from Sybrand/timelapse.md
ffmpeg time-lapse

Convert sequence of GoPro Hero 6 Black JPEG images to MKV / MP4 video

ffmpeg \
  -r 30000/1001 \
  -pattern_type glob -i '*.JPG' \
  -vf "crop=in_w:in_w*9/16,scale=3840:-2" \
  -sws_flags lanczos \
  -pix_fmt yuv420p \
 -vcodec libx264 \
@billmei
billmei / halting_problem.rb
Created March 18, 2018 18:55
Halting problem simple proof in Ruby
# Assume we are able to write a function, magical_solver, which can magically
# determine whether or not a function halts
def magical_solver(source_code)
# outputs 'true' if fn.source_code halts
# outputs 'false' if fn.source_code doesn't halt
end
def always_halt
# Always halts
end
@billmei
billmei / obtuse_goose.py
Last active June 7, 2017 04:38
Decrypts the email address on Abstruse Goose's contact page.
"""
Decrypts the contact information on the Abstruse Goose website
Picture found here: http://abstrusegoose.com/contact.png
The output email is lcfr@abstrusegoose.com
"""
def main():
nums = [0b01101100, 0b01100011, 0b01100110, 0b01110010, 0b01000000, 0b01100001, 0b01100010, 0b01110011, 0b01110100, 0b01110010, 0b01110101, 0b01110011, 0b01100101, 0b01100111, 0b01101111, 0b01101111, 0b01110011, 0b01100101, 0b00101110, 0b01100011, 0b01101111, 0b01101101]
asciiVals = {"0x0": "nul", "0x1": "soh", "0x2": "stx", "0x3": "etx", "0x4": "eot", "0x5": "enq", "0x6": "ack", "0x7": "bel", "0x8": "bs", "0x9": "tab", "0xa": "lf", "0xb": "vt", "0xc": "ff", "0xd": "cr", "0xe": "so", "0xf": "si", "0x40": "@", "0x41": "a", "0x42": "b", "0x43": "c", "0x44": "d", "0x45": "e", "0x46": "f", "0x47": "g", "0x48": "h", "0x49": "i", "0x4a": "j", "0x4b": "k", "0x4c": "l", "0x4d": "m", "0x4e": "n", "0x4f": "o", "0x10": "dle", "0x11": "dc1", "0x12": "dc2", "0x13": "dc3", "0x14": "dc4", "0x15": "nak", "0x16": "syn", "0x17": "etb", "
@billmei
billmei / intermediate.py
Created June 7, 2017 04:22
Playing around with Intermediate Python
#!/usr/bin/env python3
"""
Playing around with Intermediate Python
http://book.pythontips.com/en/latest/index.html
"""
def multiple_params(f_arg, *args):
"""Unpacking an *args"""
print('First argument:', f_arg)
@billmei
billmei / keybase.md
Created June 1, 2017 05:03
Keybase Proof

Keybase proof

I hereby claim:

  • I am billmei on github.
  • I am billmei (https://keybase.io/billmei) on keybase.
  • I have a public key ASCrWJt05T95dbrIeL45z7Krgt10D3DjVXfsDYrlLl_IUwo

To claim this, I am signing this object: