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-shortcuts-and-compile-127.patch
Last active June 22, 2024 18:17
Firefox 127.0.1 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-124.0.1-orig/browser/base/content/browser-sets.inc firefox-124.0.1/browser/base/content/browser-sets.inc
--- firefox-124.0.1-orig/browser/base/content/browser-sets.inc 2024-03-21 21:05:13
+++ firefox-124.0.1/browser/base/content/browser-sets.inc 2024-04-01 00:29:51
@@ -216,7 +216,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="BrowserCommands.home();" modifiers="alt"/>
+ <key id="goHome" data-l10n-id="yliu-go-home" oncommand="BrowserCommands.home();" 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');