Skip to content

Instantly share code, notes, and snippets.

View ajchemist's full-sized avatar
🕶️

ajchemist

🕶️
  • Korean Peninsula
View GitHub Profile
@ajchemist
ajchemist / snapshot.el
Created August 28, 2015 03:56
snapshot.el obsolete
(defun snapshot (in)
(interactive "DChoose directory to snapshot: ")
;; (let (( default-directory)))
(let* ((in (directory-file-name in))
(base (file-name-directory in))
(default-directory base)
(timestamp (format-time-string "%y%m%d-%H%M" (current-time)))
(out (expand-file-name
(format ".snapshot/%s-%s"
timestamp (file-name-nondirectory in))
#+TITLE: Emacs.org
#+INCLUDE: emacs_journal.org :minlevel 1
# ---------------------------------------------------------------
#+TITLE: Emacs Journal.org
#+ARCHIVE: emacs.org::
# 이제 emacs_journal.org에서 org-archive를 실행하면, emacs.org_archive
;;;; erc4klisper.el starts here
;;; Usage:
;;; 1. append this code to ~/.emacs
;;; 2. locate this file to your custom `load-path',
;;; and adding to ~/.emacs
;;;
;;; (require 'erc4klisper)
;;;
;;; or
;;;
(let* ((config-dir user-emacs-directory)
(config-file (expand-file-name ".config" config-dir)))
(defmacro with-el-config (&rest body)
`(let* ((__parsed-data__ ',(cdr (with-temp-buffer
(insert-file-contents-literally config-file)
(search-forward "load-with-config" nil t)
(end-of-defun)
(preceding-sexp))))
(__load-file-name__ load-file-name)
(__id__ ',(intern (file-relative-name
(defun winnum-select (&optional num)
"Selects the nth window."
(interactive (list (let (_)
(while (or (not (characterp _))
(<= _ 48) ; 0 not included
(and (> _ 57) (< _ 97))
(> _ 122))
(setq _ (read-event
#("Switch to Winnum: " 0 18
(face minibuffer-prompt)))))
;;;; usage -*- lexical-binding: t; -*-
;;; download this gist file, `winnum.el' and place it on one of your `load-path'.
;;; now, M-x byte-compile-file winnum.el RET and then M-x load-library winnum RET.
;;; f8 or super-o keybinding do all the fun!
;;; winnum id is on a mode-line.
;;;
;;;
;;; -UUU:**-1-F1 *scratch* All (1,0) (Fundamental yas) ---------------
;;; ^
;;; +---this!
(setq xcycle '#1=(("p1" . "t1") ("p2" . "t2") . #1#))
(cadr (member (assoc-string "p2" xcycle) xcycle))
(setq xcycle '#1=("p1" "t1" "p2" "t2" . #1#))
(cddr (member "p2" xcycle))
(defun rcirc-format-response-string (process sender response target text)
"Return a nicely-formatted response string, incorporating TEXT
\(and perhaps other arguments). The specific formatting used
is found by looking up RESPONSE in `rcirc-response-formats'."
(with-temp-buffer
(insert (or (cdr (assoc response rcirc-response-formats))
(cdr (assq t rcirc-response-formats))))
(goto-char (point-min))
(let ((start (point-min))
(sender (if (or (not sender)
(defvar frame-bar-pixel-num (cc-eval-when-compile
(case window-system ((ns) 23))))
(defvar desktop-taskbar-pixel-num (cc-eval-when-compile
(case window-system ((ns) 22))))
(defun mkfparams (direction rframe &optional move)
(let ((horizontalp (memq direction '(left right)))
(fp/left (frame-parameter rframe 'left))
(fp/top (frame-parameter rframe 'top))