This file contains hidden or 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
(def date-parsers [nil (java.text.SimpleDateFormat. "yyyy") (java.text.SimpleDateFormat. "yyyy-M") (java.text.SimpleDateFormat. "yyyy-M-dd")]) | |
(def grains [:decade :year :month :day]) ;; what's decade doing? | |
(map #(let [[_ year month day] (re-find #"(\d{2,4})[-_]([\dx]{2})[-_]([\dx]{2})" %) | |
date (first (split-with (partial not= "xx") [(if (= (count year) 2) (str "19" year) year) month day]))] | |
[(.parse (parsers (count date)) (clojure.string/join "-" date)) (grains (count date))]) | |
["thefilehasaname__1939-xx-01.mp3" | |
"thefilehasaname__39_01_01.mp3" | |
"thefilehasaname__39-01-01.mp3" |
This file contains hidden or 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
;; This is at: https://gist.github.com/8655399 | |
;; So we want a rhyming dictionary in Clojure. Jack Rusher put up | |
;; this code here: | |
;; | |
;; https://gist.github.com/jackrusher/8640437 | |
;; | |
;; I'm going to study this code and learn as I go. | |
;; | |
;; First I put it in a namespace. |
This file contains hidden or 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
set -g mode-mouse on | |
set -g mouse-resize-pane on | |
set -g mouse-select-pane on | |
set -g mouse-select-window on | |
set -g base-index 1 | |
setw -g aggressive-resize on | |
set-option -g status-utf8 on |
This file contains hidden or 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
;; .emacs | |
;;; uncomment this line to disable loading of "default.el" at startup | |
;; (setq inhibit-default-init t) | |
;; enable visual feedback on selections | |
(setq transient-mark-mode t) | |
;; default to better frame titles | |
(setq frame-title-format |
This file contains hidden or 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
;; I have | |
(def events ["== A ==" "=== A.1 ===" "* One" "* Two" "** Two.A" "** Two.B" "== B =="]) | |
;; (i.e. wikipedia markup) And what I want is: | |
;; (("== A ==" | |
;; ("=== A.1 ===" | |
;; ("* One" | |
;; "* Two" | |
;; ("** Two.A" |
NewerOlder