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
var userModel_pd = Backbone.Model.extend({ | |
// Default attributes for the todo item. | |
defaults: function() { | |
return { | |
token: "Token here", | |
name: "Name here", | |
householdId: "Household ID here", | |
householdName: "Household name", | |
expiration: 0, // need to bind a the log-in event to this object changing to !0 | |
structure: {}, |
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
var userModel_pd = Backbone.Model.extend({ | |
// Default attributes for the todo item. | |
defaults: function() { | |
return { | |
token: "Token here", | |
name: "Name here", | |
householdId: "Household ID here", | |
householdName: "Household name", | |
expiration: 0, // need to bind a the log-in event to this object changing to !0 |
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
var currentTime = new Date(); | |
//MODEL: DEFAULT ATTRIBUTES OF DEVICE MODEL | |
var deviceModel = Backbone.Model.extend({ | |
defaults: function() { | |
return { | |
name: "empty...", | |
id: -100, | |
location: "", |
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
var SessionView = Backbone.View.extend({ | |
el: $(".login_box"), | |
// ... events, initialize, render ... | |
temp_button: function(){ | |
console.log('trying'); | |
this.trigger('devicesReady'); | |
} |
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
/** | |
* Lists models that match user ID. | |
*/ | |
public function actionIndex() | |
{ | |
$checkId = yii::app()->user->id; | |
$dataProvider=new CActiveDataProvider('Crop', array( | |
'criteria'=>array( | |
'condition'=>$checkId.'=:userid', | |
), |
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
//please don't use this in building the next space shuttle :) | |
//var vertex is an array which has all our points to build our polygon with | |
testPolygon = new google.maps.Polygon({ paths: vertex, fillColor: color, geodesic: true, fillOpacity: 1, strokeColor: '#00ff00', strokeWeight: 1, strokeOpacity: 0.6 }); | |
count= 0; | |
while (count<vertex.length){ | |
//lets check the angle between the last two vectors | |
if (count == vertex.length - 2){ |
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 determinant(vector1, vector2) | |
{ | |
return vector1.x * vector2.y - vector1.y * vector2.x; | |
} | |
function lineSegmentsIntersect(_segment1_Start, _segment1_End, _segment2_Start, _segment2_End) | |
{ //note the use of 'subtract' | |
det = determinant(_segment1_End.subtract(_segment1_Start), _segment2_Start.subtract(_segment2_End)); | |
t = determinant(_segment2_Start.subtract(_segment1_Start), _segment2_Start.subtract(_segment2_End)) / det; |
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
describe "Events", -> | |
beforeEach -> | |
@truth = truth: (term) -> term | |
@different = different: -> 'other' | |
@TestObject = @truth | |
HE.Event.Subscribe "know:truth", @TestObject.truth | |
@currentChannel = HE.Event.Channels['know:truth'][0] | |
@callback = @currentChannel.callback |
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
# Mediator Pattern from: http://addyosmani.com/largescalejavascript/ | |
# | |
# The HE.Event object manages a list of channels, where each channel | |
# holds a list of actions. | |
# | |
# To subscribe an object to an event: | |
# HE.Event.Subscribe "event", object.functionToHandleEvent | |
# | |
# To publish an event: | |
# HE.Event.Publish "event" |
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
describe "Events", -> | |
beforeEach -> | |
@truth = truth: (term) -> term | |
@falsehood = falsehood: -> 'other' | |
@TestObject = @truth | |
HE.Event.Subscribe "know:truth", @TestObject.truth | |
@currentChannel = HE.Event.Channels['know:truth'][0] | |
@callback = @currentChannel.callback |
OlderNewer