Skip to content

Instantly share code, notes, and snippets.

View raytiley's full-sized avatar

Ray Tiley raytiley

View GitHub Profile
@raytiley
raytiley / create-show.php
Created November 6, 2013 21:48
Example of how to create a show in Cablecast using php
$newShow = array(
'LocalID' => 'Sweet Local ID',
'LocationID' => 1,
'ProjectID' => 0,
'CGExempt' => 0,
'ProducerID' => 0,
'CategoryID' => 0,
'OnDemand' => 0,
'Comments' => '',
'OnDemandStatus' => '',
{{view Ember.Table.TablesContainer
controllerBinding="filesTableController"
contentBinding="files"}} <!-- How do you do this? -->
function pad(n, width, z) {
z = z || '0';
n = n + '';
return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
}
Ember.Model.dataTypes[Date] = {
deserialize: function(string) {
if(!string) { return null; }
if(string.match(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$/)) {
var deferred = Ember.Deferred.create(),
testObj = {test: 'testing'};
deferred.then(
function() {
return testObj;
})
.then(
function(test) {
console.log(test);
@raytiley
raytiley / gist:5980470
Created July 12, 2013 00:31
Probably a shameful example of how to do things wrong.
embedCode: function() {
var config = this.get('show.location.vodConfiguration');
if(!config || !config.get('isLoaded'))
return '';
var fileName = this.get('fileName'),
baseUrl = config.get('baseUrl'),
template = config.get('embedTemplate');
<table class="table table-striped table-bordered table-condensed" style="table-layout: fixed">
<thead>
<tr>
<th style="width:50%">File</th>
<th style="width:10%">Actions</th>
<th style="width:10%">Size</th>
<th style="width:10%">Server</th>
<th style="width:10%">Details</th>
</tr>
</thead>
App.FilesValidController = App.PaginationController.extend({
filesBinding: 'content',
goToPage: function(page) {
var offset = page -1;
this.set('pagerProps.offset', offset);
//hack
var files = App.DigitalFile.find({isValid:true, isOrphaned: false, offset:offset});
files.meta = this.get('pagerProps');
this.set('model', App.DigitalFile.find({isValid:true, isOrphaned: false, offset:offset}));
}
<thead>
<tr>
<th style="width:50%">File</th>
<th style="width:10%">Actions</th>
<th style="width:10%">Size</th>
<th style="width:10%">Server</th>
<th style="width:10%">Details</th>
</tr>
</thead>
<tbody>
@raytiley
raytiley / massSave.js
Last active December 19, 2015 05:48
Looking for someone to sanity check me. Even with a 10 second delay on the server, the console message gets logged immediatly indicating that $.when is resolving the promises immediately.
var clips = [
App.Clip.create({name: 'test one'}),
App.Clip.create({name: 'test two'}),
];
var saveAll = function() {
clips.map(function(clip) {
return clip.save();
});
}
<?php
//Configure Script
$server = "http://50.200.83.14/"; //include trailing backslash
$channelID = 3; //Cablecast Channel ID
$displayDays = 0; //Number of Days to Display
$showDetailsURL = "/?page_id=540&"; // Must end with a '?' or '&'
date_default_timezone_set('America/New_York');
//End Configure
//SOAP Client Setup