Skip to content

Instantly share code, notes, and snippets.

View qingshuizheng's full-sized avatar

Qingshui Zheng qingshuizheng

  • Wildomar, CA
View GitHub Profile
@qingshuizheng
qingshuizheng / git-recent-branches
Created January 11, 2024 20:17 — forked from mgaitan/git-recent-branches
List or checkout recently used branches in git
#!/usr/bin/env python3
"""
List the most recent branches you have been working on, and checkout any of them.
# Install
Put this file somewhere in your PATH, and set execution permissions.
Git will recognize it as the "recent-branches" subcommand.
# Usage
@qingshuizheng
qingshuizheng / git-sw
Last active January 11, 2024 20:20 — forked from mgaitan/git-sw
git smart switch : Like `git switch` but stashing uncommitted changes and recovering them when you are back.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Git smart switch
Like `git switch` but stashing uncommitted changes and recovering them when you are back.
# Note
This is a fork from https://gist.github.com/mgaitan/d9a3523d79cd5f9fbfd626f646f0560b, please go check the latest version.
@qingshuizheng
qingshuizheng / DefaultKeyBinding.dict
Created September 25, 2023 15:43 — forked from trusktr/DefaultKeyBinding.dict
My DefaultKeyBinding.dict for Mac OS X
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more
closely match default behavior on Windows systems. This makes the Command key
behave like Windows Control key. To use Control instead of Command, either swap
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys...
or replace @ with ^ in this file.
Here is a rough cheatsheet for syntax.
Key Modifiers
@qingshuizheng
qingshuizheng / JXA Resources.md
Created January 20, 2023 07:16 — forked from JMichaelTX/JXA Resources.md
JavaScript for Automation (JXA) Resources

JXA Resources

Revised: 2019-11-28 16:16 GMT-6

JXA

This is a list of the key resources I have found useful. If you know of others, please post in a comment below, and I will add to this list.

I have tried to order this list in the order that, to me, is best for learning JXA from scratch. We all learn a bit diferently, so adjust to suit your style/needs. Please post if you have suggestions on learning JXA.

@qingshuizheng
qingshuizheng / build-emacs.el
Created January 17, 2023 06:22 — forked from amno1/build-emacs.el
Build Custom Emacs from Git from Emacs
;;; build-emacs.el --- Build custom Emacs from sources -*- lexical-binding: t; -*-
;; Copyright (C) 2022 Arthur Miller
;; Author: Arthur Miller <arthur.miller@live.com>
;; Keywords: tools
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
@qingshuizheng
qingshuizheng / notmuch-hello-unread.el
Created November 15, 2022 06:44 — forked from runejuhl/notmuch-hello-unread.el
notmuch functions to show unread count in hello buffer
(defun notmuch-hello-insert-buttons (searches)
"Insert buttons for SEARCHES.
SEARCHES must be a list of plists each of which should contain at
least the properties :name NAME :query QUERY and :count COUNT,
where QUERY is the query to start when the button for the
corresponding entry is activated, and COUNT should be the number
of messages matching the query. Such a plist can be computed
with `notmuch-hello-query-counts'."
(let* ((widest (notmuch-hello-longest-label searches))
-- Daily backup archive.
-- Created by Christian Grunenberg on Mon Jun 22 2009.
-- Copyright (c) 2009-2015. All rights reserved.
-- Modified by Emilio Moreno to loop over all databases
-- I invoke this script every time my computer is locked
global all_databases
global folder_path
@qingshuizheng
qingshuizheng / fix-font-org-mode.el
Created August 27, 2022 08:25 — forked from Superbil/fix-font-org-mode.el
fix chinese font on Emacs
;;; base on https://gist.github.com/coldnew/7398835
(defvar emacs-english-font nil
"The font name of English.")
(defvar emacs-cjk-font nil
"The font name for CJK.")
(defvar emacs-font-size-pair nil
"Default font size pair for (english . chinese)")
@qingshuizheng
qingshuizheng / .emacs
Created July 16, 2022 06:14 — forked from redguardtoo/.emacs
minimum emacs setup for Emacs plugin testing
;; A minimum .emacs to test Emacs plugins
(show-paren-mode 1)
(eval-when-compile (require 'cl))
;; test elisps download from internet here
(setq test-elisp-dir "~/test-elisp/")
(unless (file-exists-p (expand-file-name test-elisp-dir))
(make-directory (expand-file-name test-elisp-dir)))
(setq load-path
@qingshuizheng
qingshuizheng / get_title_and_url.applescript
Created October 22, 2021 22:26 — forked from vitorgalvao/Get Title and URL.applescript
AppleScript and JavaScript for Automation to get frontmost tab’s url and title of various browsers.
-- AppleScript --
-- This example is meant as a simple starting point to show how to get the information in the simplest available way.
-- Keep in mind that when asking for a `return` after another, only the first one will be output.
-- This method is as good as its JXA counterpart.
-- Chromium variants include "Google Chrome", "Chromium", "Opera", "Vivaldi", "Brave Browser", "Microsoft Edge".
-- Specific editions are valid, including "Google Chrome Canary", "Microsoft Edge Dev".
-- "Google Chrome" Example:
tell application "Google Chrome" to return title of active tab of front window