Skip to content

Instantly share code, notes, and snippets.

View jsntn's full-sized avatar

Jason TIAN jsntn

View GitHub Profile
@nonducor
nonducor / clocktable-by-tag.el
Last active February 6, 2025 09:40 — forked from ironchicken/clocktable-by-tag.el
Emacs org-mode dynamic block similar to clocktable, but grouped by tag. See: https://stackoverflow.com/questions/70568361/org-mode-review-clocked-time-by-multiple-tags
(require 'org-clock)
(defun clocktable-by-tag/shift-cell (n)
(let ((str ""))
(dotimes (i n)
(setq str (concat str "| ")))
str))
(defun clocktable-by-tag/insert-tag (files params)
(let ((tag (plist-get params :tags))
@codekoriko
codekoriko / Readme.md
Last active January 7, 2025 01:46
for Dual Display: calculate both display extends and Shift cursor from one display to the other on a key press

For Windows Users only

On Dual Display setup, I found it frustrating that the cursor is not bounded to sides of the display anymore. For example reaching the "close window" button needs precise muscle control whereas before you could simply crash again the top & right screen border and smash that window.

So I keep both display separated and created an AutoHotKey script to shift the cursor from my first to my second display on a press of a button.

Setup:

Separate both Display

  • Win+S -> search: "extend" -> "Duplicate or extend a connected Display"
  • Move display 2 far away to the Top/bottom left/right corner.
(defun vulpea-project-p ()
"Return non-nil if current buffer has any todo entry.
TODO entries marked as done are ignored, meaning the this
function returns nil if current buffer contains only completed
tasks."
(seq-find ; (3)
(lambda (type)
(eq type 'todo))
(org-element-map ; (2)
@brenopacheco
brenopacheco / howto.md
Last active September 8, 2023 02:11
storing git credentials with gpg and .netrc

storing git credentials with gpg and .netrc

  1. set up git credential helper in .gitconfig
    [credential]
        helper = /usr/share/git/credential/netrc/git-credential-netrc.perl
  1. add login configuration to .netrc
@AloisJanicek
AloisJanicek / org-protocol-to-wsl-emacs.reg
Created November 29, 2020 22:44
Org-protocol setup with emacs inside WSL
REGEDIT4
[HKEY_CLASSES_ROOT\org-protocol]
@="URL:Org Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\org-protocol\shell]
[HKEY_CLASSES_ROOT\org-protocol\shell\open]
[HKEY_CLASSES_ROOT\org-protocol\shell\open\command]
@="\"C:\\BIN\\org-protocol-to-wsl-helper.bat\" \"%1\""
@exdeniz
exdeniz / migrate_from_exist_hitory.sh
Created June 6, 2020 21:17
Remove Duplicate zsh History
cat -n .zsh_history | sort -t ';' -uk2 | sort -nk1 | cut -f2- > .zhistory
@redguardtoo
redguardtoo / sort-chinese-word-list.el
Created May 24, 2020 13:16
Sort Chinese word list by pinyin
(defconst my-chinese-pinyin-order-hash
#s(hash-table size 30 test equal data (
"一" 375
"乙" 381
"二" 81
"十" 293
"丁" 72
"厂" 35
"七" 264
"卜" 20
@MatthewZMD
MatthewZMD / .mbsyncrc
Last active March 21, 2025 23:35
.mbsyncrc Sample
# Gmail Example
# mbsyncrc based on
# http://www.ict4g.net/adolfo/notes/2014/12/27/EmacsIMAP.html
# ACCOUNT INFORMATION
IMAPAccount gmail
# Address to connect to
Host imap.gmail.com
User <EMAIL_HERE>
PassCmd "gpg2 -q --for-your-eyes-only --no-tty -d ~/.emacs.d/mu4e/.mbsyncpass-<EMAIL_HERE>.gpg"
@kiennq
kiennq / emacs-async-config.el
Last active June 23, 2025 12:56
Limit number of async processes ever created at a time
(use-package async
:ensure t
:defer 5
:init
(setq async-bytecomp-allowed-packages '(all))
:config
;; async compiling package
(async-bytecomp-package-mode t)
(dired-async-mode 1)
;; limit number of async processes
@haikebang
haikebang / hacker-howto.md
Created September 6, 2018 07:29 — forked from zer4tul/hacker-howto.md
Simplified Chinese edition of ESR's How To Become A Hacker