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
#!/home/xxx/.rbenv/versions/3.2.0/bin/ruby | |
require 'open3' | |
def ms2str(ms) | |
return nil if ms.nil? | |
x, ms = ms.divmod(1000) | |
x, s = x.divmod(60) | |
x, m = x.divmod(60) | |
d, h = x.divmod(24) |
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
(defun |#"-reader| (stream sub-char numarg) | |
(declare (ignore sub-char numarg)) | |
(let (chars) | |
(do ((prev (read-char stream) curr) | |
(curr (read-char stream) (read-char stream))) | |
((and (char= prev #\") (char= curr #\#))) | |
(push prev chars)) | |
(coerce (nreverse chars) 'string))) | |
(set-dispatch-macro-character #\# #\" #'|#"-reader|) |