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
export default { | |
"url": "https://www.dndbeyond.com/monsters?page=40", | |
"graph": { | |
"listing": { | |
"kind": "element", | |
"selector": ".listing-container", | |
"children": { | |
"items": { | |
"kind": "element", | |
"selector": ".info", |
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
{ | |
listing: { | |
kind: "element", | |
selector: "#listing", | |
children: { | |
items: { | |
kind: "element", | |
selector: ".item", | |
children: { | |
name: { |
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
const puppeteer = require('puppeteer'); | |
(async () => { | |
const browser = await puppeteer.launch(); | |
const page = await browser.newPage(); | |
await page.goto('https://example.com'); | |
await page.screenshot({path: 'example.png'}); | |
await browser.close(); | |
})(); |
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
;;;###autoload | |
(defun org-table-move-row-down () | |
"Move table row down." | |
(interactive) | |
(org-table-move-row nil)) | |
;;;###autoload | |
(defun org-table-move-row-up () | |
"Move table row up." | |
(interactive) |
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
# -*- eval: (progn (org-babel-goto-named-src-block "startup") (org-babel-execute-src-block-maybe)) -*- | |
#+title:Friday Rollplay | |
* startup | |
#+NAME: startup | |
#+begin_src emacs-lisp :results silent :tangle no | |
(let* ((buffer-name (buffer-file-name))) | |
(setq-local org-capture-templates | |
'(("o" "D&D Objective" entry |
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
log(data); | |
var handout = { | |
"id": data["_id"], | |
"title": data["name"], | |
"first": data.notes, | |
"second": data.gmnotes, | |
"picture": data["avatar"] | |
}; | |
log(handout); | |
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
import click | |
class ClickCLI(click.Group): | |
''' | |
Class-based Click CLI applications for extensibility. | |
class DeployerCLI(ClickCLI): | |
"Deploy stuff" | |
@click.option('--target') |
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
100*(100+5)*2 | |
"\\([-+]? ?\\([[:digit:]]+\\|(g<1>)\\)\\( ?[-*+/] ?g<1>\\)?\\)" | |
matches: | |
- first 100 | |
- 100+5 | |
- 2 | |
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 org-table-to-list () | |
(cl-loop while (org-at-table-p) | |
collect (prog1 | |
(mapcar | |
#'string-trim | |
(split-string | |
(buffer-substring-no-properties (line-beginning-position) (line-end-position)) | |
"|" | |
'omit-nulls)) | |
(forward-line)))) |
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 get_parser(commands): | |
parser = argparse.ArgumentParser() | |
subparsers = parser.add_subparsers(dest='action') | |
for action_name, action in commands.items(): | |
args = action.pop('arguments') if 'arguments' in action else {} | |
sp = subparsers.add_parser(action_name, **action) | |
for arg_name, argument in args.items(): | |
sp.add_argument(arg_name, **argument) | |
return parser |