Skip to content

Instantly share code, notes, and snippets.

View raytiley's full-sized avatar

Ray Tiley raytiley

View GitHub Profile
var deferred = Ember.Deferred.create(),
testObj = {test: 'testing'};
deferred.then(
function() {
return testObj;
})
.then(
function(test) {
console.log(test);
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}$/)) {
{{view Ember.Table.TablesContainer
controllerBinding="filesTableController"
contentBinding="files"}} <!-- How do you do this? -->
@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' => '',
<?php
echo "Create a show";
//Configure Script
date_default_timezone_set('America/New_York'); // Set this to timezone of Cablecast Server
$server = "http://demo.trms.com/"; //include trailing backslash
//End Configure
$server = $server."CablecastWS/CablecastWS.asmx?WSDL";
@raytiley
raytiley / gist:8340706
Created January 9, 2014 19:48
An example of subexpressions in handlebars
{{#if (equal 'test' (to-lower value))}}
<!-- value.toLowerCase() ==== 'test' -->
{{else}}
{{/if}}
test("Issue 4201", function() {
expect(1);
Router.map(function() {
this.resource('lobby', function() {
this.route('index', {
path: ':lobby_id'
});
this.route('list');
});
});

Right now the proposal is to define the names of the query params in one spot on the controller like this:

App.IndexController = Ember.ArrayController.extend({
  queryParams: ['search', 'sort']
  search: null,
  sort: null
});

#Lurker to Commiter

Ember is an extremely fast moving framework with lots going on. With all the activity in can be hard to know how to jump in and help. In this session we'll cover how to get up to speed with the Ember development practices, ways to ease the learning curve of working on Ember.js internals, and what areas the Ember core team are looking for help in.

@raytiley
raytiley / auth.js
Last active August 29, 2015 13:56
A controller using SimpleLogin from Firebase. Returns promises from login / logout to make working with Ember Routing simple.
var dbRef = new Firebase("https://YOUR-FIREBASE.firebaseio.com/");
export default Ember.Controller.extend({
/**
@property currentUser
@type {User}
@default null
*/
currentUser: null,