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
function* range(a=0, b=100) { | |
while (a <= b) { | |
yield a; | |
a = a+1; | |
} | |
yield range(a=b, b=b+b); | |
} | |
var i = range(); |
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
(defun new-with-mode () | |
"Open a new buffer with a selected major-mode MODE." | |
(interactive "") | |
(let* ((modes (mapcar #'cdr (cl-remove-if-not (lambda (l) (length= l 1)) auto-mode-alist))) | |
;; (modes (list #'python-mode #'js-mode #'org-mode)) | |
(rev (mapcar (lambda (m) (cons (symbol-name m) m)) modes)) | |
(mode-pair (assoc (ido-completing-read | |
"mode> " | |
(mapcar #'symbol-name modes)) | |
rev)) |
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
;;; quick naive contextual template WIP | |
(defun replace-by-transient-overlay () | |
"copy word at point as w | |
kill-word | |
create overlay with text `w' | |
overlay map -> any char -> delete overlay" | |
:todo) | |
(defun l/line-template-at-point () |
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
;;; y.el | |
;;; url -> yt-dlp -> mpv | |
;;; | |
" | |
url | |
-> title and formats[id, url] | |
-> completing-read | |
" |
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
'(("b" "blog" entry | |
(file+function "~/org/blog.org" end-of-buffer) | |
"* %T %^{TITLE} %^g | |
> %^{MOOD}p | |
> %c | |
> %x | |
> %i | |
> %F | |
%?")) |
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
# you can type stuff blind, listen to it to check, and do it again | |
which espeak || echo "you need to install espeak" | |
while true; do read word; echo $word | espeak ; sleep 1; echo "next" | espeak ; sleep 1 ; done |
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
""" | |
a tree eDSL to describe filesystems or similar | |
- can stack children | |
- can indicate a point up in the tree (//, mark ?).. | |
- can shift back up (-, up ?) | |
- can stack non atomic values, list ? generators ? sub Tre ? | |
- can have domain specific children (inject(filename)) | |
to describe the content of the tree later on |
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
class Repeated { | |
constructor(delay, cond, fn, state) { | |
this.delay = delay; | |
this.cond = cond; | |
this.fn = fn; | |
this.state = state; | |
this.timer = null; | |
this.timers = []; | |
} |
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
select schemaname as table_schema, | |
relname as table_name, | |
pg_size_pretty(pg_total_relation_size(relid)) as total_size, | |
pg_size_pretty(pg_relation_size(relid)) as data_size, | |
pg_size_pretty(pg_total_relation_size(relid) - pg_relation_size(relid)) | |
as external_size | |
from pg_catalog.pg_statio_user_tables | |
order by pg_total_relation_size(relid) desc, | |
pg_relation_size(relid) desc | |
limit 10; |
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
class Flan: | |
def __init__(self, *a, **k): | |
self.a = a | |
self.k = k | |
self.chain = [] | |
def __floordiv__(self, other): | |
self.chain.append(other) | |
return self |
NewerOlder