This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on("chat:message", function(msg) { | |
if(msg.type == "api" && msg.content.indexOf("!show") !== -1) { | |
var charName = msg.content.replace("!show ", ""); | |
var charToken = findObjs({_type: "graphic", name: charName})[0]; | |
if(!charToken) { | |
return; | |
} | |
if(charToken.get("layer") == "gmlayer"){ | |
charToken.set("layer", "objects"); | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on("change:token", function(obj, prev) { | |
if(obj.get("left") === prev["left"] && obj.get("top") === prev["top"]) return; | |
var dragon = findObjs({"name": "Dragon"})[0]; | |
if(dragon.get("layer") == "objects") return; //already triggered | |
if(objInPath(obj, getObj("path", "-It0Qq-YsN3s_oa_a_Zi"))) { | |
//You woke the dragon! | |
dragon.set({ | |
layer: "objects" | |
}); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//The light is closing in on you... | |
on("change:token", function(obj, prev) { | |
//Only do this if we actually moved. | |
if(obj.get("left") == prev["left"] && obj.get("top") == prev["top"]) return; | |
obj.set({ | |
light_radius: Math.floor(obj.get("light_radius") * 0.90) | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CLAIMS_MAP = { | |
:expires => :exp, | |
:notBefore => :nbf, | |
:admin => :admin, | |
:debug => :debug, | |
:simulate => :simulate | |
} | |
def create_options_claims(options) | |
opts = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var container = Ti.UI.createView({backgroundColor: "white", layout: "vertical"}); | |
var layout = [ | |
{ | |
title: "Parent 1", | |
isparent: true, | |
opened: false, | |
sub: [ | |
{ |
NewerOlder