Skip to content

Instantly share code, notes, and snippets.

@QiangF
QiangF / README.org
Created July 6, 2023 06:52 — forked from douo/README.org
Emacs (no-x) as kitty scrollback_pager

Test on:

  • Linux
  • macOS

Linux dependencies:

  • xsel

~/.local/bin/kitty_emacs_pager

@QiangF
QiangF / eink_clean.ahk
Created April 12, 2023 06:10 — forked from llinfeng/eink_clean.ahk
Force full-screen refresh on e-ink monitors
#SingleInstance, force ; Allow only one instance of this script to be running.
#Persistent ; To stop the script from exiting.
; Here, press F1 to trigger the black/white flash
F1::
; Source: https://superuser.com/questions/662264/i-would-like-to-make-the-screen-go-black-every-8-seconds-how
Gui, Color, 000000
Gui, Show, x-5000 y-20 w8000 h8000
sleep 333
Gui, Color, FFFFFF
@QiangF
QiangF / sway_workspaces.py
Created September 14, 2022 01:36 — forked from Nama/sway_workspaces.py
Restore workspaces in sway to displays and move applications to saved workspaces
#!/usr/bin/python
'''
* setup displays first, e.g. with wdisplay
* run after setting up your displays `python sway_workspaces.py save <profilename>`
* repeat for every display setup
* setup kanshi and make it run `python sway_workspaces.py load <profilename>`
Multiple windows of an application/class aren't handled. No idea how to do so.
Had to alter the default tree, so the outputs are not the ports.
@QiangF
QiangF / lisp-resources-digikar-2020.md
Created September 11, 2022 07:10 — forked from digikar99/lisp-resources-digikar-2020.md
If programming is more than just a means of getting things done for you, then Common Lisp is for you!

Why not: from Common Lisp to Julia

This article is a response to mfiano’s From Common Lisp to Julia which might also convey some developments happening in Common Lisp. I do not intend to suggest that someone coming from a Matlab, R, or Python background should pickup Common Lisp. Julia is a reasonably good language when compared to what it intends to replace. You should pickup Common Lisp only if you are interested in programming in general, not limited to scientific computing, and envision yourself writing code for the rest of your life. It will expand your mind to what is possible, and that goes beyond the macro system. Along the same lines though, you should also pickup C, Haskell, Forth, and perhaps a few other languages that have some noteworthy things to teach, and that I too have been to lazy to learn.

/I also do not intend to offend anyone. I’m okay with criticizing Common Lisp (I myself have done it below!), but I want t

@QiangF
QiangF / auto-rsync.el
Created September 2, 2022 00:30 — forked from mtmtcode/auto-rsync.el
auto-rsync.el - Emacs minor mode to execute rsync automaticlly
;;; auto-rsync-mode -- minor mode for auto rsync
;;
;; Author: @l3msh0
;;
;;; Example
;;
;; (require 'auto-rsync)
;; (auto-rsync-mode t)
;; (setq auto-rsync-dir-alist
@QiangF
QiangF / i3ass-drr
Created August 27, 2022 02:12 — forked from budRich/i3ass-drr
A small script that runs/activate or hide target window in i3
#!/bin/bash
#
# i3ass-drr -n "name" -c "class" -i "instance/classname" -m "mark" -r "command"
while getopts c:n:r:i:m: option
do
case "${option}"
in
c) aSrch=("${aSrch[@]}" --class "${OPTARG}");;
@QiangF
QiangF / lubuntu-rc.xml
Created August 24, 2022 08:54 — forked from zrajm/lubuntu-rc.xml
Openbox Keybindings for Window Tiling (using windows key + arrow keys).
<!--
Keybindings for Window Tiling
=============================
For the below code to work insert it into the <keyboard> section of your
openbox config. On Lubuntu it's called `~/.config/openbox/lubuntu-rc.xml`, and
on Arch `~/.config/openbox/rc.xml`. To reload the config after modifying it,
you can either logout and login again, or run the command
openbox -\-reconfigure
@QiangF
QiangF / x11_watch_active_window.py
Created July 15, 2022 09:21 — forked from ssokolow/x11_watch_active_window.py
python-xlib example which reacts to changing the active window
#!/usr/bin/env python
"""python-xlib example which reacts to changing the active window/title.
Requires:
- Python
- python-xlib
Tested with Python 2.x because my Kubuntu 14.04 doesn't come with python-xlib
for Python 3.x.
// ==UserScript==
// @name 湖南农信加速学习
// @version 1
// @description 二、三分屏,在线制作 三类课程加速学习
// @match http://hnnxyxt.21tb.com/els/html/courseStudyItem/courseStudyItem.learn.do*
// @require https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js
// @grant none
// ==/UserScript==
var uri;// = decodeURIComponent($("#aliPlayerFrame")[0].src);