Skip to content

Instantly share code, notes, and snippets.

@guiyuanju
guiyuanju / ob-babashka.el
Created September 9, 2022 16:19 — forked from adam-james-v/ob-babashka.el
a quick change of ob-clojurescript to try use Babashka.
;;; ob-babashka.el --- org-babel functions for ClojureScript evaluation -*- lexical-binding: t; -*-
;; Author: Adam James Vermeer
;; Maintainer: Adam James Vermeer
;; Created: 25 June 2021
;; Keywords: literate programming, reproducible research, babashka, clojure, scripting
;; Homepage: https://gist.github.com/adam-james-v/f4d2b75a70b095d14a351a1eff96b4b0
;; Package-Requires: ((emacs "24.4") (org "9.0"))
;; This file is modified from [[https://github.com/emacsmirror/ob-clojurescript/blob/master/ob-clojurescript.el][ob-clojurescript]]
@guiyuanju
guiyuanju / rename-current-file.el
Created July 17, 2021 14:19
emacs: rename current file and visit new file in current buffer
;; based on https://stackoverflow.com/a/384346
(defun my/rename-current-file ()
(interactive)
(let ((name (buffer-name))
(file-name (buffer-file-name)))
(if file-name
(let ((new-name (read-from-minibuffer
(concat "New name for: ")
file-name)))
@guiyuanju
guiyuanju / delete-current-file-buffer-window.el
Last active July 17, 2021 13:12
delete visiting file, buffer and window with trash enabled
;; based on https://gist.github.com/hyOzd/23b87e96d43bca0f0b52
(defun my/delete-current-file ()
(interactive)
(let ((filename (buffer-file-name)))
(if filename
(when (y-or-n-p (concat "delete file " filename "?"))
(progn
(delete-file filename t)
(message "%s deleted" filename)
@guiyuanju
guiyuanju / readme.md
Created August 17, 2017 19:14
select2-preload-extension

useage

option

preload:

  • true: the dropdown list will be loaded immediately and won't change based on your input. (the option ajax of select2 needed.)
  • false: this option won't change anything.
  • function: the returned value of function will be loaded if your input length is less than minimumInputLength. (the option ajax& minimumInputLength of select2 needed.)