Skip to content

Instantly share code, notes, and snippets.

@QiangF
QiangF / i3run
Created November 11, 2020 03:56 — forked from budRich/i3run
run, raise or minimize applications
#!/bin/bash
# i3run
# run, raise or minimize a program depending on its state.
#
# https://www.reddit.com/r/i3wm/comments/6x0p0q/oc_i3run/
# https://gist.github.com/budRich/8810a88a5a24080f4c499c65da76853b
#
# if target window doesn't exist, a given command is launched.
# if target window is on another workspace, it is moved to current
@amno1
amno1 / open-with.el
Last active May 24, 2020 07:59
open-with.el hacked for my own taste ...
;;; openwith.el --- Open files with external programs -*- lexical-binding: t; -*-
;; <2020-04-10 fre> A. Miller
;; Hacked openwith to not be a minor mode.
;; The handler is now changed to be interactive function so it can be bound
;; to a key and invoked manually when desired instead of being a global handler.
;; Assumes invocation from a dired buffer, so the name is changed
;; to reflect the prefered use case.
;; Copyright (C) 2007 Markus Triska
@Parassharmaa
Parassharmaa / booky.py
Created May 1, 2020 05:07
Python Script to Fetch Books from Libgen
import requests
from bs4 import BeautifulSoup
base_url = "http://gen.lib.rus.ec"
headers = {'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
'Accept-Encoding': 'gzip, deflate, sdch',
'Accept-Language': 'en-US,en;q=0.8',
@merrickluo
merrickluo / .doom.d-config.el
Last active September 18, 2023 09:22
Use pyim + liberime in doom-emacs
(use-package! liberime-config)
(use-package! pyim
;; :quelpa (pyim :fetcher github :repo "merrickluo/pyim")
:init
(setq pyim-title "R")
:config
;; (use-package pyim-basedict
;; :config
;; (pyim-basedict-enable))
(global-set-key (kbd "M-j") 'pyim-convert-string-at-point)
@mgalgs
mgalgs / active_window_xlib_demo.py
Created December 7, 2019 00:13
python-xlib example that prints the bbox of the currently active window
# Print the name and bounding box (x1, y1, x2, y2) for the active window in
# a loop.
import time
from collections import namedtuple
import Xlib
import Xlib.display
@wdkrnls
wdkrnls / hlwm.el
Created November 11, 2017 12:44
hlwm.el: control herbstluftwm from emacs
;;;; HLWM convience tools
;; author: Kyle Andrews
;; license: GPL V3 or later
(defun bash-path ()
"Return all the executables in the path according to bash.
This does not work as well as dmenu-path since it includes bash
reserved words in the result."
@budRich
budRich / i3run
Last active November 11, 2020 03:56
run, raise or minimize applications
#!/bin/bash
# i3run
# run, raise or minimize a program depending on its state.
#
# https://www.reddit.com/r/i3wm/comments/6x0p0q/oc_i3run/
# https://gist.github.com/budRich/8810a88a5a24080f4c499c65da76853b
#
# if target window doesn't exist, a given command is launched.
# if target window is on another workspace, it is moved to current
@budRich
budRich / i3get
Last active April 10, 2023 16:32
extract window information from i3 tree
#!/bin/sh
# i3get
#
# search for windows in i3 tree, return desired information
# if no arguments are passed. con_id of acitve window is returned.
# ctrl+c, ctrl+v by budRich 2017
# bash to sh by: nimaje
#
# Options:
@joshschmelzle
joshschmelzle / remap-capslock-to-control-win10.md
Last active April 19, 2026 02:55
Remap Caps Lock to Control on Windows 10

Ways to remap caps lock to control on Windows 10

These methods in this gist worked for me on my U.S.-based keyboard layouts. I am unsure about other layouts. If you have problems, revert your changes; delete the registry key you created (and reboot).

Update: you should probably scroll down to approach 4 where I suggest using Microsoft PowerToys Keyboard Manager.

Approach 1. Manually through regedit

Navigate to and create a new binary value in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout named Scancode Map.

@dhwajraj
dhwajraj / pdfmerger.py
Created January 14, 2017 13:55
pdf merging with filename as bookmarks.. got from github
#! /usr/bin/env python
# Original author Nicholas Kim, modified by Yan Pashkovsky
# New license - GPL v3
import sys
import time
from PyPDF2 import utils, PdfFileReader, PdfFileWriter
def get_cmdline_arguments():
"""Retrieve command line arguments."""