Skip to content

Instantly share code, notes, and snippets.

View panzy's full-sized avatar

Zhiyong Pan panzy

  • Ottawa, ON Canada
View GitHub Profile
@panzy
panzy / leetcode-to-github.js
Last active September 17, 2022 19:51
Commit your LeetCode submission to Github! Usage: This is a Tampermonkey script. Open a submission detail page and execute this script from the context menu.
// ==UserScript==
// @name LeetCode to Github
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Commit your LeetCode submission to Github! Usage: Open a submission detail page and execute this script from the context menu.
// @author Zhiyong Pan
// @match https://leetcode.com/submissions/detail/*
// @match https://leetcode.com/contest/*/submissions/detail/*
// @grant none
// @require http://code.jquery.com/jquery-1.12.4.min.js
@panzy
panzy / Tampermonkey userscript: Enhance Cambridge Dictionary word list.js
Last active August 27, 2021 14:56
Tampermonkey userscript: modify the delete buttons of Cambridge Dictionary word list
/**
* Modify Cambridge Dictionary word list:
* 1. change the delete button's behavior, preventing it from reloading the list,
* to avoid losing the scrolling position;
* 2. move the delete button from the bottom of a item to the top of it, so that
* it's possible to delete a word and see the next word but not its explanation,
* provided that you have scrolled the deleted word's explanation to below the
* page bottom.
*
* Usage: run this script on word list page, a "delete" link should appear inside each word entry.
@panzy
panzy / svn-am.sh
Last active September 1, 2017 09:18
like git-am, but for svn: Apply a series of patches from a mailbox. -- MAY BE DANGEROUS!!
#!/bin/bash
#
# like git-am, but for svn: Apply a series of patches from a mailbox.
#
# usage:
# $ svn-am.sh PATCH-FILES
#
# --
# panzy
# 2017-09-01 16:34:10