This file contains 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 webhook that should be notified when the tunnel is created. In this case, a | |
# webhook handled by a Kynetx ruleset. | |
app_url = "http://webhooks.kynetxapps.net/h/a000x000.dev/set_tunnel" | |
# Create and open the tunnel | |
tunnel = LocalTunnel::Tunnel.new(4567, key, app_url) | |
tunnel.register_tunnel() | |
tunnel.start_tunnel() |
This file contains 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
rule incoming_call { | |
select when phone incoming_call | |
pre { | |
media_state = get_media_state(); | |
new_media_state = (media_state eq "play") => "pause" | media_state; | |
light_level = get_light_level(); | |
new_light_level = (light_level <= 8) => 8 | light_level; | |
} | |
{ | |
set_media_state(new_media_state); |
This file contains 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
ruleset a163x125 { | |
meta { | |
name "JSON parser bug" | |
description << | |
Demonstrates a bug in the JSON parser | |
>> | |
author "Steve Nay" | |
logging off | |
} |
This file contains 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
rule draw { | |
select when explicit draw | |
pre { | |
placeholder = event:param("placeholder"); | |
html = << | |
<div><form> | |
Last name: <input type="text" name="byufb_dir_last" class="inputtext" /> | |
First name: <input type="text" name="byufb_dir_first" class="inputtext" /> | |
<input type="button" value="Search" class="uiButton" onclick="byufb_dir_search_prep();"/> | |
</form></div> |
This file contains 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
/** | |
* Function to pull in TomatoFlix stats through the RESTful web service | |
* on the webhook. Appends a new row with the date and time and each of the stats. | |
* | |
* Set up with a trigger to run once per day in the middle of the night. This can then | |
* be used for aggregating the stats over time. | |
*/ | |
function getTomatoFlixStats() { | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var sheet = ss.getSheets()[3]; |
This file contains 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
function incrementA1() { | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var sheet = ss.getSheets()[2]; | |
var oldValue = sheet.getRange("A1").getValue(); | |
sheet.getRange("A1").setValue(oldValue + 1); | |
} |
This file contains 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
rule draw { | |
select when explicit directory | |
pre { | |
html = << | |
<div><form name="byufb_directory_search" id="byufb_directory_search"> | |
Last name: <input type="text" name="byufb_last" class="inputtext" /> | |
First name: <input type="text" name="byufb_first" class="inputtext" /> | |
<input type="button" value="Search" class="uiButton" onclick="byu_fb_submit();"/> | |
</form></div> | |
<div id="byufb_dir_res"> </div> |
This file contains 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
ruleset a163x111 { | |
meta { | |
name "Raise event test" | |
description << | |
Original rule. Events can be raised to this rule from itself or from 112. | |
Run at http://ktest.heroku.com/a163x111 | |
>> | |
author "Steve Nay" | |
logging off | |
} |
This file contains 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
rule booklist { | |
select when web pageview "booklist.byu.edu/cas/mybooks.cfm" | |
pre { | |
my_form = << | |
<div style="display: none;"> | |
<form id="isbnForm" onsubmit="return false"> | |
<input name="isbn" value="nonsense" /> | |
<input type="submit" /> | |
</form> | |
</div> |
This file contains 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
fired { | |
app:netflix += 1 from 1; | |
} |