Skip to content

Instantly share code, notes, and snippets.

View raytiley's full-sized avatar

Ray Tiley raytiley

View GitHub Profile
@raytiley
raytiley / ClosureExample.js
Created April 22, 2012 23:57
Design Phase 4 - Closure Example
var module = function(){
var privateVar = “I’m out of scope since function executes and returns”;
//getPrivateVar is a property of the returned function.
this.getPrivateVar = function() {
return privateVar;
}
}(); // () causes anonymous function to automatically execute
module.getPrivateVar === “I’m out of scope since function executes and returns”; //true
@raytiley
raytiley / show-runs.php
Created July 18, 2012 13:03
Messed around with customer's file
<?php
date_default_timezone_set('America/New_York');
$client = new SoapClient('http://frontdoor.ctn5.org/CablecastWS/CablecastWS.asmx?WSDL', array('cache_wsdl' => 0));
$searchLength = strtotime(date("Y-m-d")."T".date("H:i:s")) + (60*60*24*35);
$channelID = 1;
$showID = 1;
$schedule = $client->GetScheduleInformation(array(
'ChannelID' => $channelID,
'FromDate' => date("Y-m-d")."T00:00:00",
@raytiley
raytiley / schedule-search.php
Created October 12, 2012 02:34
Show search with schedule display - GROSS
<?php
$ss = isset($_GET['ss']) ? $_GET['ss'] : "peace"; //use a default search term for testing
$client = new SoapClient("http://tctvsbs.tctv.net/CablecastWS/CablecastWS.asmx?wsdl", array('cache_wsdl' => 0));
$channels = array(
array("name" => "Channel 3", "id" => 1),
array("name" => "Channel 22", "id" => 4),
array("name" => "Channel 26", "id" => 5),
@raytiley
raytiley / kegboard_config.json
Created December 11, 2012 01:11
Kegboard Configs
{
"uno": {
"displayName": "Arduino Uno",
"pins": [
{"pinNumber": 1, "supportedTypes": ["flow", "onewire-temp", "onewire-presence", "relay", "id-12-rfid", "buzzer" ]},
{"pinNumber": 2, "supportedTypes": ["flow", "onewire-temp", "onewire-presence", "relay", "id-12-rfid", "buzzer" ]},
{"pinNumber": 3, "supportedTypes": ["onewire-temp", "onewire-presence", "relay", "id-12-rfid", "buzzer" ]},
{"pinNumber": 4, "supportedTypes": ["onewire-temp", "onewire-presence", "relay", "id-12-rfid", "buzzer" ]}
],
"image": "http://kegbot.org/arduino/images/uno.jpg"
@raytiley
raytiley / kegbaord-config.json
Created December 11, 2012 01:50
Kegboard object response
{
"id": 24,
"boardName": "Ray's Kegboard",
"boardType": "uno",
"pins":[
{"pinNumber": 1, "type": "flow", "name": "Flow Meter A"},
{"pinNumber": 2, "type": "flow", "name": "Flow Meter B"},
{"pinNumber": 5, "type": "buzzer", "name": "Buzzer"},
{"pinNumber": 10, "type": "onewire-temp", "name": "Temperature"},
{"pinNumber": 13, "type": "relay", "name": "Solenoid A"}
@raytiley
raytiley / datepicker-example.js
Created January 30, 2013 23:36
Just a simple jQueryUI based datepicker
<!-- This is the form element that will be transformed into a datepicker -->
<div type="text" id="ScheduleDate style="float:left;margin-left:15px">
<!-- This script finds the above datepicker and when a day is selected goes to the current url with a different date -->
<!-- EXAMPLE: http://YourServer/Schedule.php?date=2012-01-13 -->
<script>
$(function() {
$("#ScheduleDate").datepicker({
onSelect: function(dateText, inst) { window.location.href = location.href.substring(0,location.href.lastIndexOf("?"))+"?date="+dateText},
});
@raytiley
raytiley / creaTV.php
Created February 9, 2013 00:15
Shows how to output an embeded limelight player from mediaID provided in CablecastAPI
<html>
<head><title>CreaTV Limelight Player Example</title></head>
<body>
<h1>Limelight Player From Cablecast API</h1>
<p>
<?php
//Setup Script
$server = "173.11.100.21"; //cablecast server address
$showID = isset($_GET['ShowID']) ? $_GET['ShowID'] : 15859;
$client = new SoapClient("http://$server/CablecastWS/CablecastWS.asmx?WSDL");
@raytiley
raytiley / app.js
Last active December 14, 2015 04:59
How do I set it up so that task view and timeline view get rendered to the appropriate outlets. Both task and timeline view need the context of the specific task that is being viewed. /#/tasks/:task_id
<script type="text/x-handlebars" data-template-name="tasks">
<div class="row">
<div class="span3">
<h3>Task Sets</h2>
<ul>
{{#each taskSet in controller}}
<li>{{#linkTo "taskSet" taskSet}}{{ taskSet.name }}{{/linkTo}}</li>
{{/each}}
</ul>
</div>
<?php
//Configure Script
$server = "http://129.19.150.20/"; //include trailing backslash
//End Configure
$client = new SoapClient($server."CablecastWS/CablecastWS.asmx?WSDL"); // Creates New SOAP client using WSDL file
//Get the schedule from the web service
$result = $client->RenameDigitalFile(array(
@raytiley
raytiley / ember-sortable-list.js
Created March 23, 2013 04:25
Creating a sortable view using the html5sortable plugin and emberjs
// Working on getting html5sortable plugin working
// Key part is needing to call the sortable() method using Ember.run.next
// If called straight away the functionality quickly gets applied, but then is lost
// At least that's what it looks like when stepping through chrome debugger
// http://farhadi.ir/projects/html5sortable/
App.SortableView = Ember.CollectionView.extend({
tagName: 'ul',
itemViewClass: 'App.SortableItemView',