Skip to content

Instantly share code, notes, and snippets.

View stephaned68's full-sized avatar

Stéphane Devouard stephaned68

View GitHub Profile
@stephaned68
stephaned68 / Roll20ModHTMLHelper.js
Last active January 21, 2024 10:30
Roll20 Mod Scripts HTML Helper
/**
* HTML helper functions
*/
const hh = {
/**
* Return a string of style definitions
* @param {object} list key-value pairs
* @returns {string} style property
*/
getStyle: function (list) {
@stephaned68
stephaned68 / Roll20ModAPIbase.js
Last active March 30, 2024 08:24
A template for writing Roll20 MOD scripts
/**
* Last update : 2024-03-30
* How to use :
* - Rename the ModName variable in the factory function declaration
* - Change the MOD_COMMAND constant if not the same as the MOD script name
* - Rename the ModName reference in the on('ready') callback function
* - Change the STATEKEY value. This will be used to save state, as well as the name of the MOD and its API !command
*/
var ModName =
@stephaned68
stephaned68 / Documents\PowerShell\Microsoft.PowerShell_profile.ps1
Last active November 16, 2022 15:52
My Powershell profile (code $PROFILE) with Oh-My-Posh, Terminal-Icons, PSReadLine and Zoxide
# Oh-My-Posh
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH/takuya.omp.json" | Invoke-Expression
# Import Modules
Import-Module posh-git
Import-Module Terminal-Icons
Import-Module PSReadLine
Import-Module z
# Set Modules Options
@stephaned68
stephaned68 / realname.js
Last active March 30, 2021 10:10
A Roll20 API script to rename character sheets and linked tokens ** Not compatible with COFantasy.js **
/**
* Usage :
* !realname xxxxx
* Where xxxxx is the real name of the NPC
* If the name contains spaces, replace them by a + in the chat command, as in :
* !realname red+blade+assassin
*
* Add a line to the GM notes on the character sheets
* realname=xxxxx
* e.g.
@stephaned68
stephaned68 / convert_metrics.js
Last active September 8, 2020 18:32
A Roll20 API script to convert the page and the lighting settings of all NPC tokens from imperial to metric system
/**
* Syntax: !metric
* This script loops through all tokens in the current page
* Any token attached to a character has its lighting properties converted from feet to meters
* The page settings are also converted to using 'm' instead of 'ft'
* This script must be run by the GM of the campaign
* @version : 1.0.0
*/
on('chat:message', function (msg) {