Instantly share code, notes, and snippets.
🏠
Working from home
zw963 /.wezterm.lua
Last activeFebruary 5, 2024 17:30
The best emacs like editor for use in terminal. (e.g. docker/remote vps) This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
-- Pull in the wezterm API | |
localwezterm=require'wezterm' | |
localact=wezterm.action | |
localmux=wezterm.mux | |
-- This table will hold the configuration. | |
localconfig= {} | |
-- In newer versions of wezterm, use the config_builder which will | |
-- help provide clearer error messages |
zw963 /gist_init.el
CreatedOctober 12, 2022 14:41
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
(require'gist) | |
(provide'gist_init) | |
;;; gist_init ends here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ensure add this rm script's $PATH before system /usr/bin/rm command. | |
# a linux rm (wrapper) script which can only use -rf/-r/-f option immediately following rm command. | |
# e.g. | |
# rm ~/.cache -rf # failed! with rm: -rf: No such file or directory | |
# rm -rf ~/.cache # success! | |
case"${@:(-1)}"in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
#! /bin/bash | |
USE_COPY= | |
functionreadlink1() { | |
(cd"$1"&&pwd -P) | |
} | |
functionbackup () { | |
mv$*$*_bak-$(date'+%Y-%m-%d_%H:%M') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
(defvar-local +lsp--flycheck-eglot--current-errorsnil) | |
(defun +lsp--flycheck-eglot-init (checker callback) | |
"CHECKER is the checker (eglot). | |
CALLBACK is the function that we need to call when we are done, on all the errors." | |
(eglot-flymake-backend#'+lsp--flycheck-eglot--on-diagnostics) | |
(funcall callback'finished +lsp--flycheck-eglot--current-errors)) | |
(defun +lsp--flycheck-eglot--on-diagnostics (diags&rest _) | |
(cl-labels |
zw963 /multi-vterm_init.el
CreatedFebruary 19, 2022 16:53
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
(require'multi-vterm) | |
(defuntoggle-drop-down-term () | |
"Open a drop-down terminal in the same directory as the current file." | |
(interactive) | |
(require'multi-vterm) | |
(let ((win (get-local-window-for-buffer-name"*vterminal"))) | |
(if win | |
(delete-window win) | |
(let ((vterm-buffer |
zw963 /multi-vterm_init.el
CreatedFebruary 19, 2022 16:53
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
(require'multi-vterm) | |
(defuntoggle-drop-down-term () | |
"Open a drop-down terminal in the same directory as the current file." | |
(interactive) | |
(require'multi-vterm) | |
(let ((win (get-local-window-for-buffer-name"*vterminal"))) | |
(if win | |
(delete-window win) | |
(let ((vterm-buffer |
zw963 /multi-vterm_init.el
CreatedFebruary 19, 2022 16:51
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
(require'multi-vterm) | |
(defuntoggle-drop-down-term () | |
"Open a drop-down terminal in the same directory as the current file." | |
(interactive) | |
(require'multi-vterm) | |
(let ((win (get-local-window-for-buffer-name"*vterminal"))) | |
(if win | |
(delete-window win) | |
(let ((vterm-buffer |
zw963 /multi-vterm_init.el
CreatedFebruary 19, 2022 16:46
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
(require'multi-vterm) | |
(defundrop-down-term () | |
"Open a drop-down terminal in the same directory as the current file." | |
(interactive) | |
(require'multi-vterm) | |
(let ((win (get-local-window-for-buffer-name"*vterminal"))) | |
(if win | |
(delete-window win) | |
(let ((vterm-buffer |
zw963 /test_new.rb
CreatedJanuary 15, 2022 17:50
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
begin | |
require"bundler/inline" | |
rescueLoadError=>e | |
$stderr.puts"Bundler version 1.10 or later is required. Please update your Bundler" | |
raisee | |
end | |
gemfile(true)do |
NewerOlder