Skip to content

Instantly share code, notes, and snippets.

View rileydutton's full-sized avatar

Riley Dutton rileydutton

  • Overland Park, KS
View GitHub Profile
@rileydutton
rileydutton / savageworlds.css
Created April 7, 2014 15:13
Example Savage Worlds Roll20 sheet
.charsheet label {
display: inline-block;
width: 75px;
text-align: right;
}
.charsheet input {
display: inline-block;
width: 165px;
}
EDID report generated by SwitchResX Version 4.4.0 (Intel - 64-bit) for display ASUS PB287Modified
-----------------------------------------------------
------------------- RAW DATA ------------------------
-----------------------------------------------------
0 1 2 3 4 5 6 7 8 9 A B C D E F
-----------------------------------------------------
0 | 00 FF FF FF FF FF FF 00 04 69 A2 28 DA C0 01 00
1 | 10 18 01 04 A5 3E 22 78 3A 1C B5 A3 57 4F A0 27
@rileydutton
rileydutton / latency.js
Created October 31, 2014 21:45
Firebase latency
var timeoutRef = new Firebase(window.FIREBASE_ROOT + window.campaign_storage_path + "/players/" + window.currentPlayer.id + "/lastActive");
var timeoutTimeout;
var timeoutRefTimedOut = false;
$connerror = $("#connectionerror");
var notifyInterrupted = function() {
console.log("Timeout ref showed error!");
timeoutRefTimedOut = true;
$connerror.show();
@rileydutton
rileydutton / init.js
Created January 21, 2015 01:53
Mirrorshades Auto-Init Script
//TO USE THIS:
// To make an initiative roll, have the player do their normal intiiative roll, and add "!init" on the end. For example
// /roll 3d6+5 !init
// This will show the roll like normal, plus auto-add turns to the turn tracker for them for each multiple of 7.
//
// The GM can also easy clear the turn tracker by doing:
// !clearinit
//
on("chat:message", function(op) {
// define a function that increments a counter in a loop
function closureExample() {
var i = 0;
for (i = 0; i< 3 ;i++) {
setTimeout(function() {
console.log('counter value is ' + i);
}, 1000);
}
<input name="attr_repeating_test_0_field" type="text" />
<fieldset class="repeating_inventory">
<table>
<tr border="1">
<td><input type="text" style="width:50px" name="attr_weight" value="0" title="item's weight" /></td>
</tr>
</table>
</fieldset>
<script type="text/worker">
Test: <input type="text" name="attr_Test" /><br />
test: <input type="text" name="attr_test" /><br />
TEST: <input type="text" name="attr_TEST" /><br />
<hr />
SheetWorker: <input type="text" name="attr_SheetWorker" style="pointer-events: none;" /><br />
SHEETWORKER: <input type="text" name="attr_SHEETWORKER" style="pointer-events: none;" />
<script type="text/worker">
on("change:test", function() {
<div class="compendium-drop-target">
<input type="hidden" name="attr_ImportedComponents" accept="Components" />
<input type="checkbox" value="1" name="attr_ComponentV" /> V
</div>
<script type="text/worker">
on("change:ImportedComponents", function() {
getAttrs(["ImportedComponents"], function(data) {
var splitComponents = data.ImportedComponents.split(" ");
var attrsToSet = {};
CLICKED
compiled.js:29153 Updating character sheet values
compiled.js:29155 Really updating character sheet values
compiled.js:29257 Setting up repeating sections took until 8ms
compiled.js:29311 Finding list of dirty attributes took until 9ms
VM45:1543 TRACE:updateAbility ability:STR
compiled.js:29320 Querytest took until 10ms
compiled.js:29463 Set values took until 15ms
compiled.js:29474 Took 19ms
compiled.js:29153 Updating character sheet values
<fieldset class="repeating_test">
<input type="text" name="attr_foo" />
</fieldset>
<script type="text/worker">
on("change:repeating_test", function() {
log("Heard repeating test change");
});