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 | |
//Setup Content drives and Destination path | |
$contentPaths = array("/Volumes/VS400/", "/Volumes/SXServer/", "/Volumes/SXSafe/"); | |
$destinationPath = "/Volumes/VODContent/mp4/"; | |
$transcodeCommand = "HandBrakeCLI --preset \"iPhone & iPod Touch\" --width 320 --vb 500 --two-pass --turbo --optimize "; | |
//pid class used to determine if script is already running. | |
class pid { |
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 | |
/* | |
This script prints an html table of all shows that are availalbe for VOD on the server | |
The shows must have valid event dates that are in the past | |
*/ | |
//SETUP | |
date_default_timezone_set('America/New_York'); //Probably doesn't really matter. A few hours shouldn't make a difference | |
$serverAddress = "http://pittsfieldtv.dyndns.org/"; //This will be where you can publically log onto front door. Rembember to leave off trailing slash | |
$channelID = 1; //One will work for most stations unless you've deleted channels in the past | |
//END SETUP |
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
//Grab a SHA1 of the first 100MB file | |
LogToolbox.TraceMessage(string.Format("{0}: Generating SHA1: {1}", m_Parent.CMName, file.Key)); | |
using (HashAlgorithm sha = new SHA1CryptoServiceProvider()) | |
{ | |
FileStream fs = null; | |
try | |
{ | |
int bytesToSHA = 1024 * 1024 * 100; //100MB | |
byte[] first100MB = new byte[bytesToSHA]; | |
fs = new FileStream(file.Key, FileMode.Open, FileAccess.Read); |
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 http = require('http'); | |
var net = require('net'); | |
var url = require('url'); | |
//Config Settings | |
var HOST = 'demo.trms.com'; | |
var PORT = 56906; | |
var USERNAME = 'Admin'; | |
var PASSWORD = 'demotrms'; |
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
// api/routes?start=300 main st boston&end=550 elm st boston&cost_table=popularity&route_type=cycle | |
app.get('api/routes', function(req,res){ | |
//Parse Request for parameters | |
var start = req.params.start, | |
end = req.params.end, | |
costTable = req.params.cost_table, | |
routeType = req.params.route_type; | |
//Geocode Start and End | |
geoCoder.geocode([start,end], function(geoCodedResponse){ | |
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
//Anything not exported would be private and not accessible from the loaded module. | |
var privateVariable = 'I would be hidden'; | |
//Public Method | |
//Returns JSON object of invalid properties and error descriptions | |
exports.validateReport = function(report) { | |
var errors = undefined; | |
//Return an object of propertyName : errorMessages for all invalid fields |
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
//Anything not exported would be private and not accessible from the loaded module. | |
var privateVariable = 'I would be hidden'; | |
//Public Method | |
//Async geocodes array of search strings and calls callback with array of response when finished | |
exports.geocode = function(searchArray, callback(responseArray)) { | |
// Asynchronously geocode search array then execute callback | |
} |
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
exports.createReport = function(report, callback(err, data)) { | |
//Persist the report object to database | |
//Update cost tables if needed | |
//Execute callback | |
} | |
exports.updateReport = function(report, callback(err, data)) { | |
//Update report object in database | |
//Update cost tables if needed | |
//Execute callback |
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
exports.getRoute = function(startLat, startLon, endLat, endLon, routeType, costTable, callback(err, data)) { | |
//Return GeoJson route from pgRouting | |
//Execute callback | |
} | |
exports.updateCost = function(lat, lon, costTable, costDelta) { | |
//Update the cost of closest edge in costTable by costDelta | |
//Execute callback | |
} |
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
//Include required modules and setup some variables | |
var reportsRepo = require('ReportsRepository'), | |
routingServ = require('RoutingService'), | |
TIMEOUT = 1000 * 60 * 5; // 5 minutes | |
setTimeout(function(){ | |
//Lookup all unresolved reports that should be resolved due to current time | |
reportsRepo.getUnresolvedTimeReports(function(err, data){ | |
//Itterate through each report | |
for(report in data) { |