Skip to content

Instantly share code, notes, and snippets.

View p4535992's full-sized avatar
🙄
I may be slow to respond.

4535992 p4535992

🙄
I may be slow to respond.
View GitHub Profile
@p4535992
p4535992 / ua.md
Created May 27, 2020 16:32 — forked from jwodder/ua.md
D&D 5e Unearthed Arcana Index

D&D 5e Unearthed Arcana Index

Because finding anything in this page is harder than it should be

Date Article PDF Contents
2015-02-02 Unearthed Arcana: Eberron UA_Eberron_v1.1.pdf Changelings, shifters, warforged, Wizard (Artificer), rules for action points, dragonmarks
@p4535992
p4535992 / ReadExcelToJson.java
Created May 3, 2024 13:57 — forked from dhval/ReadExcelToJson.java
Convert Excel to JSON
#!/usr/bin/java --source 12 --class-path /Users/dhval/project/jar/poi-3.16/lib/*
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.*;
package imap_pop3_email.actions;
import imap_pop3_email.proxies.Attachment;
import imap_pop3_email.proxies.AttachmentPosition;
import imap_pop3_email.proxies.EmailAccount;
import imap_pop3_email.proxies.EmailMessage;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
@p4535992
p4535992 / Explorer.gwt.xml
Created November 14, 2023 10:28 — forked from branflake2267/Explorer.gwt.xml
GXT 4 permutations, setting specific build properties.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.7.0//EN"
"http://gwtproject.org/doctype/2.7.0/gwt-module.dtd">
<module rename-to='explorer'>
<inherits name='com.google.gwt.activity.Activity' />
<inherits name='com.google.gwt.place.Place' />
<inherits name="com.google.gwt.inject.Inject" />
<inherits name='com.sencha.gxt.examples.resources.Resources' />
<inherits name='com.sencha.gxt.chart.Chart' />
@p4535992
p4535992 / 0-JS-SORTABLE-TABLE.MD
Created September 18, 2023 11:04 — forked from code-boxx/0-JS-SORTABLE-TABLE.MD
Javascript Sortable Table
@p4535992
p4535992 / foundry-item-permission.js
Created May 20, 2020 07:11 — forked from janssen-io/foundry-set-folder-permissions.js
Change the permissions of items in bulk in FoundryVTT.
var folderName = "Test";
var reqPermission = 0; // 0=None, 1=Limited, 2=Observer, 3=Owner
/*****
WARNING: This will overwrite the permissions of the items in the folder <folderName>!
That is, it will not keep the player permissions!
Tested on FoundryVTT 0.5.5
******/
async function determineWeather(currentWeather) {
//roll the dice and get the result
let diceRoll = await new Roll("1d20").evaluate()
let diceResult = await diceRoll.result
// selects the table to roll based on current weather input from Dialog
let tableToRoll
switch (currentWeather) {
case "no":
@p4535992
p4535992 / foundryvtt-token-vision.js
Created May 16, 2020 17:54 — forked from Aarowaim/foundryvtt-token-vision.js
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) => {
var obj = {};
fields.forEach((field, index) => {
@p4535992
p4535992 / ManageHashPdfBox
Created February 2, 2018 15:35
A static method for extract hash/digest from a pdfbox document object to sign and the static method to "insert" the new hash/digest signed to the pdf box object
public static byte[] createHashToSignFromPdfFile(InputStream pdf2sign, OutputStream fos, String sigName, String sigLocation,String sigReason,String contactInfo,Date forcedDate,Long revisionId) throws IOException {
File pdfFileToSigned = TempFileProvider.createTempFile("chars", ""+Calendar.getInstance().getTimeInMillis());
File pdfPreparedToBeSigned = TempFileProvider.createTempFile("chars", ""+Calendar.getInstance().getTimeInMillis());
File pdfHashPreparedToBeSigned = TempFileProvider.createTempFile("chars", ""+Calendar.getInstance().getTimeInMillis());
try{
if(fos == null) fos = new FileOutputStream(pdfPreparedToBeSigned);
FileUtils.copyInputStreamToFile(pdf2sign,pdfFileToSigned);
final byte[] signatureBytes = FileUtils.readFileToByteArray(pdfFileToSigned);
// FROM Jenthura ( https://github.com/jenthura/foundryVTT5eConditionRulesMacro/blob/master/ConditionRulesMacro.js )
function postToChat(conditionName, imgURL, message){
let chatData = {
user: game.user._id,
speaker: {alias: "Conditions"},
content: `<div class="dnd5e chat-card" style="text-align: center"><header class="card-header flexrow"><h3 class="item-name">${conditionName}</h3></div><br><div style="text-align: center"><img width=75% height=50% src="${imgURL}"</img></div><br>${message}`
};
ChatMessage.create(chatData, {});
};