Skip to content

Instantly share code, notes, and snippets.

View palikhov's full-sized avatar
🐉
E5E / SRD 5.1 rus / Excel GM Tools

Anton Palikhov palikhov

🐉
E5E / SRD 5.1 rus / Excel GM Tools
View GitHub Profile
[
{
"title": "Aboleth",
"icon": "imp-laugh",
"contents": [
"subtitle | Large aberration, lawful evil",
"rule",
"property | Armor class | 17 (Natural Armor)",
"property | Hit points | 135 (18d10 + 36)",
"property | Speed | 10 ft., swim 40 ft. ",
@palikhov
palikhov / docx2md.md
Created November 23, 2022 00:36 — forked from jesperronn/docx2md.md
Convert a Word Document into MD

Converting a Word Document to Markdown in One Move

The Problem

A lot of important government documents are created and saved in Microsoft Word (*.docx). But Microsoft Word is a proprietary format, and it's not really useful for presenting documents on the web. So, I wanted to find a way to convert a .docx file into markdown.

Installing Pandoc

On a mac you can use homebrew by running the command brew install pandoc.

The Solution

@palikhov
palikhov / docx2md.sh
Created November 23, 2022 00:35 — forked from Christian-G/docx2md.sh
Convert Word documents into Markdown
#!/bin/bash
#
# generate a Markdown version of a word document. Goes in separate folder, since
# images are extracted and converted as well (separate folder avoids naming clashes).
#
# REQUIREMENTS: pandoc
#
#
# with pandoc
# --extract-media=[media folder]
@palikhov
palikhov / monsters2cards.rb
Created November 23, 2022 00:33 — forked from tkfu/monsters2cards.rb
A quickie script to turn the monsters scraped with [this script](https://gist.github.com/tkfu/bc5dc2c6cee4d1e582a3d369c3077bb5) into cards you can use [here](https://crobi.github.io/rpg-cards/generator/generate.html)
# Probably only works on Ruby 2.5.0
require 'json'
def create_monster mon
cont = []
cont.append("subtitle | #{mon['meta']}")
cont.append("rule")
cont.append("property | Armor class | #{mon['Armor Class']}")
cont.append("property | Hit points | #{mon['Hit Points']}")
@palikhov
palikhov / beyond-scraper.rb
Created November 23, 2022 00:33 — forked from tkfu/beyond-scraper.rb
Script to scrape SRD-licensed monster data from DnD Beyond. Brittle, simple, but it works as of the posting of this gist.
require 'json'
require 'nokogiri'
require 'open-uri'
require 'rails-html-sanitizer'
def get_monster_list
monster_urls = []
firstpage = Nokogiri::HTML(open("https://www.dndbeyond.com/monsters?filter-search=&filter-source=1&filter-type=0&page=1"))
num_pages = firstpage.xpath('//li[@class="b-pagination-item"]')[firstpage.xpath('//li[@class="b-pagination-item"]').length - 2].text.to_i
puts "Found #{num_pages} pages..."
@palikhov
palikhov / tokenVision.js
Last active January 30, 2022 17:39 — forked from tonifisler/tokenVision.js
Foundry VTT macros TOKEN VISION
// I addded :
// - Faerie Fire option
// - Light color option
// - Radiant consumption option (Aasimar)
let applyChanges = false;
new Dialog({
title: `Token Vision Configuration`,
content: `
<form>
@palikhov
palikhov / foundryvtt-token-vision.js
Last active January 30, 2022 17:40 — forked from p4535992/foundryvtt-token-vision.js
Foundry VTT Player Token Vision Macro
//A macro for the Foundry virtual tabletop that lets a user configure their token's vision and lighting setting. Has a dependency on About Time by Tim Posney.
if (canvas.tokens.controlled.length === 0)
ui.notifications.error("Please select a token");
if (game.modules.get("about-time").active != true)
ui.notifications.error("About Time isn't loaded");
let namedfields = (...fields) => {
return (...arr) => {
@palikhov
palikhov / 2Eto5E-conversion-summary.md
Created November 3, 2021 23:50 — forked from petersgiles/2Eto5E-conversion-summary.md
2E to 5E simple conversion guidelines

Updated 10 February 2015 (added link to Monster Traits and Actions)

This is the third in my series of conversion documents for D&D 5th Edition. (You can find the one for Next here and the one for 3.5/3E/Pathfinder here.) I created this document by comparing the 5E versions of monsters from the Monster Manual with their 2E counterparts. I also referred to two sources for converting monsters from 2E to 3E: Wizards’ official

@tawilliams
tawilliams / gist:ad613962b9a298d54ba2baf77cf0d494
Last active November 3, 2021 19:11
Waterdeep interactive website import to Foundry VTT (First Function is to define wait, Second function, between comments, is folder code grabber)
async function wait (ms) {
return new Promise(resolve=>{
setTimeout(resolve,ms);
});
}
/* utility to get my existing folder names + IDs
game.folders.forEach((value) => {
console.log(value.data.name + " " + value.data._id)
})
!chatmenu @{selected|character_id} {template:npcaction}{{rname=@{selected|character_name}}}{{name=@{selected|class_display}
@{selected|race_display}, @{selected|background}
**Jump** - Long [[(@{selected|strength}/2)]] / [[@{selected|strength}]]ft. | High [[((@{selected|strength_mod}+2)/2)]] / [[@{selected|strength_mod}+2]] ft.
**HP: **@{selected|hp} / @{selected|hp|max} | ** AC: ** @{selected|ac} | **Spd: ** @{selected|speed} | **Passive: ** @{selected|passive_wisdom}}}{{description=CHATMENU }} --separator: |   --title:Ability Rolls --**Str @{selected|strength}** *(@{selected|strength_mod})* ,strength|**Dex @{selected|dexterity}** *(@{selected|dexterity_mod})*,dexterity|**Con @{selected|constitution}** *(@{selected|constitution_mod})* ,constitution|**Int @{selected|intelligence}** *(@{selected|intelligence_mod})* ,intelligence|**Wis @{selected|wisdom}** *(@{selected|wisdom_mod})*,wisdom|**Cha @{selected|charisma}** *(@{selected|charisma_mod})*,charisma --title:Saving Throws --Str,strength_save|Dex,dexterity_