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 / 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) {
@rileydutton
rileydutton / setheaders.rb
Created May 20, 2011 14:00
Easy way to set cache control and public read permissions on all files in an S3 bucket (in Ruby)
AWS::S3::Base.establish_connection!(
:access_key_id => "YOUR KEY ID",
:secret_access_key => "YOUR ACCESS KEY"
)
finished = false
lastkey = nil
while(!finished)
objects = AWS::S3::Bucket.objects('YOUR BUCKET NAME', :marker => lastkey)
@rileydutton
rileydutton / scraper.php
Created June 13, 2011 22:51
Website Scraper
<?php
include 'phpQuery-onefile.php';
$file = 'http://www.usbr.gov/lc/region/g4000/riverdata/gage-month-table.cfm?GAGE=3'; // see below for source
// loads the file
// basically think of your php script as a regular HTML page running client side with jQuery. This loads whatever file you want to be the current page
phpQuery::newDocumentFileHTML($file);
// 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">
CLAIMS_MAP = {
:expires => :exp,
:notBefore => :nbf,
:admin => :admin,
:debug => :debug,
:simulate => :simulate
}
def create_options_claims(options)
opts = {}
// Guards on patrol...
on("ready", function() {
//Wait until the ready event fires so we know the campaign is completely loaded.
//Get a reference to our patrolling token.
log("Going Guard A...");
var patroltoken = findObjs({_type: "graphic", name: "Guard A"})[0]; //We know there is a token in the Campaign called "Guard A".
if(!patroltoken) {
log("NO GUARD A");
// Guards on patrol...
on("ready", function() {
//Wait until the ready event fires so we know the campaign is completely loaded.
//Get a reference to our patrolling token.
log("Going Guard A...");
var patroltoken = findObjs({_type: "graphic", name: "Guard A"})[0]; //We know there is a token in the Campaign called "Guard A".
if(!patroltoken) {
log("NO GUARD A");