Skip to content

Instantly share code, notes, and snippets.

View yimingliu's full-sized avatar

yimingliu

View GitHub Profile
@yimingliu
yimingliu / pass-gen.py
Last active September 28, 2020 03:54
script to generate password tokens of arbitrary length
#!/usr/bin/env python3
import secrets
import string
import argparse
def gen_pass(length, symbols=None, no_numbers=False, no_upper=False):
alphabet = string.ascii_letters
if no_upper:
alphabet = string.ascii_lowercase
@yimingliu
yimingliu / firefox-keyboard-shortcuts-82.patch
Last active December 25, 2020 00:06
Firefox 82.0 source code patch to change New Private Window shortcut to Cmd-Shift-N (like Safari) and Go Home key to Command-Shift-H (like Safari)
diff -urN firefox-82.0.3-orig/browser/base/content/browser-sets.inc firefox-82.0.3/browser/base/content/browser-sets.inc
--- firefox-82.0.3-orig/browser/base/content/browser-sets.inc 2020-11-08 12:21:54.000000000 -0800
+++ firefox-82.0.3/browser/base/content/browser-sets.inc 2020-11-14 17:15:57.000000000 -0800
@@ -212,7 +212,7 @@
<key id="goBackKb2" data-l10n-id="nav-back-shortcut-alt" command="Browser:Back" modifiers="accel"/>
<key id="goForwardKb2" data-l10n-id="nav-fwd-shortcut-alt" command="Browser:Forward" modifiers="accel"/>
#endif
- <key id="goHome" keycode="VK_HOME" oncommand="BrowserHome();" modifiers="alt"/>
+ <key id="goHome" data-l10n-id="yliu-go-home" oncommand="BrowserHome();" modifiers="accel,shift"/>
<key keycode="VK_F5" command="Browser:Reload"/>
@yimingliu
yimingliu / twitterfeed.php
Last active February 10, 2021 22:04 — forked from russellbeattie/twitterfeed.php
Twitter JSON to Atom feed proxy for Twitter API 1.1
<?php
/*
Twitter JSON to Atom proxy for Twitter API 1.1 - @yliu
Original version by Russell Beattie ( https://gist.github.com/russellbeattie/3898467 )
Fork of upstream to remove use of short tags; add t.co expansion and URL formatting for feed reader
License: BSD
*/
date_default_timezone_set('America/Los_Angeles');