Skip to content

Instantly share code, notes, and snippets.

View roife's full-sized avatar
💼
I may be slow to respond.

roife roife

💼
I may be slow to respond.
View GitHub Profile
@roife
roife / zshrc
Created October 27, 2024 12:48
zshrc
export LANGUAGE=en_US.UTF-8
# auto-completion
zstyle ':completion:*' list-colors "${(@s.:.)LS_COLORS}" # colors for ls
zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' # case-insensitive when completion with tab
autoload -U compinit
compinit
# cd folder without "cd"
setopt autocd
@roife
roife / gist:b20feaab1ae2b7e9b8904b01a8638463
Created May 13, 2021 17:32
A tampermonkey script to block <div> that containing certain keywords
// ==UserScript==
// @name <DIV> Blocker
// @namespace http://tampermonkey.net/
// @version 0.1
// @description A script to block <DIV> that containing certain keywords
// @author roife
// @require https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.slim.min.js
// @match *://*/*
// @grant none
// ==/UserScript==
@roife
roife / thing-edit-macro.el
Last active March 26, 2019 14:06
Use macro to simplify thing-edit.el
(defmacro thing-edit-defcopy (thing)
"Install funstions of copying for THING."
`(defun ,(intern (format "thing-edit-copy-%s" thing)) (kill-condition)
,(format "Copy %s at current point.
With the universal argument, the text will also be killed" thing)
(interactive "P")
(thing-edit ',thing kill-condition)
))
(defmacro thing-edit-defcut (thing)
@roife
roife / org-insert-image.el
Last active March 26, 2019 14:00
Insert an image from clipboard under macOS
(defun org-paste-image ()
"Insert images from clipboard under macOS."
(interactive)
(let* ((path (concat default-directory "img/"))
(image-file (concat
path
(buffer-name)
(format-time-string "_%Y%m%d_%H%M%S.png"))))
(if (not (file-exists-p path))
(mkdir path))