Skip to content

Instantly share code, notes, and snippets.

View lhayhurst's full-sized avatar

Lyle Hayhurst lhayhurst

View GitHub Profile
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
for(var i = 0; i < 100000; i++) { btn = document.getElementById("wishlist-submit"); if ( btn.disabled == false ) { btn.click(); console.log("wishlist-submit button pressed!"); break; } else { await sleep(1); if ( i% 1000 == 0 ) { console.log(i/1000 + " seconds have elapsed"); } } }
@lhayhurst
lhayhurst / gist:2a305fb7ad224de88f45
Created February 9, 2016 14:10
sqlalchemy query example
filters = [
TourneyList.tourney_id == Tourney.id ,
ArchtypeList.id == TourneyList.archtype_id,
Ship.archtype_id == ArchtypeList.id ,
Ship.ship_pilot_id == ShipPilot.id ,
ShipPilot.pilot_id == Pilot.id
]
sql = session.query(
sqlalchemy.extract('year', Tourney.tourney_date).label("year"),
@lhayhurst
lhayhurst / CharacterInterchangeFormat_noAttributes.dtd
Created March 23, 2012 16:08
Character interchange document: Basic DTD + XML, with and without attributes
<?xml version="1.0"?>
<!DOCTYPE character_interchange_document [
<!ELEMENT character_interchange_document (character+)>
<!ELEMENT character (character_name,playername,role)>
<!ELEMENT character_name (#PCDATA)>
<!ELEMENT playername (#PCDATA)>
<!ELEMENT role (#PCDATA)>
]>
<character_interchange_document>
@lhayhurst
lhayhurst / Background.xml
Created March 23, 2012 03:43
Background attributes
<character_interchange_document>
<character name="harsk">
<background>
<personal gender="male" age="60" hair="black" eyes="black" skin="" />
<deity>Torag</deity>
<alignment>Lawful Neutral</alignment>
<race referenceurl="http://paizo-local/pathfinderRPG/prd/races.html#_dwarves">Dwarf</race>
<languages>
<language>Common</language>
<language>"Dwarven"</language>
@lhayhurst
lhayhurst / race.xml
Created March 23, 2012 01:28
Examples of ways of doing race.
<race racetext="Dwarf" name="Dwarf" ethnicity=""/> <!-- Herolabs way -->
<race referenceurl="http://paizo-local/pathfinderRPG/prd/races.html#_dwarves">Dwarf</race> <!-- CAnthony way -->